30#include "MantidNexus/NexusFile.h"
45 return std::find(std::begin(monitorBlocks), std::end(monitorBlocks), dataBlock) != std::end(monitorBlocks);
49 for (
auto &dataBlock : dataBlocks) {
50 if (matchesMonitorBlock(dataBlock)) {
63using namespace Kernel;
66using namespace HistogramData;
71 : m_filename(), m_instrument_name(), m_samplename(), m_detBlockInfo(), m_monBlockInfo(), m_loadBlockInfo(),
72 m_have_detector(false), m_hasVMSBlock(false), m_load_selected_spectra(false), m_wsInd2specNum_map(),
73 m_spec2det_map(), m_entrynumber(0), m_tof_data(), m_spec(), m_spec_end(nullptr), m_monitors(), m_logCreator(),
74 m_progress(), m_nexusFile() {}
83 if (descriptor.
isEntry(
"/raw_data_1",
"NXentry")) {
93 const std::vector<std::string> exts{
".nxs",
".n*"};
95 "The name of the Nexus file to load");
98 auto mustBePositiveSpectrum = std::make_shared<BoundedValidator<specnum_t>>();
99 mustBePositiveSpectrum->setLower(0);
103 auto mustBePositive = std::make_shared<BoundedValidator<int64_t>>();
104 declareProperty(
"EntryNumber",
static_cast<int64_t
>(0), mustBePositive,
105 "0 indicates that every entry is loaded, into a separate "
106 "workspace within a group. "
107 "A positive number identifies one entry to be loaded, into "
110 std::vector<std::string> monitorOptions{
"Include",
"Exclude",
"Separate"};
111 std::map<std::string, std::string> monitorOptionsAliases;
112 monitorOptionsAliases[
"1"] =
"Separate";
113 monitorOptionsAliases[
"0"] =
"Exclude";
115 std::make_shared<Kernel::StringListValidator>(monitorOptions, monitorOptionsAliases),
116 "Option to control the loading of monitors.\n"
117 "Allowed options are Include,Exclude, Separate.\n"
118 "Include:The default is Include option would load monitors with the "
119 "workspace if monitors spectra are within the range of loaded "
121 "If the time binning for the monitors is different from the\n"
122 "binning of the detectors this option is equivalent to the Separate "
124 "Exclude:Exclude option excludes monitors from the output workspace.\n"
125 "Separate:Separate option loads monitors into a separate workspace "
126 "called: OutputWorkspace_monitors.\n"
128 "1: Equivalent to Separate.\n"
129 "0: Equivalent to Exclude.\n");
143 bool bincludeMonitors, bseparateMonitors, bexcludeMonitors;
170 spectrum_index.
load();
171 ndets = spectrum_index.
dim0();
176 }
catch (std::runtime_error &) {
187 for (
auto it = entry.
groups().cbegin(); it != entry.
groups().cend(); ++it) {
188 if (it->nxclass ==
"NXmonitor")
202 if (ndets == 0 && nmons == 0) {
203 if (bexcludeMonitors) {
204 g_log.
warning() <<
"Nothing to do. No detectors found and no monitor "
208 g_log.
error() <<
"Invalid NeXus structure, cannot find detector or monitor blocks.";
209 throw std::runtime_error(
"Inconsistent NeXus file structure.");
229 local_workspace->getAxis(0)->unit() = UnitFactory::Instance().create(
"TOF");
230 local_workspace->setYUnit(
"Counts");
233 m_progress->report(
"Loading instrument and run details");
242 else if (bseparateMonitors) {
249 if (!foundInstrument) {
255 local_workspace->loadSampleAndLogInfoNexus(
m_nexusFile.get());
282 wksp_group->setTitle(local_workspace->getTitle());
286 const std::string prop_name =
"OutputWorkspace_";
289 std::ostringstream os;
291 m_progress->report(
"Loading period " + os.str());
293 local_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
303 wksp_group->addWorkspace(local_workspace);
304 setProperty(prop_name + os.str(), std::static_pointer_cast<Workspace>(local_workspace));
307 setProperty(
"OutputWorkspace", std::dynamic_pointer_cast<Workspace>(wksp_group));
309 setProperty(
"OutputWorkspace", std::dynamic_pointer_cast<Workspace>(local_workspace));
315 if (bseparateMonitors) {
322 auto monitor_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
338 local_workspace->setMonitorWorkspace(monitor_workspace);
340 ISISRunLogs monLogCreator(monitor_workspace->run());
341 monLogCreator.
addPeriodLogs(1, monitor_workspace->mutableRun());
343 const std::string monitorPropBase =
"MonitorWorkspace";
344 const std::string monitorWsNameBase = wsName +
"_monitors";
347 monitor_group->setTitle(monitor_workspace->getTitle());
350 std::ostringstream os;
352 m_progress->report(
"Loading period " + os.str());
354 monitor_workspace = std::dynamic_pointer_cast<DataObjects::Workspace2D>(
357 monLogCreator.
addPeriodLogs(
static_cast<int>(p), monitor_workspace->mutableRun());
362 auto data_ws = std::static_pointer_cast<API::MatrixWorkspace>(wksp_group->getItem(p - 1));
363 data_ws->setMonitorWorkspace(monitor_workspace);
367 monitor_group->addWorkspace(monitor_workspace);
368 setProperty(monitorPropBase + os.str(), std::static_pointer_cast<Workspace>(monitor_workspace));
373 setProperty(monitorPropBase, std::dynamic_pointer_cast<Workspace>(monitor_group));
378 setProperty(monitorPropBase, std::static_pointer_cast<Workspace>(monitor_workspace));
381 g_log.
information() <<
" no monitors to load for workspace: " << wsName <<
'\n';
401 const Run &run = ws->run();
409 g_log.
warning(
"Workspace has not proton_charge_by_period log");
422 bool range_supplied(
false);
431 if (bexcludeMonitor || bseparateMonitors) {
438 range_supplied =
true;
445 range_supplied =
true;
450 if (spec_min > spec_max) {
451 throw std::invalid_argument(
"Inconsistent range properties. SpectrumMin is "
452 "larger than SpectrumMax.");
456 std::string err =
"Inconsistent range property. SpectrumMax is larger than number of "
459 throw std::invalid_argument(err);
465 std::string err =
"Invalid entry number entered. File contains " +
467 throw std::invalid_argument(err);
475 std::vector<specnum_t> spec_list =
getProperty(
"SpectrumList");
476 auto hasSpecList =
false;
478 if (!spec_list.empty()) {
482 std::sort(spec_list.begin(), spec_list.end());
487 bool isSpectraListTooLarge;
488 bool isSpectraListTooSmall;
491 if (bseparateMonitors) {
494 isSpectraListTooLarge = spec_list.back() > std::max(maxMonBlock, maxLoadBlock);
495 isSpectraListTooSmall = spec_list.front() < std::min(minMonBlock, minLoadBlock);
498 isSpectraListTooLarge = spec_list.back() > maxLoadBlock;
499 isSpectraListTooSmall = spec_list.front() < minLoadBlock;
502 if (isSpectraListTooLarge) {
503 std::string err =
"The specified spectrum list contains a spectrum number which is "
505 "than the largest loadable spectrum number for your selection of "
506 "excluded/included/separate monitors. The largest loadable "
507 "spectrum number is " +
509 throw std::invalid_argument(err);
511 if (isSpectraListTooSmall) {
512 std::string err =
"The specified spectrum list contains a spectrum number which is "
514 "than the smallest loadable spectrum number for your selection of "
515 "excluded/included/separate monitors. The smallest loadable "
516 "spectrum number is " +
518 throw std::invalid_argument(err);
523 if (range_supplied) {
526 auto isInRange = [&spec_min, &spec_max](
specnum_t x) {
return (spec_min <=
x) && (
x <= spec_max); };
528 spec_list.erase(remove_if(spec_list.begin(), spec_list.end(), isInRange), spec_list.end());
531 for (
auto i = spec_min; i < spec_max + 1; ++i) {
532 spec_list.emplace_back(i);
534 std::sort(spec_list.begin(), spec_list.end());
546 if (bexcludeMonitor || bseparateMonitors) {
547 auto newMonitors = getMonitorsFromComposite(composite,
m_monBlockInfo);
553 if (!newMonitors.isEmpty()) {
560 if (bseparateMonitors && composite.
isEmpty()) {
562 bseparateMonitors =
false;
574 if (range_supplied) {
578 new_monitors.
truncate(spec_min, spec_max);
589 throw std::invalid_argument(
"Your spectrum number selection was not valid. "
590 "Make sure that you select spectrum numbers "
591 "and ranges which are compatible with your "
592 "selection of excluded/included/separate monitors. ");
595 return bseparateMonitors;
611 if (range_supplied || hasSpectraList ||
true) {
614 for (; !generator->isDone(); generator->next()) {
615 auto spec_num =
static_cast<specnum_t>(generator->getValue());
629 std::vector<specnum_t> includedMonitors;
632 auto isMonitor = [&monitors](
specnum_t spectrumNumber) {
return monitors.find(spectrumNumber) != monitors.end(); };
633 for (
const auto &dataBlock : dataBlocks) {
634 auto min = dataBlock.getMinSpectrumID();
635 if (isMonitor(min)) {
637 includedMonitors.emplace_back(min);
639 auto max = dataBlock.getMaxSpectrumID();
648 return block1.last < block2.first;
654 auto allMonitorsIncluded = monitors.size() == includedMonitors.size();
655 if (!includedMonitors.empty() && !allMonitorsIncluded) {
656 for (
auto it = monitors.begin(); it != monitors.end();) {
657 if (std::find(includedMonitors.begin(), includedMonitors.end(), it->first) != includedMonitors.end()) {
668 const auto nSpec = std::accumulate(
670 [](
size_t sum,
const auto &spectraBlock) { return sum + spectraBlock.last - spectraBlock.first + 1; });
685 if (block1.first > block1.last && block2.first > block2.last)
686 throw std::runtime_error(
"LoadISISNexus2: inconsistent spectra ranges");
687 if (block1.last >= block2.first) {
688 throw std::runtime_error(
"LoadISISNexus2: the range of SpectraBlocks must not overlap");
703 bool update_spectra2det_mapping) {
704 int64_t hist_index = 0;
705 int64_t period_index(period - 1);
708 if (spectraBlock.isMonitor) {
712 mondata.
load(1,
static_cast<int>(period - 1));
715 local_workspace->setHistogram(hist_index, BinEdges(timeBins(), timeBins() + timeBins.
dim0()),
718 if (update_spectra2det_mapping) {
719 auto &spec = local_workspace->getSpectrum(hist_index);
722 spec.setSpectrumNo(specNum);
730 const int *
const spec_begin =
m_spec.data();
734 const int64_t blocksize = 8;
735 const int64_t rangesize = spectraBlock.last - spectraBlock.first + 1;
736 const int64_t fullblocks = rangesize / blocksize;
737 int64_t spectra_no = spectraBlock.first;
741 int64_t filestart = std::lower_bound(spec_begin,
m_spec_end, spectra_no) - spec_begin;
742 if (fullblocks > 0) {
743 for (int64_t i = 0; i < fullblocks; ++i) {
744 loadBlock(data, blocksize, period_index, filestart, hist_index, spectra_no, local_workspace);
745 filestart += blocksize;
748 int64_t finalblock = rangesize - (fullblocks * blocksize);
749 if (finalblock > 0) {
750 loadBlock(data, finalblock, period_index, filestart, hist_index, spectra_no, local_workspace);
756 const std::string title = entry.
getString(
"title");
757 local_workspace->setTitle(title);
759 local_workspace->mutableRun().addProperty(
"run_title", title,
true);
760 }
catch (std::runtime_error &) {
764 std::string notes =
"";
767 }
catch (std::runtime_error &) {
770 local_workspace->setComment(notes);
779 m_logCreator->addPeriodLogs(
static_cast<int>(period), local_workspace->mutableRun());
795 data.
load(blocksize, period, start);
796 int *data_start = data();
798 int64_t
final(hist + blocksize);
799 while (hist <
final) {
801 local_workspace->setHistogram(hist, BinEdges(
m_tof_data), Counts(data_start, data_end));
805 auto &spec = local_workspace->getSpectrum(hist);
810 spec.setSpectrumNo(specNum);
824 bool executionSuccessful(
true);
830 }
catch (std::invalid_argument &) {
832 executionSuccessful =
false;
833 }
catch (std::runtime_error &) {
834 g_log.
information(
"Unable to successfully run LoadInstrument Child Algorithm");
835 executionSuccessful =
false;
837 if (executionSuccessful) {
839 const auto &
pmap = localWorkspace->constInstrumentParameters();
840 if (
pmap.contains(localWorkspace->getInstrument()->getComponentID(),
"det-pos-source")) {
841 std::shared_ptr<Geometry::Parameter> updateDets =
842 pmap.get(localWorkspace->getInstrument()->getComponentID(),
"det-pos-source");
843 std::string
value = updateDets->value<std::string>();
844 if (
value.substr(0, 8) ==
"datafile") {
847 updateInst->setPropertyValue(
"Filename",
m_filename);
848 if (
value ==
"datafile-ignore-phi") {
849 updateInst->setProperty(
"IgnorePhi",
true);
851 "in the data file except for the phi values");
858 updateInst->execute();
871 API::Run &runDetails = local_workspace->mutableRun();
890 g_log.
debug() <<
"Sample geometry - ID: " << local_workspace->mutableSample().getGeometryFlag()
891 <<
", thickness: " << local_workspace->mutableSample().getThickness()
892 <<
", height: " << local_workspace->mutableSample().getHeight()
893 <<
", width: " << local_workspace->mutableSample().getWidth() <<
"\n";
903 alg->setPropertyValue(
"Filename", this->
getProperty(
"Filename"));
906 alg->executeAsChildAlg();
907 }
catch (std::runtime_error &) {
908 g_log.
warning() <<
"Unable to load run logs. There will be no log "
909 <<
"data associated with this workspace\n";
914 ws->populateInstrumentParameters();
948 int64_t ndets, int64_t n_vms_compat_spectra,
949 const std::map<specnum_t, std::string> &monitors,
bool excludeMonitors,
950 bool separateMonitors) {
951 size_t nmons = monitors.size();
957 for (
const auto &monitor : monitors) {
958 auto monID = monitor.first;
960 monTemp.setMinSpectrumID(monID);
961 monTemp.setMaxSpectrumID(monID);
973 separateMonitors =
false;
974 return separateMonitors;
985 static_cast<int>(data.
dim0()) ,
986 data.
dim2() , std::move(monitorSpectra));
998 bool removeMonitors = excludeMonitors || separateMonitors;
1005 if (!removeMonitors) {
1006 g_log.
warning() <<
" Performing separate loading as can not load spectra "
1007 "and monitors in the single workspace:\n";
1017 separateMonitors =
true;
1018 removeMonitors =
true;
1028 if (!removeMonitors) {
1035 if (separateMonitors)
1039 if ((totNumOfSpectra !=
static_cast<size_t>(n_vms_compat_spectra)) ||
1040 (spectraID_max - spectraID_min + 1 !=
static_cast<int64_t
>(n_vms_compat_spectra))) {
1048 throw std::runtime_error(
"LoadISISNexus: There seems to be an "
1049 "inconsistency in the spectrum numbers.");
1053 return separateMonitors;
1064 auto hasMultipleTimeRegimes(
false);
1068 hasMultipleTimeRegimes = dae.
containsGroup(
"time_channels_3");
1071 return hasMultipleTimeRegimes;
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
#define DECLARE_NEXUS_FILELOADER_ALGORITHM(classname)
DECLARE_NEXUS_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro wh...
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
@ Load
allowed here which will be passed to the algorithm
Defines a class to aid in creating ISIS specific run logs for periods, status etc.
void addPeriodLogs(const int period, API::Run &exptRun)
Adds period related logs.
bool hasProperty(const std::string &name) const
Does the property exist on the object.
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
This class stores information regarding an experimental run as a series of log entries.
A minimal class to hold the mapping between the spectrum number and its related detector ID numbers f...
const std::set< detid_t > & getDetectorIDsForSpectrumNo(const specnum_t spectrumNo) const
Class to hold a set of workspaces.
A property class for workspaces.
DataBlockComposite: The DataBlockComposite handles a collection of DataBlocks.
specnum_t getMinSpectrumID() const override
void truncate(specnum_t specMin, specnum_t specMax)
std::vector< specnum_t > getAllSpectrumNumbers()
Provides a container with all spectrum numbers.
size_t getNumberOfSpectra() const override
std::unique_ptr< DataBlockGenerator > getGenerator() const override
size_t getNumberOfChannels() const override
size_t getNumberOfPeriods() const override
std::vector< DataBlock > getDataBlocks()
specnum_t getMaxSpectrumID() const override
void addDataBlock(const DataBlock &dataBlock)
void removeSpectra(DataBlockComposite &toRemove)
Removes the input data blocks from the current list of data blocks.
DataBlock: The DataBlock class holds information about a contiguous block of spectrum numbers.
static bool runLoadIDFFromNexus(const std::string &nexusfilename, T localWorkspace, const std::string &top_entry_name, Algorithm *alg)
Load instrument for Nexus file.
int64_t m_entrynumber
The number of the input entry.
std::string m_filename
The name and path of the input file.
DataBlockComposite m_monBlockInfo
void buildSpectraInd2SpectraNumMap(bool range_supplied, bool hasSpectraList, const DataBlockComposite &dataBlockComposite)
Build the list of spectra to load and include into spectra-detectors map.
const specnum_t * m_spec_end
Pointer to one-past-the-end of spectrum number array (m_spec)
void createPeriodLogs(int64_t period, DataObjects::Workspace2D_sptr &local_workspace)
Creates period log data in the workspace.
std::map< int64_t, specnum_t > m_wsInd2specNum_map
map of workspace Index to spectra Number (spectraID)
void loadLogs(DataObjects::Workspace2D_sptr &ws)
Load log data from the nexus file.
void exec() override
Overwrites Algorithm method.
bool findSpectraDetRangeInFile(const Nexus::NXEntry &entry, std::vector< specnum_t > &spectrum_index, int64_t ndets, int64_t n_vms_compat_spectra, const std::map< specnum_t, std::string > &monitors, bool excludeMonitors, bool separateMonitors)
Method takes input parameters which describe monitor loading and analyze them against spectra/monitor...
void checkOverlappingSpectraRange()
Check if any of the spectra block ranges overlap.
std::map< specnum_t, std::string > m_monitors
Monitors, map spectrum index to monitor group name.
bool isMultipleTimeRegimeFile(const Nexus::NXEntry &entry) const
Check if is the file is a multiple time regime file.
bool m_have_detector
Is there a detector block.
boost::scoped_ptr< API::ISISRunLogs > m_logCreator
A pointer to the ISISRunLogs creator.
std::shared_ptr< API::Progress > m_progress
Progress reporting object.
void validateMultiPeriodLogs(const Mantid::API::MatrixWorkspace_sptr &)
Check for a set of synthetic logs associated with multi-period log data.
std::string m_instrument_name
The instrument name from Nexus.
std::shared_ptr< HistogramData::HistogramX > m_tof_data
Time channels.
void loadSampleData(DataObjects::Workspace2D_sptr &, const Mantid::Nexus::NXEntry &entry)
Load in details about the sample.
void loadRunDetails(DataObjects::Workspace2D_sptr &local_workspace, Mantid::Nexus::NXEntry &entry)
Load in details about the run.
LoadISISNexus2()
Default constructor.
DataBlockComposite m_detBlockInfo
void loadPeriodData(int64_t period, Mantid::Nexus::NXEntry &entry, DataObjects::Workspace2D_sptr &local_workspace, bool update_spectra2det_mapping=false)
Load a given period into the workspace.
std::vector< specnum_t > m_spec
Spectra numbers.
int confidence(Nexus::NexusDescriptorLazy &descriptor) const override
Returns a confidence value that this algorithm can load a file.
void runLoadInstrument(DataObjects::Workspace2D_sptr &)
Run LoadInstrument as a ChildAlgorithm.
void loadBlock(Nexus::NXInt &data, int64_t blocksize, int64_t period, int64_t start, int64_t &hist, int64_t &spec_num, DataObjects::Workspace2D_sptr &local_workspace)
Perform a call to nxgetslab, via the NexusClasses wrapped methods for a given block-size.
boost::scoped_ptr< Nexus::File > m_nexusFile
DataBlockComposite m_loadBlockInfo
API::SpectrumDetectorMapping m_spec2det_map
spectra Number to detector ID (multi)map
static double dblSqrt(double in)
Personal wrapper for sqrt to allow msvs to compile.
size_t prepareSpectraBlocks(std::map< specnum_t, std::string > &monitors, DataBlockComposite &LoadBlock)
Prepare a vector of SpectraBlock structures to simplify loading.
bool checkOptionalProperties(bool bseparateMonitors, bool bexcludeMonitor)
Check the validity of the optional properties of the algorithm and identify if partial data should be...
std::vector< SpectraBlock > m_spectraBlocks
List of disjoint data blocks to load.
bool m_load_selected_spectra
if true, a spectra list or range of spectra is supplied
void init() override
Overwrites Algorithm method.
static void ProcessLoadMonitorOptions(bool &bincludeMonitors, bool &bseparateMonitors, bool &bexcludeMonitors, const API::Algorithm *pAlgo)
The method to interpret LoadMonitors property options and convert then into boolean values.
Support for a property that holds an array of values.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void debug(const std::string &msg)
Logs at debug level.
void error(const std::string &msg)
Logs at error level.
void warning(const std::string &msg)
Logs at warning level.
void information(const std::string &msg)
Logs at information level.
OptionalBool : Tri-state bool.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
The base class for a Nexus class (group).
std::string getString(const std::string &name) const
Returns a string.
bool containsGroup(const std::string &query) const
Returns whether an individual group (or group) is present.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
std::vector< NXClassInfo > & groups() const
Returns a list of all classes (or groups) in this NXClass.
NXClass openNXGroup(const std::string &name) const
Creates and opens an arbitrary (non-standard) class (group).
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
Templated class implementation of NXDataSet.
void load()
Read all of the datablock in.
container_T< T > & vecBuffer()
Returns a the internal buffer.
dimsize_t dim0() const
Returns the number of elements along the first dimension.
dimsize_t dim2() const
Returns the number of elements along the third dimension.
void open()
Opens the data set. Does not read in any data. Call load(...) to load the data.
Implements NXdata Nexus class.
NXInt openIntData()
Opens data of int type.
Implements NXentry Nexus class.
NXData openNXData(const std::string &name) const
Opens a NXData.
NexusAddress const & address() const
Returns the absolute address to the object.
std::shared_ptr< File > m_fileID
Nexus file id.
Implements NXroot Nexus class.
NXEntry openEntry(const std::string &name)
Opens an entry – a topmost Nexus class.
bool isEntry(std::string const &entryName, std::string const &groupClass) const
Checks if a full-address entry exists for a particular groupClass in a Nexus dataset.
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void loadSampleGeometry(API::Sample &sample, const Nexus::NXEntry &entry, const bool hasVMSBlock)
Load geometrical data about the sample from the nexus entry into a workspace.
int64_t findNumberOfSpectra(const Nexus::NXEntry &entry, const bool hasVMSBlock)
find the number of spectra in the nexus file
std::shared_ptr< HistogramData::HistogramX > loadTimeData(const Nexus::NXEntry &entry)
Load the time data from nexus entry.
std::tuple< Nexus::NXInt, Nexus::NXInt > findDetectorIDsAndSpectrumNumber(const Nexus::NXEntry &entry, const bool hasVMSBlock)
find detector ids and spectrum numbers
void loadRunDetails(API::Run &runDetails, const Nexus::NXEntry &entry, const bool hasVMSBlock)
Load data about the run.
void DLLExport populateDataBlockCompositeWithContainer(DataBlockComposite &dataBlockComposite, T &indexContainer, int64_t nArray, size_t numberOfPeriods, size_t numberOfChannels, std::vector< specnum_t > monitorSpectra)
Populates a DataBlockComposite with DataBlocks which are extracted from a indexable collection (array...
MANTID_DATAHANDLING_DLL void correctLoadedWorkspaces(const API::Algorithm &loader, Kernel::Logger &log)
Applies correctSpectraMapping to whichever workspaces a loader declared: its output,...
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
int32_t specnum_t
Typedef for a spectrum Number.
Generate a tableworkspace to store the calibration results.
std::string to_string(const wide_integer< Bits, Signed > &n)
Spectra block descriptor.
@ Output
An output workspace.