lair.transects.magnitude#
- lair.transects.magnitude(enh, threshold=None, stat='median', min_transits=10)[source]#
Per-point enhancement magnitude.
It is
statover detected transits (enh > threshold) or over all transits with data (threshold=None).- Parameters:
enh (np.ndarray) – Enhancement matrix
enh[transit, point], as fromenhancement().threshold (float or None, optional) – Enhancement above which a transit counts as a detection; None (the default) uses every transit with data.
stat (str, optional) –
"median"(the default) or"mean".min_transits (int, optional) – Fewest transits with data (before thresholding) a point needs. Default 10.
- Returns:
np.ndarray – The magnitude per point. Points sampled by fewer than
min_transitstransits are NaN; so are points with no detection at all.- Return type:
See also
detection_frequencyHow often each point is enhanced.
Examples
>>> import numpy as np >>> from lair.transects import magnitude >>> 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]] ... ) >>> magnitude(enh, threshold=0.2, min_transits=2) array([ nan, nan, 0.55, 0.7 ])