fold_and_bin_data

exovetter.modshift.fold_and_bin_data(time, flux, period, epoch, num_bins)[source]

Fold data, then bin it up.

Parameters:
time

(1d numpy array) times of observations

flux

(1d numpy array) flux values at each time. Flux should be in fractional amplitude (with typical out-of-transit values close to zero)

periodfloat

Orbital Period of TCE. Should be in same units as time

epochfloat

Time of first transit of TCE. Same units as time

num_binsint

How many bins to use for folded, binned, lightcurve

Returns:
out

2d numpy array. columns are phase (running from 0 to period), binned flux, and counts. The binned flux is the sum of all fluxes in that bin, while counts is the number of flux points added to the bin. To plot the binned lightcurve, you will want to find the average flux per bin by dividing binnedFlux / counts. Separating out the two components of average flux makes computing the significance of the transit easier.

Notes

This isn’t everything I want it to be. It assumes that every element in y, falls entirely in one bin element, which is not necessarily true.