import dascore as dc
= dc.get_example_patch()
patch # set the data units
= patch.set_units("km/ms")
patch_with_units # set the units of the distance coordinate
= patch.set_units(distance='feet') patch_feet
set_units
set_units(
patch: Patch ,
data_units: None | Unit | Quantity | str = None,
**kwargs ,
)-> ‘PatchType’
Set the units of a patch’s data or coordinates.
Parameters
Parameter | Description |
---|---|
patch | The input patch. |
data_units | New units for the patch data. Accepts both unit and quantity strings. |
**kwargs | Used to specify new units for any of the patch’s coordinates. |
Warning
Old units will be deleted without performing conversions. To convert units see convert_units.