import dascore as dc
= dc.get_example_patch()
patch
# Get the the distance coordinate from the patch.
= patch.get_coord("distance")
distance
# Get the time coordinate from the patch, raise CoordError if it
# is not evenly sampled.
= patch.get_coord("time", require_evenly_sampled=True) time
get_coord
get_coord(
self: Patch ,
name: str ,
require_sorted: bool = False,
require_evenly_sampled: bool = False,
)-> ‘BaseCoord’
Get a managed coordinate from the patch.
Parameters
Parameter | Description |
---|---|
name | The name of the coordinate to fetch from the patch. |
require_sorted | If True, require the coordinate to be sorted or raise Error. |
require_evenly_sampled | If True, require the coordinate to be evenly sampled or raise Error. |
Raises
CoordError
if the coordinate does not exist or does not meet the imposed requirements.