anaflow.tools.mean.annular_hmean
- annular_hmean(func, val_arr, ann_dim=2, arg_dict=None, **kwargs)[source]
Calculating the annular harmonic mean.
Calculating the annular harmonic mean of a radial symmetric function for given consecutive radii defining annuli by the following formula
\[\varphi_i=\left(\frac{d}{r_{i+1}^d-r_i^d} \intop^{r_{i+1}}_{r_i} r^{d-1}\cdot \varphi(r)^{-1}\, dr \right)^{-1}\]- Parameters:
func (
callable) – Function that should be used (\(\varphi\) in the formula). The first argument needs to be the radial variable:func(r, **kwargs)val_arr (
numpy.ndarray) – Radii defining the annuli.ann_dim (
float, optional) – The dimension of the annuli. Default:2.0arg_dict (
dictorNone, optional) – Keyword-arguments given as a dictionary that are forwarded to the function given infunc. Will be merged with**kwargs. This is designed for overlapping keywords inannular_hmeanandfunc. Default:None**kwargs – Keyword-arguments that are forwarded to the function given in
func. Will be merged witharg_dict
- Returns:
Array with all calculated geometric means
- Return type:
- Raises:
ValueError – If func is not callable.
ValueError – If
val_arrhas less than 2 values.ValueError – If
val_arris not sorted in incresing order.
Notes
If the last value in val_arr is “inf”, the given function should provide a value for “inf” as input:
func(float("inf"))