Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Filename | Input | string | Mandatory | The name (including its full or relative path) of the NeXus file to attempt to load. The file extension must either be .nxs or .NXS. Allowed extensions: [‘.nxs’] |
OutputWorkspace | Output | Workspace | Mandatory | The name of the output workspace in which to load the NeXus monitors. |
MonitorsAsEvents | Input | boolean | True | If enabled (by default), load the monitors as events (into an EventWorkspace), as long as there is event data. If disabled, load monitors as spectra (into a Workspace2D, regardless of whether event data is found. |
This algorithm loads all monitors found in a NeXus file into a single Workspace2D (if there is no event data or if MonitorsAsEvents is false) or into an EventWorkspace (if event monitor data is found). The algorithm assumes that all of the monitors are histograms and have the same bin boundaries. NOTE: The entry is assumed to be in SNS or ISIS format, so the loader is currently not generically applicable.
This version (v2) fixes a bug in the first version and now returns a group workspace when invoked from Python with a multiperiod input workspace. As a side-effect of the fix, the contained individual workspaces for each of the periods are named slightly differently.
Note
To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.
ws = LoadNexusMonitors("CNCS_7860_event.nxs")
# CNCS has 3 monitors
print "Number of monitors =", ws.getNumberHistograms()
Output:
Number of monitors = 3
Categories: Algorithms | DataHandling\Nexus