gordias.util.units.change_units#

gordias.util.units.change_units(cube_or_coord: Cube | Coord, new_unit: Unit, new_standard_name: str | None = None, integration_time: Unit = Unit('1 day')) None#

Convert Cube or Coord units.

Parameters:
  • cube_or_coord (iris.cube.Cube | iris.coords.Coord) – Any Cube or Coord to change unit for.

  • new_unit (cf_units.Unit) – Unit to convert to.

  • new_standard_name (str | None, optional) – Standard name to convert to, by default None.

  • integration_time (cf_units.Unit, optional) – Integration time for the Cube or Coord unit, if not included in the input unit. Default is cf_units.Unit(“1 day”)

Raises:

ValueError – If integration_time is not a time unit.