import dascore as dc
import numpy as np
= dc.get_example_patch()
patch
# Flip patch over time axis
= patch.flip("time")
out assert np.all(patch.get_array("time") == out.get_array("time")[::-1])
# Flip patch over all dimensions.
= patch.flip(*patch.dims) out
flip
flip(
patch ,
*dims ,
flip_coords = True,
)
Flip patch data and (optionally coords) along specified dimensions.
Parameters
Parameter | Description |
---|---|
patch | The patch to flip. |
*dims | The dimensions over which to flip (mirror). |
flip_coords |
If True, also flip coords associated with dimensions, otherwise leave them unchanged. |