CoordRange

class of dascore.core.coords
inherits from: BaseCoord, DascoreBaseModel, pydantic.main.BaseModel, abc.ABC
source

CoordRange(
    units: pint.registry.Quantity | str | None[Quantity, str, None] = None,
    step: Any = None,
    shape: tuple[tuple[int, …], None] = None,
    dtype: Any = None,
    start: Any = None,
    stop: Any = None,
)-> None

A coordinate represent a range of evenly sampled data.

Parameters

Parameter Description
start The starting value
stop The ending value
step The step between start and stop.
Note

Like range and slice, CoordRange is exclusive of stop value.

Methods

Name Description
align_to Align the coordinate to another coordinate.
approx_equal Return True if the coordinates are approximately equal.
change_length Adjust the length of the coordinate by changing the end value.
convert_units Convert units, or set units if none exist.
coord_range Return a scaler value for the coordinate (e.g., number of seconds).
empty Empty out the coordinate.
get_attrs_dict Get attrs dict.
get_next_index Get the index a value would have in a coordinate.
get_sample_count Return the number of samples represented by a value.
get_slice_tuple Get a tuple with (start, stop) and perform basic checks.
index Index the coordinate and return new coordinate.
max Return max value.
min Return min value.
check_time_units Ensure time units are s if dattype is time-like.
get_correct_dtype_cast_values Ensure the correct dtype is provided and value conform to it.
new Update coordinate.
order Order coordinate according to array values or samples.
select Apply select, return selected coords and index to apply to array.
set_units Set new units on coordinates.
simplify_units Simplify the coordinate units.
snap Snap the coordinates to evenly sampled grid points.
sort Sort the contents of the coord. Return new coord and slice for sorting.
to_summary Get the summary info about the coord.
update Update parts of the coordinate.
update_data Update the data of the coordinate.
update_limits Update the limits or sampling of the coordinates.