LoadNexusLogs v1

../_images/LoadNexusLogs-v1_dlg.png

LoadNexusLogs dialog.

Summary

Loads run logs (temperature, pulse charges, etc.) from a NeXus file and adds it to the run information in a workspace.

Properties

Name Direction Type Default Description
Workspace InOut MatrixWorkspace Mandatory The name of the workspace that will be filled with the logs.
Filename Input string Mandatory Path to the .nxs file to load. Can be an EventNeXus or a histogrammed NeXus. Allowed extensions: [‘.nxs’, ‘.n*’]
OverwriteLogs Input boolean True If true then existing logs will be overwritten, if false they will not.

Description

The LoadNexusLogs algorithm loads the sample logs from the given NeXus file. The logs are visible from MantidPlot if you right-click on a workspace and select “Sample Logs...”.

If you use LoadEventNexus or LoadISISNexus, calling this algorithm is not necessary, since it called as a child algorithm.

Usage

As described above, normal usage of this algorithm is not necessary. however, at SNS there are preNeXus files available. The following uses this mechanism and then adds the logs.

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 = LoadEventPreNexus("CNCS_7860_neutron_event.dat")
# Five logs are already present
print "Number of original logs =", len(ws.getRun().keys())
phase_log = "Phase1"
# Try to get a log that doesn't exist yet
try:
    log = ws.getRun().getLogData(phase_log)
except RuntimeError:
    print phase_log, "log does not exist!"
LoadNexusLogs(ws, "CNCS_7860_event.nxs")
print "Number of final logs =", len(ws.getRun().keys())
# Try getting the log again
try:
    log = ws.getRun().getLogData(phase_log)
    print phase_log, "log size =", log.size()
except RuntimeError:
    print phase_log, "log does not exist!"

Output:

Number of original logs = 5
Phase1 log does not exist!
Number of final logs = 44
Phase1 log size = 46

Categories: Algorithms | DataHandling | Logs | DataHandling | Nexus

Source

C++ source: LoadNexusLogs.cpp

C++ header: LoadNexusLogs.h