LoadNexusLogs v1


LoadNexusLogs dialog.


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


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 some existing logs will be overwritten, if false they will not.
NXentryName Input string   Entry in the nexus file from which to read the logs


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.

Data loaded from Nexus File

Not all of the nexus file is loaded. This section tells you what is loaded and where it goes in the workspace. Items missing from the Nexus file are simply not loaded.

Description of Data Found in Nexus file Placed in Workspace (Workspace2D)
Log group Each group of class IXrunlog or IXselog or with name "DASLogs" or "framelog" (henceforth referred as [LOG]) See below
Periods group Each group of class IXperiods (henceforth referred as [PERIODS]) See below
Time series Each group of class NXlog or NXpositioner within [LOG] Time series in workspace run object Only these are affected by the OverwriteLogs algorithm property.
SE logs Each group of class IXseblock within [LOG] Workspace run object. Item prefixed with selog_, if name is already in use.
Periods Each group of class IXperiods and name "periods" within [PERIODS] nperiods item in run object, if it does not already exist
Start and end times Groups "start_time" and "end time" start and end times in run object Existing values are always overwritten.
Proton charge Group "proton_charge", if it exists, else integration of proton charge time series Proton charge in run object if it does not already exist
Measurement information Group "measurement" of class NXcollection Run object items with name from Nexus group prefixed with measurement_ Existing values are always overwritten.

If the nexus file has a "proton_log" group, then this algorithm will do some event filtering to allow SANS2D files to load.


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.


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
    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
    log = ws.getRun().getLogData(phase_log)
    print phase_log, "log size =", log.size()
except RuntimeError:
    print phase_log, "log does not exist!"


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


C++ source: LoadNexusLogs.cpp

C++ header: LoadNexusLogs.h