Climate & Air Quality¶
| Class | Key params | Returns | Data source | Description |
|---|---|---|---|---|
AcagPM2p5 |
year=2023, return_above=0 |
raster | GEE projects/wri-datalab/cities/aq/acag_annual_pm2p5_{year} |
Annual mean PM2.5 concentration surface. |
Albedo |
start_date, end_date, threshold=None |
raster | GEE S2 SR + Cloud Probability | Mean surface albedo from cloud-masked Sentinel-2. |
AlbedoCloudMasked |
start_date, end_date, index_aggregation=False, zonal_stats='median', num_seasons=3, worldpop_version=1 |
raster | GEE S2 SR + Cloud Score+ | Multi-season median/mean albedo, optionally aligned to WorldPop grid. |
Cams |
start_date, end_date, species=None |
raster | CDS API cams-global-reanalysis-eac4 |
Atmospheric pollutant concentrations (NO2, SO2, O3, PM2.5, PM10, CO) via CamsSpecies. |
CamsGhg |
species=None, sector='sum', co2e=True, year=2024 |
raster | GEE projects/wri-datalab/cams-glob-ant |
Annual GHG emissions (CO2/CH4/N2O or CO2e) by sector. |
CarbonFluxFromTrees |
(none) | raster | GEE GFW net-flux-forest-extent (Harris et al. 2021) | Average annual net carbon flux from forest, 2001–2023. |
Era5HottestDay (era5_hottest_day.py) |
start_date=None, end_date=None, seasonal_utc_offset=0.0 |
raster | GEE ERA5_LAND/HOURLY + CDS API | Finds the hottest day in range, pulls full hourly ERA5 variables via CDS. |
Era5HottestDay (era5_hottest_day_gee.py) |
start_date=None, end_date=None, seasonal_utc_offset=0.0 |
raster | GEE ERA5_LAND/DAILY_AGGR, HOURLY, ERA5/HOURLY | Pure-GEE variant of the above, avoiding the CDS dependency. |
LandSurfaceTemperature |
start_date, end_date, hot_season_length=None, use_modis=False |
raster | GEE Landsat 8 C02/T1_L2 thermal or MODIS MOD11A2 | Percentile/median composite of land surface temperature. |
HighLandSurfaceTemperature |
start_date, end_date, index_aggregation=False, high_lst=False, use_modis=False, worldpop_version=1 |
raster | derived from LandSurfaceTemperature + WorldPop |
Hot-spot LST pixels more than 3°C above the local mean. |
NexGddpCmip6 |
varname='tasmax', start_year=2040, end_year=2049, scenario='ssp245', num_models=3 |
dict of arrays | GEE NASA/GDDP-CMIP6 + ERA5/DAILY (calibration) |
Bias-corrected future climate projections from best-fit CMIP6 models, via NexGddpCmip6Variables. |
PopWeightedPM2p5 |
worldpop_agesex_classes=[], worldpop_year=2020, worldpop_version=1, acag_year=2023, acag_return_above=0 |
raster | composes WorldPop + AcagPM2p5 |
PM2.5 concentration weighted by relative population density. |
Duplicate class name
Both Era5HottestDay classes share a name but live in different modules (era5_hottest_day vs. era5_hottest_day_gee) — import from the specific submodule if ambiguity matters.
API¶
city_metrix.layers.acag_pm2p5.AcagPM2p5 ¶
AcagPM2p5(year=2023, return_above=0, **kwargs)
city_metrix.layers.albedo.Albedo ¶
Albedo(start_date: str = '2024-01-01', end_date: str = '2025-01-01', threshold=None, **kwargs)
Bases: Layer
S2_ALBEDO_EQN
class-attribute
instance-attribute
¶
S2_ALBEDO_EQN = '((B*Bw)+(G*Gw)+(R*Rw)+(NIR*NIRw)+(SWIR1*SWIR1w)+(SWIR2*SWIR2w))'
Attributes: start_date: starting date for data retrieval; set to None for auto-selected previous year's summer end_date: ending date for data retrieval; set to None for auto-selected previous year's summer threshold: threshold value for filtering the retrieval
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method: str = DEFAULT_RESAMPLING_METHOD)
city_metrix.layers.albedo_cloud_masked.AlbedoCloudMasked ¶
AlbedoCloudMasked(start_date: str = None, end_date: str = None, index_aggregation=False, zonal_stats='median', num_seasons=3, worldpop_version=1, **kwargs)
Bases: Layer
MAJOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MAJOR_NAMING_ATTS = ['zonal_stats', 'num_seasons', 'start_date', 'end_date']
PROCESSING_TILE_SIDE_M
class-attribute
instance-attribute
¶
PROCESSING_TILE_SIDE_M = 5000
Attributes: start_date: starting date for data retrieval end_date: ending date for data retrieval zonal_stats: use 'mean' or 'median' for albedo zonal stats
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method: str = DEFAULT_RESAMPLING_METHOD)
city_metrix.layers.cams.Cams ¶
Cams(start_date='2024-01-01', end_date='2024-12-31', species=None, **kwargs)
Bases: Layer
city_metrix.layers.cams.CamsSpecies ¶
Bases: Enum
NO2
class-attribute
instance-attribute
¶
NO2 = {'name': 'nitrogen dioxide', 'molar_mass': 46.0055, 'who_threshold': 25.0, 'cost_per_tonne': 67000, 'eac4_varname': 'no2'}
SO2
class-attribute
instance-attribute
¶
SO2 = {'name': 'sulfur dioxide', 'molar_mass': 64.066, 'who_threshold': 40.0, 'cost_per_tonne': 33000, 'eac4_varname': 'so2'}
O3
class-attribute
instance-attribute
¶
O3 = {'name': 'ozone', 'molar_mass': 48.0, 'who_threshold': 100.0, 'cost_per_tonne': np.nan, 'eac4_varname': 'go3'}
PM25
class-attribute
instance-attribute
¶
PM25 = {'name': 'fine particulate matter', 'who_threshold': 15.0, 'cost_per_tonne': np.nan, 'eac4_varname': 'pm2p5'}
PM10
class-attribute
instance-attribute
¶
PM10 = {'name': 'coarse particulate matter', 'who_threshold': 45.0, 'cost_per_tonne': np.nan, 'eac4_varname': 'pm10'}
CO
class-attribute
instance-attribute
¶
CO = {'name': 'carbon monoxide', 'molar_mass': 28.01, 'who_threshold': 4000.0, 'cost_per_tonne': 250, 'eac4_varname': 'co'}
city_metrix.layers.cams_ghg.CamsGhg ¶
CamsGhg(species=None, sector='sum', co2e=True, year=2024, **kwargs)
Bases: Layer
SUPPORTED_SPECIES
class-attribute
instance-attribute
¶
SUPPORTED_SPECIES = {'co2': {'GWP': 1, 'sectors': ['ags', 'awb', 'ene', 'fef', 'ind', 'ref', 'res', 'shp', 'slv', 'sum', 'swd', 'tnr', 'tro']}, 'ch4': {'GWP': 28, 'sectors': ['agl', 'ags', 'awb', 'ene', 'fef', 'ind', 'ref', 'res', 'shp', 'sum', 'swd', 'tnr', 'tro']}, 'n2o': {'GWP': 265, 'sectors': ['ags', 'awb', 'ene', 'fef', 'ind', 'ref', 'res', 'slv', 'sum', 'swd', 'tnr', 'tro']}}
SUPPORTED_YEARS
class-attribute
instance-attribute
¶
SUPPORTED_YEARS = [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024]
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: float = DEFAULT_SPATIAL_RESOLUTION, resampling_method=None, allow_cache_retrieval=False)
city_metrix.layers.carbon_flux_from_trees.CarbonFluxFromTrees ¶
CarbonFluxFromTrees(**kwargs)
Bases: Layer
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = None
Average annual carbon emissions minus removal in tonnes CO2e over 23-year period 2001-2023. Not a time series. Model 1.3.2. See Harris et al. 2021 Nature Climate Change (nature.com/articles/s41558-020-00976-6). Contacts: david.gibbs@wri.org and nharris@wri.org
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method=None)
city_metrix.layers.era5_hottest_day.Era5HottestDay ¶
Era5HottestDay(start_date: str = None, end_date: str = None, seasonal_utc_offset: float = 0, **kwargs)
Bases: Layer
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = None
Attributes: start_date: starting date for data retrieval end_date: ending date for data retrieval seasonal_utc_offset: UTC-offset in hours as determined for AOI and DST usage.
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution=None, resampling_method=None, force_data_refresh=False)
city_metrix.layers.era5_hottest_day_gee.Era5HottestDay ¶
Era5HottestDay(start_date: str = None, end_date: str = None, seasonal_utc_offset: float = 0, **kwargs)
Bases: Layer
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = None
Attributes: start_date: starting date for data retrieval end_date: ending date for data retrieval seasonal_utc_offset: UTC-offset in hours as determined for AOI and DST usage.
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method=None, force_data_refresh=False)
city_metrix.layers.land_surface_temperature.LandSurfaceTemperature ¶
LandSurfaceTemperature(start_date='2023-01-01', end_date='2026-01-01', hot_season_length=None, use_modis=False, **kwargs)
Bases: Layer
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = None
Attributes: start_date: starting date for data retrieval end_date: ending date for data retrieval
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION_LANDSAT, resampling_method=None)
city_metrix.layers.high_land_surface_temperature.HighLandSurfaceTemperature ¶
HighLandSurfaceTemperature(start_date='2023-01-01', end_date='2026-01-01', index_aggregation=False, high_lst=False, use_modis=False, worldpop_version=1, **kwargs)
Bases: Layer
city_metrix.layers.nex_gddp_cmip6.NexGddpCmip6 ¶
NexGddpCmip6(varname='tasmax', start_year=2040, end_year=2049, scenario='ssp245', num_models=3, **kwargs)
Bases: Layer
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = None
get_data() returns daily values of variable for given year range FOR CENTROID OF GIVEN GEOM If model not specified, returns for five best models based on RMSD vs ERA5 for historical period Leap days are removed
varname is 'tas', 'tasmin', 'tasmax', 'pr', 'hurs', 'sfcWind', 'rlds', 'rsds' hurs is %; huss is mass fraction, rlds and rsds are W/m2, sfc is m/s temps are converted to deg-C; pr converted to mm/day
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method=None)
city_metrix.layers.nex_gddp_cmip6.NexGddpCmip6Variables ¶
Bases: Enum
tas
class-attribute
instance-attribute
¶
tas = {'era_varname': 'mean_2m_air_temperature', 'nex_transform': lambda x: x - 273.5, 'era_transform': lambda x: x - 273.5}
tasmax
class-attribute
instance-attribute
¶
tasmax = ({'era_varname': 'maximum_2m_air_temperature', 'nex_transform': lambda x: x - 273.5, 'era_transform': lambda x: x - 273.5},)
tasmin
class-attribute
instance-attribute
¶
tasmin = ({'era_varname': 'minimum_2m_air_temperature', 'nex_transform': lambda x: x - 273.5, 'era_transform': lambda x: x - 273.5},)
pr
class-attribute
instance-attribute
¶
pr = ({'era_varname': 'total_precipitation', 'nex_transform': lambda x: x * 86400, 'era_transform': lambda x: x * 1000},)
hurs
class-attribute
instance-attribute
¶
hurs = ({'era_varname': None, 'nex_transform': lambda x: x, 'era_transform': lambda x: x},)
maxwetbulb
class-attribute
instance-attribute
¶
maxwetbulb = {'era_varname': None, 'nex_transform': lambda x: x, 'era_transform': lambda x: x}
city_metrix.layers.pop_weighted_pm2p5.PopWeightedPM2p5 ¶
PopWeightedPM2p5(worldpop_agesex_classes: WorldPopClass = [], worldpop_year=2020, worldpop_version=1, acag_year=2023, acag_return_above=0, **kwargs)
Bases: Layer
MAJOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MAJOR_NAMING_ATTS = ['worldpop_agesex_classes']
MINOR_NAMING_ATTS
class-attribute
instance-attribute
¶
MINOR_NAMING_ATTS = ['worldpop_year', 'acag_year', 'acag_return_above', 'worldpop_version']
Attributes: worldpop_agesex_classes:Enum value from WorldPopClass OR list of age-sex classes to retrieve (see https://airtable.com/appDWCVIQlVnLLaW2/tblYpXsxxuaOk3PaZ/viwExxAgTQKZnRfWU/recFjH7WngjltFMGi?blocks=hide) worldpop_year: year used for data retrieval acag_year: 2010-2023 acag_return_above:
get_data ¶
get_data(bbox: GeoExtent, spatial_resolution: int = DEFAULT_SPATIAL_RESOLUTION, resampling_method=None)