Skip to content

Commit

Permalink
Refs #4223 wiki page for LoadTOFRawNexus
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Jan 5, 2012
1 parent 7dcdfa8 commit 0ad0b84
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ namespace DataHandling
{
/**
Loads a NeXus file that conforms to the TOFRaw instrument definition format and stores it in a 2D workspace.
LoadTOFRawNeXus is an algorithm and as such inherits from the Algorithm class, via DataHandlingCommand, and overrides
the init() & exec() methods.
Required Properties:
<UL>
<LI> Filename - The name of and path to the input NeXus file </LI>
<LI> OutputWorkspace - The name of the workspace in which to store the imported data
(a multiperiod file will store higher periods in workspaces called OutputWorkspace_PeriodNo)</LI>
</UL>
Optional Properties:
<UL>
<LI> SpectrumMin - The starting spectrum number</LI>
<LI> SpectrumMax - The final spectrum number (inclusive)</LI>
<LI> SpectrumList - An ArrayProperty of spectra to load</LI>
</UL>
@author Stuart Campbell, ORNL
Copyright &copy; 2007-8 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Expand Down Expand Up @@ -88,10 +70,8 @@ class DLLExport LoadTOFRawNexus : public API::IDataFileChecker
int fileCheck(const std::string& filePath);

protected:
/// Overwrites Algorithm method.
void init();

/// Overwrites Algorithm method
void initDocs();
void exec();

/// Validate the optional input properties
Expand Down
26 changes: 24 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
/*WIKI*
This algorithm loads a NeXus file that conforms to the TOFRaw format and stores
it in a 2D workspace. The TOFRaw format is used at SNS and consists of a histogram
representation with common bin boundaries.
Some NXS files have multiple data fields giving binning in other units
(e.g. d-spacing or momentum). You can choose which binning to use by entering
the '''Signal''' parameter. The default value is 1, which normally will
correspond to TOF. The "Y" units will still be in ''counts''.
The typical meanings of Signal are as follows (note that these may change!):
* Signal 1: Time of flight. The data field containing the bin boundaries is ''time_of_flight''
* Signal 5: q. The data field containing the bin boundaries is ''momentum_transfer''
* Signal 6: d-spacing. The data field containing the bin boundaries is ''dspacing''
*WIKI*/
// Includes

#include "MantidAPI/FileProperty.h"
#include "MantidAPI/LoadAlgorithmFactory.h"
Expand Down Expand Up @@ -32,6 +45,14 @@ LoadTOFRawNexus::LoadTOFRawNexus()
{
}

//-------------------------------------------------------------------------------------------------
/** Documentation strings */
void LoadTOFRawNexus::initDocs()
{
this->setWikiSummary("Loads a NeXus file confirming to the TOFRaw format");
this->setOptionalMessage("Loads a NeXus file confirming to the TOFRaw format");
}

//-------------------------------------------------------------------------------------------------
/// Initialisation method.
void LoadTOFRawNexus::init()
Expand All @@ -41,7 +62,8 @@ void LoadTOFRawNexus::init()
exts.push_back(".nxs");
declareProperty(new FileProperty("Filename", "", FileProperty::Load, exts),
"The name of the NeXus file to load");
declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", Direction::Output));
declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", Direction::Output),
"The name of the Workspace2D to create.");
declareProperty("Signal", 1,
"Number of the signal to load from the file. Default is 1 = time_of_flight.\n"
"Some NXS files have multiple data fields giving binning in other units (e.g. d-spacing or momentum).\n"
Expand Down

0 comments on commit 0ad0b84

Please sign in to comment.