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_seriesTimeSeries

The time series to downsample.

time_bin_sizeQuantity

The time interval for the binned time series.

time_bin_startTime, optional

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.

aggregate_funccallable, optional

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

Returns
binned_time_seriesBinnedTimeSeries

The downsampled time series.