edges_analysis.averaging.averaging

Methods for averaging arrays.

There are multiple methods in this module, due to the need for careful averages/binning done in different ways. There are ultimately three axes over which we might bin spectra: nights, LST/GHA and frequency. Each of these in fact requires slightly different methods for averaging, in order to make the average unbiased (given flags).

Functions

bin_array_biased_regular(data[, weights, ...])

Bin arbitrary-dimension data carefully along an axis.

bin_array_unbiased_irregular(data[, ...])

Bin arbitrary-dimension data carefully along an axis.

bin_data(data[, residuals, weights, bins, axis])

Bin data, in an un-biased way if possible.

bin_freq_unbiased_irregular(spectrum[, ...])

Average a spectrum, with weights, in frequency.

bin_freq_unbiased_regular(model, params, ...)

Bin an array along the frequency axis into regular bins.

bin_gha_unbiased_regular(params, resids, ...)

Bin data in an unbiased way using a model fit.

bin_spectrum_unbiased_regular(params, ...[, ...])

Bin a spectrum in GHA and frequency in an unbiased and regular manner.

get_bin_edges(coords[, bins, start, stop])

Get bin edges given input coordinates and a simple description of the binning.

get_binned_weights(x, bins[, weights])

Get the total weight in each bin for a given vector.

weighted_mean(data[, weights, axis])

A careful weighted mean where zero-weights don't error.

weighted_sorted_metric(data[, weights, metric])

Semi-weighted integrator of data.

weighted_standard_deviation(av, data, std[, ...])

Calcualte a careful weighted standard deviation.

weighted_sum(data[, weights, normalize, axis])

A careful weighted sum.