bin_by_time

gdt.core.binning.unbinned.bin_by_time(times, dt, tstart=None, tstop=None, time_ref=None)[source]

Bins unbinned data to a specified temporal bin width.

Parameters:
  • times (np.array) – The time of each event

  • dt (float) – The requested temporal bin width in seconds

  • tstart (float, optional) – The first bin edge time. Will use the first event time if omitted.

  • tstop – (float, optional): The last bin edge time. Will use the last event time if omitted.

  • time_ref (float, optional) – The reference time at which the binning will be based. If the set, the binning will proceed starting at time_ref and moving forward in time as well as starting at time_ref and moving backward in time. If not set, the binning will start at the beginning of the data.

Returns:

np.array – The edges of the binned data