lightkurve.LightCurve.remove_nans#

LightCurve.remove_nans(column: str = 'flux')[source]#

Removes cadences where column is a NaN.

Parameters
columnstr

Column to check for NaNs. Defaults to 'flux'.

Returns
clean_lightcurveLightCurve

A new light curve object from which NaNs fluxes have been removed.

Examples

>>> import lightkurve as lk
>>> import numpy as np
>>> lc = lk.LightCurve({'time': [1, 2, 3], 'flux': [1., np.nan, 1.]})
>>> lc.remove_nans()
<LightCurve length=2>
time   flux  flux_err

Time float64 float64
---- ------- --------
1.0     1.0      nan
3.0     1.0      nan