import numpy as np
import dascore as dc
= dc.get_example_patch()
pa
# Add 1 to all distance coords
= pa.coords.get_array('distance') + 1
new_dist = pa.update_coords(distance=new_dist)
pa2 assert np.allclose(pa2.coords.get_array('distance'), new_dist)
update_coords
update_coords(
self: Patch ,
**kwargs ,
)-> ‘PatchType’
Update the coordiantes of a patch.
Will either add new coordinates, or update existing ones.
Parameters
Parameter | Description |
---|---|
kwargs |
The name of the coordinate (key) and coordinate values. Values can either be a sequence (eg array) or a single int. If an int is used it will create a non-coord. |