API Reference#

This section provides comprehensive documentation for all gdptools classes and functions.

Overview#

The gdptools API is organized into several key modules:

Quick Start#

For most users, the primary entry points are:

# Grid-to-polygon aggregation
from gdptools import AggGen

# Polygon-to-polygon weights
from gdptools import WeightGenP2P

# Zonal statistics on rasters
from gdptools import ZonalGen

Module Index#

gdptools

Top-level package for pygeoapi plugin: Gdptools.

Classes and Functions Index#

data.user_data.ClimRCatData(*, ...)

Interface for Climate-R catalog datasets with automatic metadata handling.

data.user_data.UserCatData(*, source_ds, ...)

Handler for user-provided xarray datasets with custom configuration.

data.user_data.NHGFStacData(*, ...[, ...])

Factory for NHGF STAC catalog datasets.

data.user_data.NHGFStacZarrData(*, ...)

Interface for Zarr-backed NHGF STAC catalog datasets.

data.user_data.NHGFStacTiffData(*, ...[, ...])

Interface for GeoTIFF-backed NHGF STAC catalog datasets (e.g., NLCD).

data.user_data.UserTiffData(source_ds, ...)

Handler for GeoTIFF and other raster data sources.

agg_gen.AggGen(user_data, stat_method, ...)

Performs grid-to-polygon aggregation using area-weighted statistics.

weight_gen.WeightGen(*, user_data, method, ...)

Calculates grid-to-polygon intersection weights for area-weighted aggregation.

weight_gen_p2p.WeightGenP2P(*, target_poly, ...)

Calculates polygon-to-polygon intersection weights for spatial data transfer.

zonal_gen.ZonalGen(user_data, zonal_engine, ...)

Calculate standard zonal statistics for raster data.

helpers.build_subset(bounds, xname, yname, ...)

Create a dictionary to use with xarray .sel() method to subset by time and space.

helpers.build_subset_tiff(bounds, xname, ...)

Create a dictionary to use with xarray .sel() method to subset TIFF data by space and band.

helpers.build_subset_tiff_da(bounds, xname, ...)

Create a dictionary to use with xarray .sel() method to subset TIFF DataArray by space.

helpers.check_gridded_data_for_dimensions(ds, ...)

Check that gridded data has the required dimensions.