lightkurve.LightCurve.create_transit_mask#
- LightCurve.create_transit_mask(period, transit_time, duration)[source]#
Returns a boolean array that is
True
during transits andFalse
elsewhere.This method supports multi-planet systems by allowing
period
,transit_time
, andduration
to be array-like lists of parameters.- Parameters
- Returns
- transit_masknp.array of bool
Mask that flags transits. Mask is
True
where there are transits.
Examples
You can create a transit mask for a single-planet system as follows:
>>> import lightkurve as lk >>> lc = lk.LightCurve({'time': [1, 2, 3, 4, 5], 'flux': [1, 1, 1, 1, 1]}) >>> lc.create_transit_mask(transit_time=2., period=2., duration=0.1) array([False, True, False, True, False])
The method accepts lists of parameters to support multi-planet systems:
>>> lc.create_transit_mask(transit_time=[2., 3.], period=[2., 10.], duration=[0.1, 0.1]) array([False, True, True, True, False])