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: object

The 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 TimeMatch selection, 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’s VARIABLES order, 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 a NEAREST_PASS source; None for 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. None for 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

n_samples

Number of samples in the set (zero for an empty query).

resolution_km

timestamp_source

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 values keeps its first axis.

  • timestamp_source (str, optional) – See the class attributes.

  • resolution_km (float, optional) – See the class attributes.

property n_samples: int#

Number of samples in the set (zero for an empty query).

resolution_km: float = nan#
timestamp_source: str | None = None#