ess.diffraction.powder.to_dspacing_with_calibration

ess.diffraction.powder.to_dspacing_with_calibration

ess.diffraction.powder.to_dspacing_with_calibration(data, *, calibration=None)

Transform coordinates to d-spacing from calibration parameters.

Computes d-spacing from time-of-flight stored in data.

Attention

data may have a wavelength coordinate and dimension, but those are discarded. Only the stored time-of-flight is used, that is, any modifications to the wavelength coordinate after it was computed from time-of-flight are lost.

Raises

KeyError – If data does not contain a ‘tof’ metadata.

Parameters
  • data (DataArray) – Input data in tof or wavelength dimension. Must have a tof coordinate or attribute.

  • calibration (Optional[Dataset], default: None) – Calibration data. If given, use it for the conversion. Otherwise, the calibration data must be stored in data.

Returns

DataArray – A DataArray with the same data as the input and a ‘dspacing’ coordinate.

Return type

scipp._scipp.core.DataArray

See also

ess.diffraction.conversions.dspacing_from_diff_calibration