import dascore as dc
patch = dc.get_example_patch()
# Set complex units
complex_units = patch.set_units("km/h", distance="km", time="h")
# Simplify to base units (m/s, m, s)
simplified = complex_units.simplify_units()SimplifyUnits
SimplifyUnits(
*args ,
)-> None
Simplify the units contained by the patch to base metric units.
All data and coordinate units will be converted to their base units and corresponding data/labels multiplied by a conversion factor.
Examples
Methods
| Name | Description |
|---|---|
| check | Refuse a patch which does not carry what the operation needs. |
| get_metadata | Return base-unit metadata and the factor which scales the data. |
| kernel | Return the data scaled; the data themselves for a factor of one. |
| model_copy | Copy the model, dropping cached values the update invalidates. |
| new | Create new instance with some attributed updated. |
| simplify_units | Simplify the units contained by the patch to base metric units. |
| reconcile | Return metadata or a patch holding the final data; default as is. |
| run | Run the operation: check, get_metadata, kernel, reconcile, record. |