libera_utils.footprint_matching.types.SampleSet#
- class libera_utils.footprint_matching.types.SampleSet(lats: ndarray, lons: ndarray, values: ndarray, times: ndarray | None, source: str, bounds: BoundingBox, timestamp_source: str | None = None, resolution_km: float = nan)#
Bases:
objectThe native samples of one source that fall in one footprint’s query.
What a reader hands the PSF weighting: every sample inside the footprint’s bounding box that also passes the reader’s
TimeMatchselection, at its own native location, with no averaging, binning or interpolation applied. The weighting assigns each sample a PSF weight and the aggregation engine reduces the weighted samples to one value per variable.- Variables:
lats (np.ndarray) – 1-D
(n,)float64 sample latitudes, degrees.lons (np.ndarray) – 1-D
(n,)float64 sample longitudes, degrees.values (np.ndarray) –
(n_var, n)float32 values in the reader’sVARIABLESorder, NaN where the source has no value at that sample.times (np.ndarray or None) – 1-D
(n,)datetime64[ns]per-sample observation times for aNEAREST_PASSsource;Nonefor the others.source (str) – Reader registry key that produced the samples.
bounds (BoundingBox) – The query box the samples were selected for.
timestamp_source (str or None) – For cloud-property products:
'radiometer'or'camera', the instrument whose observation time governs the data.Nonefor surface and static ancillary products.resolution_km (float) – The native cell size the samples stand for, km: the reader’s declared
RESOLUTION_KM, or the spacing measured on the granule when the reader measures it. The weighting sizes its coverage measure from it.
- __init__(lats: ndarray, lons: ndarray, values: ndarray, times: ndarray | None, source: str, bounds: BoundingBox, timestamp_source: str | None = None, resolution_km: float = nan) None#
Methods
empty(source, bounds, n_var[, ...])Return a zero-sample set, the result of a query that selected nothing.
Attributes
Number of samples in the set (zero for an empty query).
- classmethod empty(source: str, bounds: BoundingBox, n_var: int, timestamp_source: str | None = None, resolution_km: float = nan) SampleSet#
Return a zero-sample set, the result of a query that selected nothing.
- Parameters:
source (str) – Reader registry key.
bounds (BoundingBox) – The query box.
n_var (int) – Number of variables the reader serves, so
valueskeeps its first axis.timestamp_source (str, optional) – See the class attributes.
resolution_km (float, optional) – See the class attributes.