curve_statistics

petrophys.evaluation.summaries.curve_statistics

curve_statistics(values, percentiles=())[source]

Summary statistics of the finite samples of a curve.

The statistics the reference context reports for a curve over a lithology group, unrounded: minimum, maximum, arithmetic mean, geometric and harmonic means, the third-power average (cube root of the mean cube), median, mode of the values rounded to 4 decimals and the population standard deviation; with the variance, the sample count and any requested percentiles.

The geometric and harmonic means are over all finite samples, as defined for non-negative values: a zero sample makes both 0 (its logarithm and reciprocal are unbounded), and a negative sample leaves them undefined (NaN). So geometric mean <= arithmetic mean always holds. The benchmark reproduction takes both over the positive samples only (0 without any).

Parameters:
  • values (array-like or Curve) – Curve samples. Non-numeric and non-finite values are ignored.

  • percentiles (iterable of float, optional) – Percentiles (0-100) to add, each under percentile_key() (p10, p2.5).

Returns:

count, the STATISTICS, variance and the requested percentiles; None when there is no finite sample.

Return type:

dict or None

Examples

>>> stats = curve_statistics([0.1, 0.2, float("nan"), 0.3], percentiles=[50])
>>> stats["count"], round(stats["arithmetic_mean"], 6), round(stats["p50"], 6)
(3, 0.2, 0.2)