\(\renewcommand\AA{\unicode{x212B}}\)

LoadMuonNexus v3

Summary

The LoadMuonNexus algorithm will read the given NeXus Muon data file Version 1 or 2 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.

See Also

LoadNexus, LoadMuonNexusV2

Properties

Name

Direction

Type

Default

Description

Filename

Input

string

Mandatory

The name of the Nexus file to load. Allowed extensions: [‘.nxs’]

OutputWorkspace

Output

Workspace

Mandatory

The name of the workspace to be created as the output of the algorithm. For multiperiod files, one workspace will be generated for each period

SpectrumMin

Input

number

0

Index number of the first spectrum to read

SpectrumMax

Input

number

Optional

Index of last spectrum to read (default the last spectrum)

SpectrumList

Input

int list

Array, or comma separated list, of indexes of spectra to load. If a range and a list of spectra are both supplied, all the specified spectra will be loaded.

AutoGroup

Input

boolean

False

Determines whether the spectra are automatically grouped together based on the groupings in the NeXus file, only for single period data (default no). Version 1 only.

EntryNumber

Input

number

0

0 indicates that every entry is loaded, into a separate workspace within a group. A positive number identifies one entry to be loaded, into one workspace

MainFieldDirection

Output

string

Output the main field direction if specified in Nexus file (run/instrument/detector/orientation, default longitudinal). Version 1 only. Allowed values: [‘Transverse’, ‘Longitudinal’]

TimeZero

Output

number

Time zero in units of micro-seconds (default to 0.0)

FirstGoodData

Output

number

First good data in units of micro-seconds (default to 0.0)

LastGoodData

Output

number

Last good data in the OutputWorkspace’s spectra

TimeZeroList

Output

dbl list

A vector of time zero values

TimeZeroTable

Output

Workspace

TableWorkspace containing time zero values per spectra.

CorrectTime

Input

boolean

True

Boolean flag controlling whether time should be corrected by timezero.

DeadTimeTable

Output

Workspace

Table or a group of tables containing detector dead times. Version 1 only.

DetectorGroupingTable

Output

Workspace

Table or a group of tables with information about the detector grouping stored in the file (if any). Version 1 only.

Description

The algorithm LoadMuonNexus will read a Muon Nexus data file 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.

v3 of this algoirthm acts as an algorithm selector. Given the input filename, the confidence of the following loaders will be assessed and the loader with the highest confidence selected:

This algorithm has the same input properties as LoadMuonNexus v2, some algorithm properties only apply to LoadMuonNexus v1.

Please refer to the documentation for the individual algorithms for implementation detail.

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.

Example - Load ISIS muon MUSR dataset:

# Load MUSR dataset
ws = LoadMuonNexus(Filename="MUSR00015189.nxs",EntryNumber=1)
print("Workspace has  {}  spectra".format(ws[0].getNumberHistograms()))

Output:

Workspace has  64  spectra

Example - Load event nexus file with time filtering:

# Load some spectra
ws = LoadMuonNexus(Filename="MUSR00015189.nxs",SpectrumMin=5,SpectrumMax=10,EntryNumber=1)
print("Workspace has  {}  spectra".format(ws[0].getNumberHistograms()))

Output:

Workspace has  6  spectra

Example - Load dead times into table:

# 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("{} {:.12f}".format(tab.cell(i,0), tab.cell(i,1)))

Output:

5 0.001611122512
6 0.002150168177
7 0.010217159986
8 0.004316862207
9 0.007436056621
10 0.004211476538

Categories: AlgorithmIndex | DataHandling\Nexus | Muon\DataHandling

Source

C++ header: LoadMuonNexus3.h

C++ source: LoadMuonNexus3.cpp