concat_coords

function of dascore.core.coords source

concat_coords(
    *coords ,
    units = None,
)-> ‘BaseCoord’

Concatenate monotonic coordinates into a single coordinate.

This operation is truth-preserving: no value is ever altered, and every boundary between inputs that does not continue exactly is kept as a run boundary. Use fuse on the result for tolerance-bounded gap absorption.

Parameters

Parameter Description
*coords Coordinates to concatenate. Each must be numeric and monotonic.
Inputs are ordered by their envelopes, or, where every input holds
one sample, by the order they are given in; they must share dtype
kind, units, and sort direction, and must not overlap.
units If provided, set (not convert) these units on the output.

Examples

from dascore.core.coords import concat_coords, get_coord

c1 = get_coord(start=0.0, stop=10.0, step=1.0)
c2 = get_coord(start=15.0, stop=25.0, step=1.0)
coord = concat_coords(c1, c2)
assert len(coord) == len(c1) + len(c2)