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. nan_helper  (  y  )[source]

A helper to handle nan values, e.g., to interpolate them with y[nans] = numpy.interp(x(nans), x(~nans), y[~nans]).

Parameters:
yarray_like

An array-like value.

Returns:
(nans, x)tuple[ndarray, Callable]

The mask where y is nan and a function which returns the nonzero indices of an array.