decode.convert module#
- coord_units(da: DataArray, coord_names: Sequence[str] | str, new_units: DataArray | Unit | str, /, equivalencies: Equivalency | None = None) DataArray [source]#
Convert the units of coordinate(s) of a DataArray.
- Parameters:
da (DataArray) – Input DataArray.
coord_names (Sequence[str] | str) – Name(s) of the coordinate(s) to be converted.
new_units (DataArray | Unit | str) – Units to be converted from the current ones. A DataArray that has units attribute is also accepted.
equivalencies (Equivalency | None) – Optional Astropy equivalencies.
- Returns:
DataArray with the units of the coordinate converted.
- Return type:
DataArray
- frame(da: DataArray, new_frame: str, /) DataArray [source]#
Convert the skycoord frame of a DataArray.
- Parameters:
da (DataArray) – Input DataArray.
new_frame (str) – Frame to be converted from the current one.
- Returns:
DataArray with the skycoord frame converted.
- Return type:
DataArray
- to_brightness(dems: DataArray, /, *, T_amb: float = 273.0, T_room: float = 293.0) DataArray [source]#
Convert DEMS on the df/f scale to the brightness temperature scale.
- Parameters:
dems (DataArray) – Input DEMS DataArray on the df/f scale.
T_amb (float) – Default ambient temperature value to be used when all
dems.temperature
values are NaN.T_room (float) – Default room temperature value to be used when all
dems.aste_cabin_temperature
values are NaN.
- Returns:
DEMS DataArray on the brightness temperature scale.
- Return type:
DataArray
- to_dfof(dems: DataArray, /, *, T_amb: float = 273.0, T_room: float = 293.0) DataArray [source]#
Convert DEMS on the brightness temperature scale to the df/f scale.
- Parameters:
dems (DataArray) – Input DEMS DataArray on the brightness temperature scale.
T_amb (float) – Default ambient temperature value to be used when all
dems.temperature
values are NaN.T_room (float) – Default room temperature value to be used when all
dems.aste_cabin_temperature
values are NaN.
- Returns:
DEMS DataArray on the df/f scale.
- Return type:
DataArray
- units(da: DataArray, new_units: DataArray | Unit | str, /, equivalencies: Equivalency | None = None) DataArray [source]#
Convert the units of a DataArray.
- Parameters:
da (DataArray) – Input DataArray.
new_units (DataArray | Unit | str) – Units to be converted from the current ones. A DataArray that has units attribute is also accepted.
equivalencies (Equivalency | None) – Optional Astropy equivalencies.
- Returns:
DataArray with the units converted.
- Return type:
DataArray