ess.reduce.nexus.workflow.load_nexus_component#
- ess.reduce.nexus.workflow.load_nexus_component(location, nx_class)[source]#
Load a NeXus component group from a file.
When loading a detector or monitor, event data is replaced by placeholders.
As the event data can be large and is not needed at this stage, it is replaced by a placeholder. A placeholder is used to allow for returning a scipp.DataArray, which is what most downstream code will expect. Currently the placeholder is the detector number (for detectors) or a size-0 array (for monitors), but this may change in the future.
The returned object is a scipp.DataGroup, as it may contain additional information about the detector that cannot be represented as a single scipp.DataArray. Most downstream code will only be interested in the contained scipp.DataArray so this needs to be extracted. However, other processing steps may require the additional information, so it is kept in the DataGroup.
- Parameters:
location (
NeXusComponentLocationSpec
[TypeVar
(Component
,NXdetector
,NXsample
,NXsource
,NXdisk_chopper
,NXcrystal
,nexus.types.Monitor1
(int
),nexus.types.Monitor2
(int
),nexus.types.Monitor3
(int
),nexus.types.Monitor4
(int
),nexus.types.Monitor5
(int
),nexus.types.IncidentMonitor
(int
),nexus.types.TransmissionMonitor
(int
)),TypeVar
(RunType
,nexus.types.BackgroundRun
(int
),nexus.types.EmptyBeamRun
(int
),nexus.types.SampleRun
(int
),TransmissionRun
[nexus.types.SampleRun
(int
)],TransmissionRun
[nexus.types.BackgroundRun
(int
)],nexus.types.VanadiumRun
(int
))]) – Location spec for the source group.nx_class (
NeXusClass
[TypeVar
(Component
,NXdetector
,NXsample
,NXsource
,NXdisk_chopper
,NXcrystal
,nexus.types.Monitor1
(int
),nexus.types.Monitor2
(int
),nexus.types.Monitor3
(int
),nexus.types.Monitor4
(int
),nexus.types.Monitor5
(int
),nexus.types.IncidentMonitor
(int
),nexus.types.TransmissionMonitor
(int
))]) – NX_class to identify the component.
- Return type:
NeXusComponent
[TypeVar
(Component
,NXdetector
,NXsample
,NXsource
,NXdisk_chopper
,NXcrystal
,nexus.types.Monitor1
(int
),nexus.types.Monitor2
(int
),nexus.types.Monitor3
(int
),nexus.types.Monitor4
(int
),nexus.types.Monitor5
(int
),nexus.types.IncidentMonitor
(int
),nexus.types.TransmissionMonitor
(int
)),TypeVar
(RunType
,nexus.types.BackgroundRun
(int
),nexus.types.EmptyBeamRun
(int
),nexus.types.SampleRun
(int
),TransmissionRun
[nexus.types.SampleRun
(int
)],TransmissionRun
[nexus.types.BackgroundRun
(int
)],nexus.types.VanadiumRun
(int
))]