scippneutron.convert#

scippneutron.convert(data, origin, target, scatter)#

Perform a unit conversion from the given origin unit to target. See the documentation page on “Coordinate Transformations” (https://scipp.github.io/scippneutron/user-guide/coordinate-transformations.html) for more details.

Parameters:
  • data (Union[DataArray, Dataset]) – Input data.

  • origin (str) – Name of the input coordinate.

  • target (str) – Name of the output coordinate.

  • scatter (bool) – Choose whether to use scattering or non-scattering conversions.

Returns:

Union[DataArray, Dataset] – A new scipp.DataArray or scipp.Dataset with the new coordinate.

Seealso:

scippneutron.deduce_conversion_graph() and scippneutron.conversion_graph() to inspect the possible conversions.