import dascore as dc
= dc.get_example_patch()
patch
# Get the patch data array.
= patch.get_array() # same as patch.data
data
# Get an array of distance values
= patch.get_array("distance")
distance_array
# Get an array of time values. Raise an error if they arent sorted.
= patch.get_array("time", require_sorted=True) time_array
get_array
get_array(
self: Patch ,
name: str | None[str, None] = None,
require_sorted: bool = False,
require_evenly_sampled: bool = False,
)-> ‘BaseCoord’
Get an array associated with patch data or a coordinate.
Parameters
Parameter | Description |
---|---|
name | The name of the coordinate to fetch. If None return patch data. |
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.