qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. merge_intervals  (  intervals  )[source]

Merge overlapping intervals.

Parameters:
intervalsIterable[Iterable[scalar]]

An iterable of intervals. An interval i is itself an iterable of two scalar values. If i[1] < i[0], the interval is reversed.

Returns:
mergedndarray

An array of sorted, non-overlapping intervals with shape (n, 2).