roll

function of dascore.proc.basic source

roll(
    patch ,
    samples = False,
    update_coord = False,
    **kwargs ,
)

Roll patch array elements along a given dimension.

Parameters

Parameter Description
patch input patch
samples if True, value indicates coordinate or value of dimension
update_coord if True, updates coord based on rolled amount
**kwargs specifies dimension and number of elements to roll

Examples

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)