stilt.Footprint.aggregate#
- Footprint.aggregate(target, time_bins, *, resolution=None)[source]#
Conservatively regrid the footprint onto a target grid and sum over time.
The footprint is an extensive, per-cell sensitivity (its units carry
m^2), so coarsening it means summing native cells, not averaging. Each native cell is apportioned to the target cells it overlaps by area fraction (a sum-conserving conservative regrid), and native time steps are summed within eachtime_binsinterval. When the target is an aligned coarsening of the native grid this reduces exactly to a block-sum; when it is misaligned or finer, native cells are split across targets by overlap area. Native mass outside the target grid is dropped, never folded into edge cells.- Parameters:
target (xr.DataArray | xr.Dataset | list[tuple[float, float]]) – The target grid. Preferred: an xarray grid carrying
lon/lat(orx/y) coordinates;NaNcells in a 2-D DataArray are treated as masked-out. Also accepts a plain list of(x, y)cell centers (a regular grid is assumed), in which caseresolutionis used or inferred from the coordinate spacing.time_bins (pd.IntervalIndex) – Flux time intervals to sum over.
resolution (float or (float, float), optional) – Target cell size, only used (and only needed) when
targetis a bare coords list. When omitted it is inferred from the coordinate spacing, falling back to the native footprint resolution.
- Returns:
Indexed by (x, y) target cell with one column per time bin (labeled by bin left edge). Missing cell/bin combinations are 0.
- Return type:
pd.DataFrame