coord_as_unit#

muse.utils.coord_as_unit(ds, name, target_unit, label)#

Return coordinate name converted to target_unit.

Parameters:
  • ds (Dataset) – Dataset to inspect.

  • name (str) – Coordinate name.

  • target_unit (str) – Unit to convert the coordinate values to. Must be a valid astropy unit string.

  • label (str) – Human-readable name used in error messages.

Returns:

Coordinate values in target_unit with updated units attrs.

Return type:

DataArray