CONAN.utils.bin_data_with_gaps#
- CONAN.utils.bin_data_with_gaps(t, f, e=None, statistic='mean', binsize=0.0104, gap_threshold=0.5, exact_binsize=True, verbose=False)#
split t into chunks with gaps larger than gap_threshold*bin_size then bin each chunk separately. By default splits data where gap is larger than 0.5*binsize. Note binning only occurs if binsize>2*data_cadence, otherwise data is returned unbinned.
- Parameters:
t (array-like) – Time stamps.
f (array-like) – Fluxes.
e (array-like, optional) – Errors on the fluxes.
statistic (str, optional) – Statistic to compute in each bin. [‘mean’,’median’,’std’,’count’,’sum’,’max’] See scipy.stats.binned_statistic. Default is ‘mean’.
binsize (float, optional) – Size of the bins. default is 0.0104 (~15 mins)
gap_threshold (float, optional) – Threshold for identifying gaps. default is 0.5*binsize
exact_binsize (bool, optional) – If True, use exact binsize for binning. If False, use equally spaced bins based on the total time range and binsize. Default is True.
- Return type:
(t_binned, f_binned, e_binned) if e is not None else (t_binned, f_binned)