lair.transects.detection_frequency#
- lair.transects.detection_frequency(enh, threshold, min_transits=10)[source]#
Fraction of transits (with data at the point) whose enhancement exceeds
threshold.- Parameters:
enh (np.ndarray) – Enhancement matrix
enh[transit, point], as fromenhancement().threshold (float) – Enhancement above which a transit counts as a detection.
min_transits (int, optional) – Fewest transits with data a point needs. Default 10.
- Returns:
np.ndarray – The fraction per point. Points sampled by fewer than
min_transitstransits are NaN.- Return type:
See also
Examples
With the enhancement of the example in
enhancement(), the third point is enhanced by more than 0.2 in two of three transits:>>> import numpy as np >>> from lair.transects import detection_frequency >>> enh = np.array( ... [[0.0, 0.1, 0.6, 0.0], [0.0, 0.0, 0.1, 0.7], [0.0, np.nan, 0.5, 0.0]] ... ) >>> detection_frequency(enh, threshold=0.2, min_transits=2).round(3) array([0. , 0. , 0.667, 0.333])