import numpy as np
import dascore as dc
= dc.get_example_patch()
patch # add new coordinate, random numbers length of time dim
= np.random.random(patch.coord_shapes["time"])
my_coord = (
out =("time", my_coord)) # add my_coord
patch.update_coords(my_coord="my_coord") # set mycoord as dim (rather than time)
.set_dims(time
)assert "my_coord" in out.dims
set_dims
set_dims(
self: Patch ,
**kwargs: str ,
)-> ‘PatchType’
Set dimension to non-dimensional coordinate.
Parameters
Parameter | Description |
---|---|
**kwargs |
A mapping indicating old_dim: new_dim where new_dim refers to the name of a non-dimensional coordinate which will become a dimensional coordinate. The old dimensional coordinate will become a non-dimensional coordinate. |