- LightCurve.bin(time_bin_size=None, time_bin_start=None, n_bins=None, aggregate_func=None, bins=None, binsize=None)¶
Bins a lightcurve in equally-spaced bins in time.
If the original light curve contains flux uncertainties (
flux_err), the binned lightcurve will report the root-mean-square error. If no uncertainties are included, the binned curve will return the standard deviation of the data.
The time interval for the binned time series. (Default: 0.5 days; default unit: days.)
The start time for the binned time series. Defaults to the first time in the sampled time series.
- n_binsint, optional
The number of bins to use. Defaults to the number needed to fit all the original points. Note that this will create this number of bins of length
time_bin_sizeindependent of the lightkurve length.
- aggregate_funccallable, optional
The function to use for combining points in the same bin. Defaults to np.nanmean.
The number of bins to divide the lightkurve into. In contrast to
n_binsthis sets the length of
In Lightkurve v1.x, the default behavior of
bin()was to create bins which contained an equal number data points in each bin. This type of binning is discouraged because it usually makes more sense to create equally-sized bins in time duration, which is the new default behavior in Lightkurve v2.x. Nevertheless, this
binsizeparameter allows users to simulate the old behavior of Lightkurve v1.x. For ease of implementation, setting this parameter is identical to passing
time_bin_size = lc.time[binsize] - time, which means that the bins are not guaranteed to contain an identical number of data points.
A new light curve which has been binned.