Skip to content
Snippets Groups Projects
Commit 438c3f64 authored by Nick Draper's avatar Nick Draper
Browse files

Deprecate LoadAscii v1 and LoadEventPreNexus v1

Also move examples from LoadMuonNexusV1 to V2

re #11707
parent ca2ca769
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Includes // Includes
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#include "MantidAPI/IFileLoader.h" #include "MantidAPI/IFileLoader.h"
#include "MantidAPI/DeprecatedAlgorithm.h"
namespace Mantid { namespace Mantid {
namespace DataHandling { namespace DataHandling {
...@@ -45,7 +46,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -45,7 +46,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>. File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org> 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: public:
/// Default constructor /// Default constructor
LoadAscii(); LoadAscii();
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "MantidAPI/IFileLoader.h" #include "MantidAPI/IFileLoader.h"
#include "MantidAPI/DeprecatedAlgorithm.h"
#include "MantidKernel/BinaryFile.h" #include "MantidKernel/BinaryFile.h"
#include "MantidDataObjects/EventWorkspace.h" #include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/Events.h" #include "MantidDataObjects/Events.h"
...@@ -88,7 +89,8 @@ struct Pulse { ...@@ -88,7 +89,8 @@ struct Pulse {
#pragma pack(pop) #pragma pack(pop)
class DLLExport LoadEventPreNexus class DLLExport LoadEventPreNexus
: public API::IFileLoader<Kernel::FileDescriptor> { : public API::IFileLoader<Kernel::FileDescriptor>,
public API::DeprecatedAlgorithm {
public: public:
/// Constructor /// Constructor
LoadEventPreNexus(); LoadEventPreNexus();
......
...@@ -24,7 +24,10 @@ using namespace Kernel; ...@@ -24,7 +24,10 @@ using namespace Kernel;
using namespace API; using namespace API;
/// Empty constructor /// 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 * Return the confidence with with this algorithm can load the file
......
...@@ -84,7 +84,10 @@ LoadEventPreNexus::LoadEventPreNexus() ...@@ -84,7 +84,10 @@ LoadEventPreNexus::LoadEventPreNexus()
num_good_events(0), num_error_events(0), num_ignored_events(0), num_good_events(0), num_error_events(0), num_ignored_events(0),
first_event(0), max_events(0), using_mapping_file(false), first_event(0), max_events(0), using_mapping_file(false),
loadOnlySomeSpectra(false), spectraLoadMap(), longest_tof(0), 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; } LoadEventPreNexus::~LoadEventPreNexus() { delete this->eventfile; }
......
...@@ -79,77 +79,6 @@ The ChildAlgorithms used by LoadMuonNexus are: ...@@ -79,77 +79,6 @@ The ChildAlgorithms used by LoadMuonNexus are:
LoadInstrument fails. As the Nexus file has limited instrument data, LoadInstrument fails. As the Nexus file has limited instrument data,
this only populates a few fields. 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:: .. categories::
.. sourcelink:: .. sourcelink::
...@@ -80,6 +80,77 @@ detects that it has been asked to load a previous version muon nexus ...@@ -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 file it will call the previous version of the algorithm to perform the
task. 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:: .. categories::
.. sourcelink:: .. sourcelink::
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment