diff --git a/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h b/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h index 68c8250521e5bb0c2d476a682a009ac44c851898..f48837d236cb6925ef562a70ff597d62b28fc7db 100644 --- a/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h +++ b/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h @@ -52,7 +52,7 @@ private: /// Replacement version, -1 indicates latest int m_replacementVersion; /// The date that the algorithm was first deprecated. - std::string m_deprecatdDate; + std::string m_deprecatedDate; }; } // namespace API diff --git a/Framework/API/src/DeprecatedAlgorithm.cpp b/Framework/API/src/DeprecatedAlgorithm.cpp index 095b870de6dce2c5493b60e1b42277f86d52a730..804e2e0ca5c0caa89d57d3944d32415fcfd7f188 100644 --- a/Framework/API/src/DeprecatedAlgorithm.cpp +++ b/Framework/API/src/DeprecatedAlgorithm.cpp @@ -13,7 +13,7 @@ Kernel::Logger g_log("DeprecatedAlgorithm"); /// Does nothing other than make the compiler happy. DeprecatedAlgorithm::DeprecatedAlgorithm() - : m_replacementAlgorithm(), m_replacementVersion(-1), m_deprecatdDate() {} + : m_replacementAlgorithm(), m_replacementVersion(-1), m_deprecatedDate() {} /// Does nothing other than make the compiler happy. DeprecatedAlgorithm::~DeprecatedAlgorithm() {} @@ -37,7 +37,7 @@ void DeprecatedAlgorithm::useAlgorithm(const std::string &replacement, /// The date the algorithm was deprecated on void DeprecatedAlgorithm::deprecatedDate(const std::string &date) { - this->m_deprecatdDate = ""; + this->m_deprecatedDate = ""; if (date.empty()) { // TODO warn people that it wasn't set return; @@ -46,7 +46,7 @@ void DeprecatedAlgorithm::deprecatedDate(const std::string &date) { // TODO warn people that it wasn't set return; } - this->m_deprecatdDate = date; + this->m_deprecatedDate = date; } /// This merely prints the deprecation error for people to see. @@ -57,8 +57,8 @@ const std::string DeprecatedAlgorithm::deprecationMsg(const IAlgorithm *algo) { msg << "deprecated"; - if (!this->m_deprecatdDate.empty()) - msg << " (on " << this->m_deprecatdDate << ")"; + if (!this->m_deprecatedDate.empty()) + msg << " (on " << this->m_deprecatedDate << ")"; if (this->m_replacementAlgorithm.empty()) { msg << " and has no replacement."; diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadAscii.h b/Framework/DataHandling/inc/MantidDataHandling/LoadAscii.h index 44e695b5bcd1d3a08be0c73641950774822fbbb9..cf495c009be312933a224018d34b0deb1079edab 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadAscii.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadAscii.h @@ -5,6 +5,7 @@ // Includes //---------------------------------------------------------------------- #include "MantidAPI/IFileLoader.h" +#include "MantidAPI/DeprecatedAlgorithm.h" namespace Mantid { namespace DataHandling { @@ -45,7 +46,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid>. Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class DLLExport LoadAscii : public API::IFileLoader<Kernel::FileDescriptor> { +class DLLExport LoadAscii : public API::IFileLoader<Kernel::FileDescriptor>, + public API::DeprecatedAlgorithm { public: /// Default constructor LoadAscii(); diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus.h index c3f14b233810c5a14e3082ea5bc88725df2ef0ed..328be8a18896d921be8e0a25bd1c6ff8f0185c86 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus.h @@ -5,6 +5,7 @@ #include <string> #include <vector> #include "MantidAPI/IFileLoader.h" +#include "MantidAPI/DeprecatedAlgorithm.h" #include "MantidKernel/BinaryFile.h" #include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/Events.h" @@ -88,7 +89,8 @@ struct Pulse { #pragma pack(pop) class DLLExport LoadEventPreNexus - : public API::IFileLoader<Kernel::FileDescriptor> { + : public API::IFileLoader<Kernel::FileDescriptor>, + public API::DeprecatedAlgorithm { public: /// Constructor LoadEventPreNexus(); diff --git a/Framework/DataHandling/src/LoadAscii.cpp b/Framework/DataHandling/src/LoadAscii.cpp index 747bd5422b98555db8ceb6e6bff37a5245f66abe..74dda663af566b72c71ca5209a90493ddff03af7 100644 --- a/Framework/DataHandling/src/LoadAscii.cpp +++ b/Framework/DataHandling/src/LoadAscii.cpp @@ -24,7 +24,9 @@ using namespace Kernel; using namespace API; /// Empty constructor -LoadAscii::LoadAscii() : m_columnSep(), m_separatorIndex() {} +LoadAscii::LoadAscii() : m_columnSep(), m_separatorIndex() { + this->useAlgorithm("LoadAscii", 2); +} /** * Return the confidence with with this algorithm can load the file diff --git a/Framework/DataHandling/src/LoadEventPreNexus.cpp b/Framework/DataHandling/src/LoadEventPreNexus.cpp index 43f73c8f10abe5c91fba36406380bfab82c5570c..e6687146f3fab3f327e3d18c3213dddf8b786999 100644 --- a/Framework/DataHandling/src/LoadEventPreNexus.cpp +++ b/Framework/DataHandling/src/LoadEventPreNexus.cpp @@ -84,7 +84,9 @@ LoadEventPreNexus::LoadEventPreNexus() num_good_events(0), num_error_events(0), num_ignored_events(0), first_event(0), max_events(0), using_mapping_file(false), loadOnlySomeSpectra(false), spectraLoadMap(), longest_tof(0), - shortest_tof(0), parallelProcessing(false) {} + shortest_tof(0), parallelProcessing(false) { + this->useAlgorithm("LoadEventPreNexus", 2); +} LoadEventPreNexus::~LoadEventPreNexus() { delete this->eventfile; } diff --git a/docs/source/algorithms/LoadMuonNexus-v1.rst b/docs/source/algorithms/LoadMuonNexus-v1.rst index acd6e582bb31550062f1022df13e320769f1b1b6..5f8aaf88a3c54b19f06667b7430512ea550aefdc 100644 --- a/docs/source/algorithms/LoadMuonNexus-v1.rst +++ b/docs/source/algorithms/LoadMuonNexus-v1.rst @@ -79,77 +79,6 @@ The ChildAlgorithms used by LoadMuonNexus are: LoadInstrument fails. As the Nexus file has limited instrument data, this only populates a few fields. -Usage ------ - -.. include:: ../usagedata-note.txt - -**Example - Load ISIS muon MUSR dataset:** - -.. testcode:: LoadMuonNexusOnePeriod - - # Load MUSR dataset - ws = LoadMuonNexus(Filename="MUSR00015189.nxs",EntryNumber=1) - print "Workspace has ", ws[0].getNumberHistograms(), " spectra" - -Output: - -.. testoutput:: LoadMuonNexusOnePeriod - - Workspace has 64 spectra - -**Example - Load event nexus file with time filtering:** - -.. testcode:: ExLoadMuonNexusSomeSpectra - - # Load some spectra - ws = LoadMuonNexus(Filename="MUSR00015189.nxs",SpectrumMin=5,SpectrumMax=10,EntryNumber=1) - print "Workspace has ", ws[0].getNumberHistograms(), " spectra" - -Output: - -.. testoutput:: ExLoadMuonNexusSomeSpectra - - Workspace has 6 spectra - -**Example - Load dead times into table:** - -.. testcode:: ExLoadDeadTimeTable - - # Load some spectra - ws = LoadMuonNexus(Filename="emu00006473.nxs",SpectrumMin=5,SpectrumMax=10,DeadTimeTable="deadTimeTable") - tab = mtd['deadTimeTable'] - for i in range(0,tab.rowCount()): - print tab.cell(i,0), tab.cell(i,1) - -Output: - -.. testoutput:: ExLoadDeadTimeTable - - 5 0.00161112251226 - 6 0.00215016817674 - 7 0.0102171599865 - 8 0.00431686220691 - 9 0.00743605662137 - 10 0.00421147653833 - -**Example - Load detector grouping into table:** - -.. testcode:: ExLoadDetectorGrouping - - # Load some spectra - ws = LoadMuonNexus(Filename="emu00006473.nxs",SpectrumList="1,16,17,32",DetectorGroupingTable="detectorTable") - tab = mtd['detectorTable'] - for i in range(0,tab.rowCount()): - print tab.cell(i,0) - -Output: - -.. testoutput:: ExLoadDetectorGrouping - - [ 1 16] - [17 32] - .. categories:: .. sourcelink:: diff --git a/docs/source/algorithms/LoadMuonNexus-v2.rst b/docs/source/algorithms/LoadMuonNexus-v2.rst index 0ca954061e4aad8e1f7858f51b8fbd86d6ad6d88..2e0732e98a485b22bc128fe43e25cb757d49a566 100644 --- a/docs/source/algorithms/LoadMuonNexus-v2.rst +++ b/docs/source/algorithms/LoadMuonNexus-v2.rst @@ -80,6 +80,77 @@ detects that it has been asked to load a previous version muon nexus file it will call the previous version of the algorithm to perform the task. +Usage +----- + +.. include:: ../usagedata-note.txt + +**Example - Load ISIS muon MUSR dataset:** + +.. testcode:: LoadMuonNexusOnePeriod + + # Load MUSR dataset + ws = LoadMuonNexus(Filename="MUSR00015189.nxs",EntryNumber=1) + print "Workspace has ", ws[0].getNumberHistograms(), " spectra" + +Output: + +.. testoutput:: LoadMuonNexusOnePeriod + + Workspace has 64 spectra + +**Example - Load event nexus file with time filtering:** + +.. testcode:: ExLoadMuonNexusSomeSpectra + + # Load some spectra + ws = LoadMuonNexus(Filename="MUSR00015189.nxs",SpectrumMin=5,SpectrumMax=10,EntryNumber=1) + print "Workspace has ", ws[0].getNumberHistograms(), " spectra" + +Output: + +.. testoutput:: ExLoadMuonNexusSomeSpectra + + Workspace has 6 spectra + +**Example - Load dead times into table:** + +.. testcode:: ExLoadDeadTimeTable + + # Load some spectra + ws = LoadMuonNexus(Filename="emu00006473.nxs",SpectrumMin=5,SpectrumMax=10,DeadTimeTable="deadTimeTable") + tab = mtd['deadTimeTable'] + for i in range(0,tab.rowCount()): + print tab.cell(i,0), tab.cell(i,1) + +Output: + +.. testoutput:: ExLoadDeadTimeTable + + 5 0.00161112251226 + 6 0.00215016817674 + 7 0.0102171599865 + 8 0.00431686220691 + 9 0.00743605662137 + 10 0.00421147653833 + +**Example - Load detector grouping into table:** + +.. testcode:: ExLoadDetectorGrouping + + # Load some spectra + ws = LoadMuonNexus(Filename="emu00006473.nxs",SpectrumList="1,16,17,32",DetectorGroupingTable="detectorTable") + tab = mtd['detectorTable'] + for i in range(0,tab.rowCount()): + print tab.cell(i,0) + +Output: + +.. testoutput:: ExLoadDetectorGrouping + + [ 1 16] + [17 32] + .. categories:: .. sourcelink::