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.

Raises

CoordError if the coordinate does not exist or does not meet the imposed requirements.

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.