import dascore as dc
patch = dc.get_example_patch()
# roll time dimension 5 elements
rolled_patch = patch.roll(time=5, samples=True)
# roll distance dimension 30 meters(or units of distance in patch)
rolled_patch2 = patch.roll(distance=30, samples=False)
# roll time dimension 5 elements and update coordinates
rolled_patch3 = patch.roll(time=5, samples=True, update_coord=True)roll
roll(
self ,
samples: bool = False,
update_coord: bool = False,
**kwargs ,
)-> ‘Self’
Roll patch array elements along a given dimension.
Parameters
| Parameter | Description |
|---|---|
| patch | input patch |
| samples | If True, the roll is a number of samples; else in coordinate units. |
| update_coord |
If True, roll the dimension’s labels, and the coordinates riding it, with the data. |
| **kwargs | specifies dimension and number of elements to roll |