get_gap_edges

function of dascore.utils.gaps source

get_gap_edges(
    values ,
    gap_factor: float | None[float, None] = None,
)

Return cell edges and coordinate gap locations.

Timedelta coordinates are converted to seconds. Datetime coordinates are retained so plotting libraries with datetime support can convert them. When gap_factor is None, adjacent cell edges meet halfway between coordinate centers. Otherwise, intervals larger than gap_factor times the median interval are expanded into a gap.

Parameters

Parameter Description
values One-dimensional, monotonic coordinate centers.
gap_factor Factor of the median interval above which an interval is a gap. If
None, no intervals are considered gaps.

Returns

tuple[np.ndarray, np.ndarray] Cell edges and a Boolean array marking gaps after each input value.