scippneutron.load_with_mantid#
- scippneutron.load_with_mantid(filename='', load_pulse_times=True, instrument_filename=None, error_connection=None, mantid_alg='Load', mantid_args=None, advanced_geometry=False)[source]#
Load a file using Mantid.
Wraps Mantid’s loaders and converts the result to a scipp data group.
See also the neutron-data tutorial.
Note that this function requires mantid to be installed and available in the same Python environment as scipp.
- Parameters:
filename (
str
|Path
, default:''
) – The name of the Nexus/HDF file to be loaded.load_pulse_times (default:
True
) – Read the pulse times if True.instrument_filename (default:
None
) – If specified, over-write the instrument definition in the final dataset with the geometry contained in the file.error_connection (default:
None
) – Dict with data column names as keys to names of their error column. Only used when the loaded workspace is a TableWorkspace. See scippneutron.mantid.convert_TableWorkspace_to_datasetmantid_alg (default:
'Load'
) – Mantid algorithm to use for loading. Default is Load.mantid_args (default:
None
) – Dict of keyword arguments to forward to Mantid.advanced_geometry (default:
False
) – If True, load the full detector geometry including shapes and rotations. The positions of grouped detectors are spherically averaged. If False, load only the detector position, and return the cartesian average of the grouped detector positions.
- Returns:
DataGroup
– A Data group containing the neutron event/histogram data and the instrument geometry.- Raises:
RuntimeError – If the Mantid workspace type returned by the Mantid loader is not either EventWorkspace or Workspace2D.
Examples
>>> from scippneutron import load_with_mantid >>> load_with_mantid(filename='PG3_4844_event.nxs', ... load_pulse_times=False, ... mantid_args={ ... 'BankName': 'bank184', ... 'LoadMonitors': True})