pynrc.reduce.ref_pixels.mask_helper¶
- pynrc.reduce.ref_pixels.mask_helper()[source]¶
Helper to handle indices and logical indices of a mask
Output: index, a function, with signature indices = index(logical_indices), to convert logical indices of a mask to ‘equivalent’ indices
Example
>>> # linear interpolation of NaNs >>> mask = np.isnan(y) >>> x = mask_helper(y) >>> y[mask]= np.interp(x(mask), x(~mask), y[~mask])