The aggregator Module
API to aggregate data over shapes
The Aggregator class expects a netCDF dataset, containing 3 variables: value, latitude and longitude
- class Aggregator(infile: str, variable: str, outfile: str, strategy: RasterizationStrategy, shapefile: str, geography: Geography, extra_columns: Optional[Tuple[List[str], List[str]]] = None, ram=0)[source]
- Parameters
infile¶ – Path to file with raster data to be aggregated. Can be either NetCDF or GeoTiff file
variable¶ – Name of variable or variables that need to be aggregated
outfile¶ – Path to the output “csv.gz” file
strategy¶ – Rasterization strategy
shapefile¶ – Path to shapefile with polygons
geography¶ – What kind of geography: US Counties or ZIP/ZCTA codes
extra_columns¶ – if we need to add any extra columns to the CSV
ram¶ – Runtime memory available to the process
- set_strategy(strategy: RasterizationStrategy)[source]
- class NetCDFAggregator(infile: str, variable: str, outfile: str, strategy: RasterizationStrategy, shapefile: str, geography: Geography, extra_columns: Optional[Tuple[List[str], List[str]]] = None, ram=0)[source]
- Parameters
infile¶ – Path to file with raster data to be aggregated. Can be either NetCDF or GeoTiff file
variable¶ – Name of variable or variables that need to be aggregated
outfile¶ – Path to the output “csv.gz” file
strategy¶ – Rasterization strategy
shapefile¶ – Path to shapefile with polygons
geography¶ – What kind of geography: US Counties or ZIP/ZCTA codes
extra_columns¶ – if we need to add any extra columns to the CSV
ram¶ – Runtime memory available to the process
- class GeoTiffAggregator(infile: str, variable: str, outfile: str, strategy: RasterizationStrategy, shapefile: str, geography: Geography, extra_columns: Optional[Tuple[List[str], List[str]]] = None, ram: int = 0)[source]
- Parameters
infile¶ – Path to file with raster data to be aggregated. Can be either NetCDF or GeoTiff file
variable¶ – Name of variable or variables that need to be aggregated
outfile¶ – Path to the output “csv.gz” file
strategy¶ – Rasterization strategy
shapefile¶ – Path to shapefile with polygons
geography¶ – What kind of geography: US Counties or ZIP/ZCTA codes
extra_columns¶ – if we need to add any extra columns to the CSV
ram¶ – Runtime memory available to the process