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

LoadMD v1

../_images/LoadMD-v1_dlg.png

LoadMD dialog.

Summary

Load a MDEventWorkspace in .nxs format.

See Also

SaveMD

Properties

Name

Direction

Type

Default

Description

Filename

Input

string

Mandatory

The name of the Nexus file to load, as a full or relative path. Allowed extensions: [‘.nxs’]

MetadataOnly

Input

boolean

False

Load Box structure and other metadata without events. The loaded workspace will be empty and not file-backed.

BoxStructureOnly

Input

boolean

False

Load partial information about the boxes and events. Redundant property currently equivalent to MetadataOnly

FileBackEnd

Input

boolean

False

Set to true to load the data only on demand.

Memory

Input

number

-1

For FileBackEnd only: the amount of memory (in MB) to allocate to the in-memory cache. If not specified, a default of 40% of free physical memory is used.

LoadHistory

Input

boolean

True

If true, the workspace history will be loaded

OutputWorkspace

Output

IMDWorkspace

Mandatory

Name of the output MDEventWorkspace.

Description

This algorithm loads a MDEventWorkspace that was previously saved using the SaveMD v2 algorithm to a .nxs file format.

If the workspace is too large to fit into memory, You can load the workspace as a file-backed MDWorkspace by checking the FileBackEnd option. This will load the box structure (allowing for some visualization with no speed penalty) but leave the events on disk until requested. Processing file-backed MDWorkspaces is significantly slower than in-memory workspaces due to frequent file access!

For file-backed workspaces, the Memory option allows you to specify a cache size, in MB, to keep events in memory before caching to disk.

Finally, the BoxStructureOnly and MetadataOnly options are for special situations and used by other algorithms, they should not be needed in daily use.

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 MD workspace.

# Load sample MDEvent workspace, present in Mantid unit tests
mdws = LoadMD('MAPS_MDEW.nxs');

# Check results
print("Workspace type is: {}".format(mdws.id()))
print("Workspace has:{0:2} dimensions and contains: {1:4} MD events".format(mdws.getNumDims(),mdws.getNEvents()))

Output:

Workspace type is: MDEventWorkspace<MDLeanEvent,4>
Workspace has: 4 dimensions and contains:    0 MD events

Categories: AlgorithmIndex | MDAlgorithms\DataHandling

Source

C++ header: LoadMD.h

C++ source: LoadMD.cpp