CONAN.utils.bin_data_with_gaps
==============================

.. py:function:: 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.

   :param t: Time stamps.
   :type t: array-like
   :param f: Fluxes.
   :type f: array-like
   :param e: Errors on the fluxes.
   :type e: array-like, optional
   :param statistic: Statistic to compute in each bin. ['mean','median','std','count','sum','max'] See `scipy.stats.binned_statistic`. Default is 'mean'.
   :type statistic: str, optional
   :param binsize: Size of the bins. default is 0.0104 (~15 mins)
   :type binsize: float, optional
   :param gap_threshold: Threshold for identifying gaps. default is 0.5*binsize
   :type gap_threshold: float, optional
   :param exact_binsize: If True, use exact binsize for binning. If False, use equally spaced bins based on the
                         total time range and binsize. Default is True.
   :type exact_binsize: bool, optional

   :rtype: (t_binned, f_binned, e_binned) if e is not None else (t_binned, f_binned)

