diff --git a/da/preprocessing/category_info.py b/da/preprocessing/category_info.py index 6df8ff9c5b52720f983e31f53ee4f9741dde1412..31528958fbf8757b690579c71685938bcc5d8a86 100755 --- a/da/preprocessing/category_info.py +++ b/da/preprocessing/category_info.py @@ -3,38 +3,38 @@ categories = OrderedDict({ 'A_Public_power': { 'gnfr': 'A', 'model': 1, - 'description': 'CO2 emitted by the generation of public power, including biofuel portion'}, + 'description': 'CO2 emitted by the generation of public power (GNFR A), including biofuel portion. Based on ENTSO-E'}, 'B_Industry': { 'gnfr': 'B', 'model': 1, - 'description': 'CO2 emitted by the industry sector, including biofuel portion'}, + 'description': 'CO2 emitted by the industry sector (GNFR B), including biofuel portion. Based on CAMS data, extrapolated by Key Economic Indicators from Eurostat'}, 'C_Other_stationary_combustion_consumer': { 'gnfr': 'C', 'model': 1, - 'description': 'CO2 emitted by other stationary combustion, including residential and commercial heating, including biofuel portion'}, + 'description': 'CO2 emitted by other stationary combustion (GNFR C), including residential and commercial heating, including biofuel portion. Based on CAMS data, extrapolated by heating degree days from ERA5'}, 'F_On-road': { 'gnfr': 'F', 'model': 1, 'different_profiles_weekends': True, - 'description': 'CO2 emitted by on-road traffic, including cars and high- and low duty vehicles'}, + 'description': 'CO2 emitted by on-road traffic (GNFR F), including cars and high- and low duty vehicles. Based on CAMS dtata, extrapolated by Eurostat fuel demand'}, 'H_Aviation': { 'gnfr': 'H', 'model': 1, - 'description': 'CO2 emitted for Landing and TakeOff of aviation'}, + 'description': 'CO2 emitted for Landing and TakeOff of aviation (GNFR H). Based on CAMS, with extrapolation based on kerosine demand, taken from Eurostat'}, 'I_Off-road': { 'gnfr': 'I', 'model': 1, - 'description': 'CO2 emitted by off-road vehicles, including construction work and lawn mowers'}, -'L_Agri_other': { - 'gnfr': 'L', - 'model': 1, - 'description': 'CO2 emissions from agriculture, excluding livestock'}, -'K_Agri_livestock': { - 'gnfr': 'K', - 'model': 1, - 'description': 'CO2 emissions from agriculture livestock'}, + 'description': 'CO2 emitted by off-road vehicles (GNFR I, including construction work and lawn mowers). Based on CAMS emissions, without modification'}, +#'L_Agri_other': { +# 'gnfr': 'L', +# 'model': 1, +# 'description': 'CO2 emissions from agriculture, excluding livestock'}, +#'K_Agri_livestock': { +# 'gnfr': 'K', +# 'model': 1, +# 'description': 'CO2 emissions from agriculture livestock'}, 'G_Shipping': { 'gnfr': 'G', 'model': 1, - 'description': 'CO2 emitted ships, including international shipping'}, + 'description': 'CO2 emitted ships, including international shipping (GNFR G). Based on CAMS data, extrapolated by Eurostat fuel demand'}, }) diff --git a/da/preprocessing/emissionmodel.py b/da/preprocessing/emissionmodel.py index c13d05a954bcf35f5c8cee8e3887b1fd5a78eecf..e498507b83c2c2466df4773e003ca2ccede43583 100755 --- a/da/preprocessing/emissionmodel.py +++ b/da/preprocessing/emissionmodel.py @@ -13,7 +13,7 @@ to create pseudo-data """ import shutil, os, logging, sys, pickle -import pytz +import pytz, glob import datetime as dtm import numpy as np import pandas as pd @@ -39,7 +39,7 @@ class EmisModel(Regional): def __init__(self, dacycle=None): super(EmisModel, self).__init__(dacycle) - self.name = 'fossil' + self.name = 'anthropogenic' def setup(self): """Set up the emission model. @@ -858,13 +858,16 @@ class EmisModel(Regional): emissions = self.get_emissions(time_profiles) # Also write the sum of all sectors - filename = self.write(emissions[:, :-1, :, :].sum(axis=1)) + varname = 'combustion' + filename = self.write(emissions[:, :-1, :, :].sum(axis=1), varname=varname) # Add cement as a sector with nc.Dataset(filename, 'r+') as ds: + ds[varname].comment = 'Surface CO2 emissions due to anthropogenic combustion of GNFR sectors A, B, C, F, G, H, I' ds.createVariable('cement', 'f4', ('time', 'latitude', 'longitude')) ds['cement'][:] = emissions[:, -1, :, :] - ds['cement'].long_name = 'Emissions from cement production' + ds['cement'].long_name = 'Emissions from the calination of cement' ds['cement'].units = 'umol m-2 s-1' + ds['cement'].comment = 'CO2 emissions from the calcination of cement. Taken from GridFED v2021.1 (https://doi.org/10.6084/m9.figshare.13333643) from the last available year)' return filename, self.name def get_yearly_emissions(self, species): @@ -1182,9 +1185,10 @@ class EmisModel(Regional): def add_non_ff_anthrop(self): """Get bunker and cement fuels""" year = self.dacycle['time.start'].year - if year > 2019: year = 2019 - filename = self.dacycle.dasystem['dir.ff.global'] + '/orig/GCP_Global_{}.nc' - filename = filename.format(year -1) # Get fluxes from last year + available_files = glob.glob(self.dacycle.dasystem['dir.GridFED'] + '/GCP_Global_*') + available_years = np.array([f.split('_')[-1].strip('.nc') for f in available_files], dtype=int) + closest_year = available_years[np.argmin(np.abs(available_years - year))] + filename = self.dacycle.dasystem['dir.GridFED'] + '/GCP_Global_{}.nc'.format(closest_year) # Select the correct spatial domain with nc.Dataset(filename) as ds: monthind = self.startdate.month -1 @@ -1234,22 +1238,22 @@ class EmisModel(Regional): savedict['dtype'] = 'float' for i, cat in enumerate(list(self.categories.keys())): savedict['name'] = cat - savedict['long_name'] = '{} CO2 emissions'.format(cat) + savedict['long_name'] = 'Surface CO2 emissions from GNFR sector {}'.format(cat) savedict['values'] = values[:, i, :, :] savedict['comment'] = self.categories[cat]['description'] f.add_data(savedict) # Add cement (non FF) - savedict['name'] = 'Cement' + savedict['name'] = 'cement' savedict['long_name'] = 'CO2 emissions due to calcination of cement' savedict['values'] = values[:, -1, :, :] - savedict['comment'] = 'CO2 emissions due to calcination of cement' + savedict['comment'] = 'CO2 emissions from the calcination of cement. Taken from GridFED v2021.1 (https://doi.org/10.6084/m9.figshare.13333643) from the last available year)' f.add_data(savedict) # Add the sum of all FF sectors - savedict['name'] = 'fossil' - savedict['long_name'] = 'Sum of all fossil fuel emissions of CO2' + savedict['name'] = 'combustion' + savedict['long_name'] = 'Sum of CO2 emissions from anthropogenic combustion emissions of GNFR sectors A, B, C, F, G, H, I.' savedict['values'] = values[:, :-1, :, :].sum(axis=1) - savedict['comment'] = 'CO2 emissions due to anthropogenic emissions of fossil fuels and biofuels' + savedict['comment'] = 'CO2 emissions from anthropogenic combustion from GNFR sectors A, B, C, F, G, H, I, includion biofuel portion' f.add_data(savedict) # Add the sum of all FF sectors