lightkurve.LightCurve.create_transit_mask#

LightCurve.create_transit_mask(period, transit_time, duration)[source]#

Returns a boolean array that is True during transits and False elsewhere.

This method supports multi-planet systems by allowing period, transit_time, and duration to be array-like lists of parameters.

Parameters
periodQuantity, float, or array-like

Period(s) of the transits.

durationQuantity, float, or array-like

Duration(s) of the transits.

transit_timeTime, float, or array-like

Transit midpoint(s) of the transits.

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])