ess.bifrost.io.nexus.analyzer_for_detector#

ess.bifrost.io.nexus.analyzer_for_detector(analyzers, detector_location)[source]#

Extract the analyzer for a given detector.

Note

Depends heavily on the names of components being preceded by an instrument index, and the analyzer and detector components being separated in index by 2. If either condition changes, this function will need to be modified.

Parameters:
  • analyzers (Analyzers[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))]) – Data group of loaded analyzers.

  • detector_location (NeXusComponentLocationSpec[NXdetector, TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))]) – The location of an NXdetector in the NeXus file. The analyzer is identified based on this location.

Returns:

Analyzer[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))] – The analyzer for the given detector triplet. Only a subset of fields is returned.