aggregate_downsample

astropy.timeseries.aggregate_downsample(time_series, *, time_bin_size=None, time_bin_start=None, n_bins=None, aggregate_func=None)[source]

Downsample a time series by binning values into bins with a fixed size, using a single function to combine the values in the bin.

Parameters:
time_series : TimeSeries

The time series to downsample.

time_bin_size : Quantity

The time interval for the binned time series.

time_bin_start : Time, optional

The start time for the binned time series. Defaults to the first time in the sampled time series.

n_bins : int, optional

The number of bins to use. Defaults to the number needed to fit all the original points.

aggregate_func : callable, optional

The function to use for combining points in the same bin. Defaults to np.nanmean.

Returns:
binned_time_series : BinnedTimeSeries

The downsampled time series.