ess.spectroscopy.indirect.conversion.add_spectrometer_coords#

ess.spectroscopy.indirect.conversion.add_spectrometer_coords(data, primary_graph, secondary_graph)[source]#

Compute and add coordinates for the spectrometer.

Parameters:
  • data (CalibratedBeamline[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))]) – Data array with beamline coordinates “position”, “source_position”, and “sample_position”. Does not need to contain events or flight times.

  • primary_graph (PrimarySpecCoordTransformGraph[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))]) – Coordinate transformation graph for the primary spectrometer.

  • secondary_graph (SecondarySpecCoordTransformGraph[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))]) – Coordinate transformation graph for the secondary spectrometer. Must be a closure over analyzer parameters. And those parameters must have a compatible shape with data.

Returns:

BeamlineWithSpectrometerCoords[TypeVar(RunType, ess.reduce.nexus.types.SampleRun (int), ess.reduce.nexus.types.VanadiumRun (int))] – Input data with added spectrometer coordinates. This includes “final_energy”, “secondary_flight_time”, and “L1”.