update_coords

function of dascore.proc.coords source

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 mapping from old names to new names

Examples

import numpy as np
import dascore as dc
pa = dc.get_example_patch()
# Add 1 to all distance coords
new_dist = pa.coords.get_array('distance') + 1
pa2 = pa.update_coords(distance=new_dist)
assert np.allclose(pa2.coords.get_array('distance'), new_dist)