get_coord

function of dascore.proc.coords source

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:
it must have a step and be neither jittered nor gapped (see
NumericCoord).

Raises

CoordError if the coordinate does not exist or does not meet the imposed requirements. An unevenly sampled coordinate’s error says why and names fill_gaps and snap_coords.

Examples

import dascore as dc
patch = dc.get_example_patch()

# Get the the distance coordinate from the patch.
distance = patch.get_coord("distance")

# Get the time coordinate from the patch, raise CoordError if it
# is not evenly sampled.
time = patch.get_coord("time", require_evenly_sampled=True)

See Also

get_array.