libera_utils.footprint_matching.weighting.PixelWeigher#

class libera_utils.footprint_matching.weighting.PixelWeigher#

Bases: ABC

Interface: turn a footprint’s samples + viewing geometry into per-sample PSF weights.

Implementations return a WeightField whose weights array is aligned to the samples. Keeping this a narrow ABC is the whole point: the aggregation engine depends only on this contract, so the radial stand-in and the angular-frame weigher are interchangeable.

__init__()#

Methods

weight_field(samples, boresight_lat_deg, ...)

Return the per-sample PSF WeightField for samples.

Attributes

uses_viewing_frame

Whether this weigher consumes a precomputed per-footprint viewing frame (the frame argument of weight_field()).

uses_viewing_frame: bool = False#

Whether this weigher consumes a precomputed per-footprint viewing frame (the frame argument of weight_field()). The orchestrator batches the frames up front only when this is True, so a weigher that ignores frame (the radial stand-in) pays nothing for the machinery.

abstractmethod weight_field(samples: SampleSet, boresight_lat_deg: float, boresight_lon_deg: float, *, subsatellite_lat_deg: float, subsatellite_lon_deg: float, satellite_radius_km: float, sample_resolution_km: float, viewing_zenith_deg: float, cone_angle_rate: float | None = None, frame: ViewingFrame | None = None) → WeightField#

Return the per-sample PSF WeightField for samples.

Parameters:
  • samples (SampleSet) – The native samples a reader served for the footprint’s bounding box.

  • boresight_lat_deg (float) – Footprint boresight centroid, degrees (the PSF center).

  • boresight_lon_deg (float) – Footprint boresight centroid, degrees (the PSF center).

  • subsatellite_lat_deg (float) – Geodetic spacecraft sub-point (L1B Subsatellite_Latitude / Subsatellite_Longitude), degrees. Weighers that project samples into the angular frame (AngularPSFWeigher) use it to orient the scan plane; weighers that only need the boresight (RadialWeigher) ignore it.

  • subsatellite_lon_deg (float) – Geodetic spacecraft sub-point (L1B Subsatellite_Latitude / Subsatellite_Longitude), degrees. Weighers that project samples into the angular frame (AngularPSFWeigher) use it to orient the scan plane; weighers that only need the boresight (RadialWeigher) ignore it.

  • satellite_radius_km (float) – Spacecraft distance from Earth’s center (L1B Radius_of_Satellite_from_Center_of_Earth), km. Used to convert the PSF’s angular extent into a ground radius and, for the angular frame, to place the satellite.

  • sample_resolution_km (float) – The source’s native sample spacing (the reader’s RESOLUTION_KM). Sets the coverage reference bin so one native sample marks about one bin.

  • viewing_zenith_deg (float) – Viewing zenith angle, degrees. Elongates the ground footprint at oblique views. Required: it sets the slant range, the along-scan foreshortening and the truncation radius, so no default stands in for a missing angle.

  • cone_angle_rate (float, optional) – L1B Cone_Angle_Rate (deg/s). Its sign sets the scan direction and a (near-)zero value marks a stationary scanner. Required by AngularPSFWeigher; ignored by weighers that do not model the asymmetric along-scan PSF.

  • frame (ViewingFrame, optional) – A precomputed single-footprint viewing frame (see compute_viewing_frames() and for_index()). Weighers that project into the angular frame use it to skip the per-footprint viewing-geometry reconstruction; weighers that do not need it (the radial stand-in) ignore it.