Bands¶
petrophys.model.Bands
Also available as petrophys.evaluation.diagnostics.Bands
- class Bands(base, steps)[source]¶
A one-curve classification:
basefor every valid sample, then each(op, threshold, label)step in order (opone of>,>=,<,<=).Examples
>>> b = Bands("POOR", ((">", 1.0, "FAIR"), (">", 10.0, "GOOD"))) >>> list(b.classify([0.5, 1.0, 5.0, 50.0])), b.edges, b.labels (['POOR', 'POOR', 'FAIR', 'GOOD'], (1.0, 10.0), ('POOR', 'FAIR', 'GOOD'))
Attributes
The thresholds, ascending.
The labels from the lowest to the highest values.
Methods
The label of every sample (
missingwhere the value is not valid; default validity: finite).The range of each label as text, e.g.
"LOW < 0.5; HIGH >= 0.5".The label of one value (None when it is not finite).
The range of each label, from the lowest to the highest values.
A coarsening of these bands: the steps at
edgesdropped.- classify(values, valid=None, missing='NO_DATA')[source]¶
The label of every sample (
missingwhere the value is not valid; default validity: finite).
- without_edges(*edges)[source]¶
A coarsening of these bands: the steps at
edgesdropped.The classes either side of a dropped edge merge, under the label the remaining steps give them.
Examples
>>> b = Bands("POOR", ((">", 1.0, "FAIR"), ("<=", 0.1, "VERY_POOR"))) >>> b.without_edges(0.1).labels ('POOR', 'FAIR')