LoadMuonNexus
From MantidProject
Contents |
Summary
The LoadMuonNexus algorithm will read the given Nexus Muon data file Version 1 and use the results to populate the named workspace. LoadMuonNexus may be invoked by LoadNexus if it is given a Nexus file of this type.
Properties
| Order | Name | Direction | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | Filename | Input | File name | Mandatory | The name of the Nexus file to read, as a full or relative path. |
| 2 | OutputWorkspace | Output | Workspace | Mandatory | The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service. For multiperiod files, one workspace will be generated for each period. |
| 3 | SpectrumMin | Input | Integer | Optional | Number of first spectrum to read, only for single period data. |
| 4 | SpectrumMax | Input | Integer | Optional | Number of last spectrum to read, only for single period data. |
| 5 | SpectrumList | Input | Integer list | Optional | List of spectrum numbers to read, only for single period data. |
| 6 | AutoGroup | Input | Bool | False | Determines whether the spectra are automatically grouped together based on the groupings in the NeXus file. |
| 7 | EntryNumber | Input | Integer | Optional | The particular entry number to read. If not given will load all workspaces and create a workspace group. |
Description
The algorithm LoadMuonNexus will read a Muon Nexus data file (original format) and place the data into the named workspace. The file name can be an absolute or relative path and should have the extension .nxs or .NXS. If the file contains data for more than one period, a separate workspace will be generated for each. After the first period the workspace names will have "_2", "_3", and so on, appended to the given workspace name. For single period data, the optional parameters can be used to control which spectra are loaded into the workspace. If spectrum_min and spectrum_max are given, then only that range to data will be loaded. If a spectrum_list is given than those values will be loaded.
- TODO get XML descriptions of Muon instruments. This data is not in existing Muon Nexus files.
- TODO load the spectra detector mapping. This may be very simple for Muon instruments.
Time series data
The log data in the Nexus file (NX_LOG sections) will be loaded as TimeSeriesProperty data within the workspace. Time is stored as seconds from the Unix epoch.
Errors
The error for each histogram count is set as the square root of the number of counts.
Time bin data
The corrected_times field of the Nexus file is used to provide time bin data and the bin edge values are calculated from these bin centre times.
Multiperiod data
To determine if a file contains data from more than one period the field switching_states is read from the Nexus file. If this value is greater than one it is taken to be the number of periods, Np of the data. In this case the Ns spectra in the histogram_data field are split with Ns / Np assigned to each period.
Subalgorithms used
The subalgorithms used by LoadMuonNexus are:
- LoadMuonLog - this reads log information from the Nexus file and uses it to create TimeSeriesProperty entries in the workspace.
- LoadInstrument - this algorithm looks for an XML description of the instrument and if found reads it.
- LoadIntstrumentFromNexus - this is called if the normal LoadInstrument fails. As the Nexus file has limited instrument data, this only populates a few fields.
Source Code
Header LoadMuonNexus.h
Source LoadMuonNexus.cpp
