satlas.utilities.utilities.weighted_average¶
-
satlas.utilities.utilities.
weighted_average
(x, sigma, axis=None)[source]¶ Takes the weighted average of an array of values and the associated errors. Calculates the scatter and statistical error, and returns the greater of these two values.
Parameters: - x (array_like) – Array-like assortment of measured values, is transformed into a 1D-array.
- sigma (array_like) – Array-like assortment of errors on the measured values, is transformed into a 1D-array.
Returns: Returns a tuple (weighted_average, uncertainty), with the uncertainty being the greater of the uncertainty calculated from the statistical uncertainty and the scattering uncertainty.
Return type: tuple
Note
The formulas used are