aggregate

aggregate

quark.aggregate

Core aggregation engine: reproject and accumulate N-dimensional xarray Datasets onto a target projection grid.

Iteration 1 (current): - In-memory mode only (vars_batch_size must be None) - No supersampling (supersampling must be 1) - naive sum_method only (“kahan” accepted by interface, raises NotImplementedError) - Full NDIMS support: variables may be 2-D, 3-D, 4-D … (lat/lon rasters are always 2-D; extra dims are preserved in output)

Classes

Name Description
Aggregator Stateful aggregation pipeline.

Aggregator

aggregate.Aggregator(
    datasets,
    projection,
    lat_name='latitude',
    lon_name='longitude',
    variables=None,
    fail_on_schema_mismatch=True,
    sum_method='simple',
    skipna=True,
    supersampler=None,
    return_counts=False,
    return_sums=False,
    dtype=None,
)

Stateful aggregation pipeline.

Encapsulates projection, configuration, variable metadata, and accumulators. Eliminates the need to pass dozens of arguments through helper functions.

Methods

Name Description
compute Process all datasets and return the aggregated result.
process_dataset Process one dataset: project and accumulate all variables.
compute
aggregate.Aggregator.compute()

Process all datasets and return the aggregated result.

Returns
Name Type Description
xr.Dataset Aggregated dataset with coordinates and attributes
process_dataset
aggregate.Aggregator.process_dataset(ds)

Process one dataset: project and accumulate all variables.

Parameters
Name Type Description Default
ds xr.Dataset Source dataset to process required