From 3946d5577da63d7aa94954288f143237f8972bc2 Mon Sep 17 00:00:00 2001 From: Ted Wong Date: Sun, 15 Dec 2024 11:40:18 -0500 Subject: [PATCH] output column name change --- city_metrix/metrics/ghg_emissions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/city_metrix/metrics/ghg_emissions.py b/city_metrix/metrics/ghg_emissions.py index 1199700..232a469 100644 --- a/city_metrix/metrics/ghg_emissions.py +++ b/city_metrix/metrics/ghg_emissions.py @@ -5,6 +5,7 @@ SUPPORTED_SPECIES = CamsGhg.SUPPORTED_SPECIES SUPPORTED_YEARS = CamsGhg.SUPPORTED_YEARS +GWP = CamsGhg.GWP def ghg_emissions(zones, years=[2023]): # species is one of 'co2', 'ch4', 'n2o', 'chlorinated-hydrocarbons' @@ -29,8 +30,8 @@ def ghg_emissions(zones, years=[2023]): results = year_results.filter(ee.Filter.eq('sector', sector)).first().reduceRegions(geoms, ee.Reducer.mean()) result_Tg = gpd.GeoDataFrame([i['properties']['mean'] for i in results.getInfo()['features']]) result_tonne = result_Tg * 1000000 - zones_copy[f'{species}_{sector}_{year}'] = result_tonne + zones_copy[f'{species}_{sector}_{year}_tonnes'] = result_tonne if sector == 'sum': - year_total += result_tonne - zones_copy[f'total_{year}'] = year_total + year_total += (result_tonne * GWP[species]) + zones_copy[f'all-species_{year}_tonnes-CO2e'] = year_total return zones_copy