diff --git a/docs/extract.rst b/docs/extract.rst index ae0a436a..8dc8915e 100644 --- a/docs/extract.rst +++ b/docs/extract.rst @@ -577,7 +577,10 @@ The new datasets introduced are listed in the table below (only production datas hydrogen production, gaseous, 25 bar, from gasification of woody biomass in entrained flow gasifier, with CCS, at gasification plant CH hydrogen production, gaseous, 25 bar, from gasification of woody biomass in entrained flow gasifier, at gasification plant CH hydrogen production, gaseous, 30 bar, from hard coal gasification and reforming, at coal gasification plant RER - hydrogen production, gaseous, 200 bar, from PEM electrolysis, from grid electricity RER + hydrogen production, gaseous, 30 bar, from PEM electrolysis, from grid electricity RER + hydrogen production, gaseous, 20 bar, from AEC electrolysis, from grid electricity RER + hydrogen production, gaseous, 1 bar, from SOEC electrolysis, from grid electricity RER + hydrogen production, gaseous, 1 bar, from SOEC electrolysis, with steam input, from grid electricity RER hydrogen production, gaseous, 25 bar, from thermochemical water splitting, at solar tower RER hydrogen production, gaseous, 100 bar, from methane pyrolysis RER ======================================================================================================================================= =========== diff --git a/premise/activity_maps.py b/premise/activity_maps.py index 72bc6122..3cfa09d2 100644 --- a/premise/activity_maps.py +++ b/premise/activity_maps.py @@ -42,6 +42,60 @@ def get_mapping(filepath: Path, var: str) -> dict: return mapping +def act_fltr( + database: List[dict], + fltr: Union[str, List[str]] = None, + mask: Union[str, List[str]] = None, +) -> List[dict]: + """Filter `database` for activities matching field contents given by `fltr` excluding strings in `mask`. + `fltr`: string, list of strings or dictionary. + If a string is provided, it is used to match the name field from the start (*startswith*). + If a list is provided, all strings in the lists are used and results are joined (*or*). + A dict can be given in the form : to filter for in . + `mask`: used in the same way as `fltr`, but filters add up with each other (*and*). + `filter_exact` and `mask_exact`: boolean, set `True` to only allow for exact matches. + + :param database: A lice cycle inventory database + :type database: brightway2 database object + :param fltr: value(s) to filter with. + :type fltr: Union[str, lst, dict] + :param mask: value(s) to filter with. + :type mask: Union[str, lst, dict] + :return: list of activity data set names + :rtype: list + + """ + if fltr is None: + fltr = {} + if mask is None: + mask = {} + + # default field is name + if isinstance(fltr, (list, str)): + fltr = {"name": fltr} + if isinstance(mask, (list, str)): + mask = {"name": mask} + + assert len(fltr) > 0, "Filter dict must not be empty." + + # find `act` in `database` that match `fltr` + # and do not match `mask` + filters = [] + for field, value in fltr.items(): + if isinstance(value, list): + filters.extend([ws.either(*[ws.contains(field, v) for v in value])]) + else: + filters.append(ws.contains(field, value)) + + for field, value in mask.items(): + if isinstance(value, list): + filters.extend([ws.exclude(ws.contains(field, v)) for v in value]) + else: + filters.append(ws.exclude(ws.contains(field, value))) + + return list(ws.get_many(database, *filters)) + + class InventorySet: """ Hosts different filter sets to find equivalencies @@ -181,84 +235,13 @@ def generate_material_map(self) -> dict: """ return self.generate_sets_from_filters(self.materials_filters) - @staticmethod - def act_fltr( - database: List[dict], - fltr: Union[str, List[str]] = None, - mask: Union[str, List[str]] = None, - filter_exact: bool = False, - mask_exact: bool = False, - ) -> List[dict]: - """Filter `database` for activities matching field contents given by `fltr` excluding strings in `mask`. - `fltr`: string, list of strings or dictionary. - If a string is provided, it is used to match the name field from the start (*startswith*). - If a list is provided, all strings in the lists are used and results are joined (*or*). - A dict can be given in the form : to filter for in . - `mask`: used in the same way as `fltr`, but filters add up with each other (*and*). - `filter_exact` and `mask_exact`: boolean, set `True` to only allow for exact matches. - - :param database: A lice cycle inventory database - :type database: brightway2 database object - :param fltr: value(s) to filter with. - :type fltr: Union[str, lst, dict] - :param mask: value(s) to filter with. - :type mask: Union[str, lst, dict] - :param filter_exact: requires exact match when true. - :type filter_exact: bool - :param mask_exact: requires exact match when true. - :type mask_exact: bool - :return: list of activity data set names - :rtype: list - - """ - if fltr is None: - fltr = {} - if mask is None: - mask = {} - result = [] - - # default field is name - if isinstance(fltr, (list, str)): - fltr = {"name": fltr} - if isinstance(mask, (list, str)): - mask = {"name": mask} - - def like(item_a, item_b): - if filter_exact: - return item_a.lower() == item_b.lower() - return item_a.lower().startswith(item_b.lower()) - - def notlike(item_a, item_b): - if mask_exact: - return item_a.lower() != item_b.lower() - return item_b.lower() not in item_a.lower() - - assert len(fltr) > 0, "Filter dict must not be empty." - - # find `act` in `database` that match `fltr` - # and do not match `mask` - filters = [] - for field, value in fltr.items(): - if isinstance(value, list): - filters.extend([ws.either(*[ws.contains(field, v) for v in value])]) - else: - filters.append(ws.contains(field, value)) - - for field, value in mask.items(): - if isinstance(value, list): - filters.extend([ws.exclude(ws.contains(field, v)) for v in value]) - else: - filters.append(ws.exclude(ws.contains(field, value))) - - return list(ws.get_many(database, *filters)) - def generate_sets_from_filters(self, filtr: dict, database=None) -> dict: """ Generate a dictionary with sets of activity names for technologies from the filter specifications. - :param filtr: - :func:`activity_maps.InventorySet.act_fltr`. + :param filtr: + :func:`activity_maps.InventorySet.act_fltr`. :return: dictionary with the same keys as provided in filter and a set of activity data set names as values. :rtype: dict @@ -266,5 +249,5 @@ def generate_sets_from_filters(self, filtr: dict, database=None) -> dict: database = database or self.database - techs = {tech: self.act_fltr(database, **fltr) for tech, fltr in filtr.items()} + techs = {tech: act_fltr(database, fltr.get("fltr"), fltr.get("mask")) for tech, fltr in filtr.items()} return {tech: {act["name"] for act in actlst} for tech, actlst in techs.items()} diff --git a/premise/data/additional_inventories/lci-Carma-CCS.xlsx b/premise/data/additional_inventories/lci-Carma-CCS.xlsx index d1b05799..388de35a 100644 Binary files a/premise/data/additional_inventories/lci-Carma-CCS.xlsx and b/premise/data/additional_inventories/lci-Carma-CCS.xlsx differ diff --git a/premise/data/additional_inventories/lci-concentrating-solar-power.xlsx b/premise/data/additional_inventories/lci-concentrating-solar-power.xlsx new file mode 100644 index 00000000..6b385890 Binary files /dev/null and b/premise/data/additional_inventories/lci-concentrating-solar-power.xlsx differ diff --git a/premise/data/additional_inventories/lci-hydrogen-electrolysis.xlsx b/premise/data/additional_inventories/lci-hydrogen-electrolysis.xlsx index 8bc5ea6c..e07cff4c 100644 Binary files a/premise/data/additional_inventories/lci-hydrogen-electrolysis.xlsx and b/premise/data/additional_inventories/lci-hydrogen-electrolysis.xlsx differ diff --git a/premise/data/additional_inventories/lci-synfuels-from-FT-from-electrolysis.xlsx b/premise/data/additional_inventories/lci-synfuels-from-FT-from-electrolysis.xlsx index d32119a1..ce69f2af 100644 Binary files a/premise/data/additional_inventories/lci-synfuels-from-FT-from-electrolysis.xlsx and b/premise/data/additional_inventories/lci-synfuels-from-FT-from-electrolysis.xlsx differ diff --git a/premise/data/additional_inventories/lci-synfuels-from-methanol-from-cement-plant.xlsx b/premise/data/additional_inventories/lci-synfuels-from-methanol-from-cement-plant.xlsx index db850453..e16261d1 100644 Binary files a/premise/data/additional_inventories/lci-synfuels-from-methanol-from-cement-plant.xlsx and b/premise/data/additional_inventories/lci-synfuels-from-methanol-from-cement-plant.xlsx differ diff --git a/premise/data/additional_inventories/lci-synfuels-from-methanol-from-electrolysis.xlsx b/premise/data/additional_inventories/lci-synfuels-from-methanol-from-electrolysis.xlsx index 4c0ef8f0..74d8d69a 100644 Binary files a/premise/data/additional_inventories/lci-synfuels-from-methanol-from-electrolysis.xlsx and b/premise/data/additional_inventories/lci-synfuels-from-methanol-from-electrolysis.xlsx differ diff --git a/premise/data/additional_inventories/lci-syngas.xlsx b/premise/data/additional_inventories/lci-syngas.xlsx index 9811a407..5cf12691 100644 Binary files a/premise/data/additional_inventories/lci-syngas.xlsx and b/premise/data/additional_inventories/lci-syngas.xlsx differ diff --git a/premise/data/additional_inventories/migration_map.csv b/premise/data/additional_inventories/migration_map.csv index 0756f46a..191cd267 100644 --- a/premise/data/additional_inventories/migration_map.csv +++ b/premise/data/additional_inventories/migration_map.csv @@ -340,6 +340,8 @@ from;to;name_from;ref_prod_from;location_from;name_to;ref_prod_to;location_to 35;39;market for potassium fertiliser, as K2O;potassium fertiliser, as K2O;GLO;market group for inorganic potassium fertiliser, as K2O;inorganic potassium fertiliser, as K2O;RER 36;39;market for potassium fertiliser, as K2O;potassium fertiliser, as K2O;GLO;market group for inorganic potassium fertiliser, as K2O;inorganic potassium fertiliser, as K2O;RER 37;39;market for chemicals, inorganic;chemical, inorganic;GLO;market for chemical, inorganic;; +39;37;market for chemical, inorganic;chemical, inorganic;GLO;market for chemicals, inorganic;; +38;37;market for chemical, inorganic;chemical, inorganic;GLO;market for chemicals, inorganic;; 35;39;heat pump production, for heat and power co-generation unit, 160kW electrical;heat pump, for heat and power co-generation unit, 160kW electrical;RER;heat pump production, heat and power co-generation unit, 160kW electrical;heat pump, heat and power co-generation unit, 160kW electrical; 36;39;heat pump production, for heat and power co-generation unit, 160kW electrical;heat pump, for heat and power co-generation unit, 160kW electrical;RER;heat pump production, heat and power co-generation unit, 160kW electrical;heat pump, heat and power co-generation unit, 160kW electrical; 37;39;heat pump production, for heat and power co-generation unit, 160kW electrical;heat pump, for heat and power co-generation unit, 160kW electrical;RER;heat pump production, heat and power co-generation unit, 160kW electrical;heat pump, heat and power co-generation unit, 160kW electrical; diff --git a/premise/data/fuels/hydrogen_activities.yml b/premise/data/fuels/hydrogen_activities.yml index cecc3a30..53f5ad9f 100644 --- a/premise/data/fuels/hydrogen_activities.yml +++ b/premise/data/fuels/hydrogen_activities.yml @@ -1,5 +1,5 @@ from electrolysis: - name: hydrogen production, gaseous, 200 bar, from PEM electrolysis, from grid electricity + name: hydrogen production, gaseous, 30 bar, from PEM electrolysis, from grid electricity var: hydrogen, electrolysis feedstock name: electricity, low voltage feedstock unit: kilowatt hour diff --git a/premise/data_collection.py b/premise/data_collection.py index 82e06149..fccf534a 100644 --- a/premise/data_collection.py +++ b/premise/data_collection.py @@ -187,11 +187,13 @@ def get_vehicle_fleet_composition(model, vehicle_type) -> Union[xr.DataArray, No dataframe = pd.read_csv( FILEPATH_FLEET_COMP, sep=get_delimiter(filepath=FILEPATH_FLEET_COMP) ) - else: + elif model == "image": dataframe = pd.read_csv( FILEPATH_IMAGE_TRUCKS_FLEET_COMP, sep=get_delimiter(filepath=FILEPATH_FLEET_COMP), ) + else: + return None dataframe = dataframe.loc[~dataframe["region"].isnull()] @@ -215,7 +217,7 @@ def get_vehicle_fleet_composition(model, vehicle_type) -> Union[xr.DataArray, No return None -def fix_efficiencies(data: xr.DataArray) -> xr.DataArray: +def fix_efficiencies(data: xr.DataArray, min_year: int) -> xr.DataArray: """ Fix the efficiency data to ensure plausibility. @@ -244,7 +246,7 @@ def fix_efficiencies(data: xr.DataArray) -> xr.DataArray: # ensure that efficiency can not decrease over time while data.diff(dim="year").min().values < 0: diff = data.diff(dim="year") - diff = xr.concat([data.sel(year=2005), diff], dim="year") + diff = xr.concat([data.sel(year=min_year), diff], dim="year") diff.values[diff.values > 0] = 0 diff *= -1 data += diff @@ -301,6 +303,8 @@ def __init__( self.external_scenarios = external_scenarios self.system_model_args = system_model_args self.use_absolute_efficiency = use_absolute_efficiency + self.min_year = 2005 + self.max_year = 2100 key = key or None electricity_prod_vars = self.__get_iam_variable_labels( @@ -488,7 +492,11 @@ def __init__( data=data, ) - self.other_vars = self.__fetch_market_data(data=data, input_vars=other_vars) + self.other_vars = self.__fetch_market_data( + data=data, + input_vars=other_vars, + normalize=False, + ) self.electricity_efficiencies = self.get_iam_efficiencies( data=data, efficiency_labels=electricity_eff_vars @@ -661,8 +669,14 @@ def __get_iam_data( # remove any column that is a string # and that is not any of "Region", "Variable", "Unit" for col in dataframe.columns: - if isinstance(col, str) and col not in ["Region", "Variable", "Unit"]: - dataframe = dataframe.drop(col, axis=1) + if isinstance(col, str): + if col.lower() not in ["region", "variable", "unit"]: + dataframe = dataframe.drop(col, axis=1) + + # identify the lowest and highest column name that is numeric + # and consider it the minimum year + self.min_year = min([x for x in dataframe.columns if isinstance(x, int)]) + self.max_year = max([x for x in dataframe.columns if isinstance(x, int)]) dataframe = dataframe.reset_index() @@ -670,11 +684,12 @@ def __get_iam_data( if "index" in dataframe.columns: dataframe = dataframe.drop("index", axis=1) - dataframe = dataframe.loc[dataframe["Variable"].isin(variables)] + # convert all column names that are string to lower case + dataframe.columns = [x.lower() if isinstance(x, str) else x for x in dataframe.columns] - dataframe = dataframe.rename( - columns={"Region": "region", "Variable": "variables", "Unit": "unit"} - ) + dataframe = dataframe.loc[dataframe["variable"].isin(variables)] + + dataframe = dataframe.rename(columns={"variable": "variables"}) array = ( dataframe.melt( @@ -690,7 +705,7 @@ def __get_iam_data( return array def __fetch_market_data( - self, data: xr.DataArray, input_vars: dict + self, data: xr.DataArray, input_vars: dict, normalize: bool = True ) -> [xr.DataArray, None]: """ This method retrieves the market share for each technology, @@ -716,13 +731,15 @@ def __fetch_market_data( if available_vars: market_data = data.loc[ - :, [v for v in input_vars.values() if v in available_vars], : + :, available_vars, : ] else: return None + rev_input_vars = {v: k for k, v in input_vars.items()} + market_data.coords["variables"] = [ - k for k, v in input_vars.items() if v in available_vars + rev_input_vars[v] for v in market_data.variables.values ] if self.system_model == "consequential": @@ -730,9 +747,10 @@ def __fetch_market_data( market_data, self.year, self.system_model_args ) else: - market_data /= ( - data.loc[:, available_vars, :].groupby("region").sum(dim="variables") - ) + if normalize is True: + market_data /= ( + data.loc[:, available_vars, :].groupby("region").sum(dim="variables") + ) # back-fill nans market_data = market_data.bfill(dim="year") @@ -815,7 +833,7 @@ def get_iam_efficiencies( if not self.use_absolute_efficiency: eff_data /= eff_data.sel(year=2020) # fix efficiencies - eff_data = fix_efficiencies(eff_data) + eff_data = fix_efficiencies(eff_data, self.min_year) else: # if absolute efficiencies are used, we need to make sure that # the efficiency is not greater than 1 @@ -855,7 +873,7 @@ def __get_carbon_capture_rate( # if variable is missing, we assume that the rate is 0 # and that none of the CO2 emissions are captured - if dict_vars["cement - cco2"] not in data.variables.values.tolist(): + if dict_vars.get("cement - cco2") not in data.variables.values.tolist(): cement_rate = xr.DataArray( np.zeros((len(data.region), len(data.year))), coords=[data.region, data.year], @@ -868,7 +886,7 @@ def __get_carbon_capture_rate( cement_rate.coords["variables"] = "cement" - if dict_vars["steel - cco2"] not in data.variables.values.tolist(): + if dict_vars.get("steel - cco2") not in data.variables.values.tolist(): steel_rate = xr.DataArray( np.zeros((len(data.region), len(data.year))), coords=[data.region, data.year], diff --git a/premise/ecoinvent_modification.py b/premise/ecoinvent_modification.py index 97f608f8..3eff017b 100644 --- a/premise/ecoinvent_modification.py +++ b/premise/ecoinvent_modification.py @@ -133,6 +133,7 @@ FILEPATH_NUCLEAR_SMR = INVENTORY_DIR / "lci-nuclear_SMR.xlsx" FILEPATH_WAVE = INVENTORY_DIR / "lci-wave_energy.xlsx" FILEPATH_FUEL_CELL = INVENTORY_DIR / "lci-fuel_cell.xlsx" +FILEPATH_CSP = INVENTORY_DIR / "lci-concentrating-solar-power.xlsx" config = load_constants() @@ -673,6 +674,7 @@ def __import_inventories(self, keep_uncertainty_data: bool = False) -> List[dict (FILEPATH_NUCLEAR_SMR, "3.8"), (FILEPATH_WAVE, "3.8"), (FILEPATH_FUEL_CELL, "3.9"), + (FILEPATH_CSP, "3.9"), ] for filepath in filepaths: # make an exception for FILEPATH_OIL_GAS_INVENTORIES @@ -765,28 +767,29 @@ def update_electricity(self) -> None: use_absolute_efficiency=self.use_absolute_efficiency, ) + electricity.create_missing_power_plant_datasets() electricity.adjust_coal_power_plant_emissions() # datasets in 3.9 have been updated if self.version not in ["3.9", "3.9.1"]: - electricity.update_ng_production_ds() + electricity.update_ng_production_ds() electricity.update_efficiency_of_solar_pv() if scenario["iam data"].biomass_markets is not None: - electricity.create_biomass_markets() + electricity.create_biomass_markets() electricity.create_region_specific_power_plants() if scenario["iam data"].electricity_markets is not None: - electricity.update_electricity_markets() + electricity.update_electricity_markets() else: - print("No electricity markets found in IAM data. Skipping.") + print("No electricity markets found in IAM data. Skipping.") if scenario["iam data"].electricity_efficiencies is not None: - electricity.update_electricity_efficiency() + electricity.update_electricity_efficiency() else: - print("No electricity efficiencies found in IAM data. Skipping.") + print("No electricity efficiencies found in IAM data. Skipping.") scenario["database"] = electricity.database self.modified_datasets = electricity.modified_datasets diff --git a/premise/electricity.py b/premise/electricity.py index 5ee4b3f0..8db65cd2 100644 --- a/premise/electricity.py +++ b/premise/electricity.py @@ -20,6 +20,7 @@ import yaml from . import VARIABLES_DIR +from .activity_maps import act_fltr from .data_collection import get_delimiter from .export import biosphere_flows_dictionary from .transformation import ( @@ -39,6 +40,7 @@ LOSS_PER_COUNTRY = DATA_DIR / "electricity" / "losses_per_country.csv" IAM_BIOMASS_VARS = VARIABLES_DIR / "biomass_variables.yaml" +POWERPLANT_TECHS = VARIABLES_DIR / "electricity_variables.yaml" LOG_CONFIG = DATA_DIR / "utils" / "logging" / "logconfig.yaml" # directory for log files @@ -55,6 +57,19 @@ logger = logging.getLogger("electricity") +def load_electricity_variables() -> dict: + """ + Load the electricity variables from a YAML file. + :return: a dictionary with the electricity variables + :rtype: dict + """ + + with open(POWERPLANT_TECHS, "r", encoding="utf-8") as stream: + techs = yaml.full_load(stream) + + return techs + + def get_losses_per_country_dict() -> Dict[str, Dict[str, float]]: """ Create a dictionary with ISO country codes as keys and loss ratios as values. @@ -859,6 +874,7 @@ def create_new_markets_high_voltage(self) -> None: ["RER"], ["RoW"], ["CH"], + list(self.ecoinvent_to_iam_loc.keys()) ] tech_suppliers = defaultdict(list) @@ -904,7 +920,7 @@ def create_new_markets_high_voltage(self) -> None: if self.system_model == "consequential": continue else: - raise + raise IndexError(f"Couldn't find suppliers for {technology} when looking for {ecoinvent_technologies[technology]}.") if self.system_model == "consequential": periods = [ @@ -1583,6 +1599,7 @@ def create_region_specific_power_plants(self): "Coal PC CCS", "Coal CHP CCS", "Coal IGCC CCS", + "Coal SC", "Gas CHP CCS", "Gas CC CCS", "Oil CC CCS", @@ -1926,6 +1943,40 @@ def adjust_coal_power_plant_emissions(self) -> None: # self.write_log(dataset=dataset, status="updated") + def create_missing_power_plant_datasets(self) -> None: + """ + Create missing power plant datasets. + We use proxy datasets, copy them and rename them. + """ + for tech, vars in load_electricity_variables().items(): + if not vars.get("exists in database", True): + new_datasets = self.fetch_proxies( + name=vars["proxy"]["name"], + ref_prod=vars["proxy"]["reference product"], + empty_original_activity=False, + ) + + for loc, ds in new_datasets.items(): + ds["name"] = vars["proxy"]["new name"] + ds["code"] = str(uuid.uuid4().hex) + for e in ws.production(ds): + e["name"] = vars["proxy"]["new name"] + if "input" in e: + del e["input"] + + ds["comment"] = "This dataset is a proxy dataset for a power plant. " \ + "It is used to create missing power plant datasets." + + self.database.extend(new_datasets.values()) + + mapping = InventorySet(self.database) + self.powerplant_map = mapping.generate_powerplant_map() + # reverse dictionary of self.powerplant_map + self.powerplant_map_rev = {} + for k, v in self.powerplant_map.items(): + for pp in list(v): + self.powerplant_map_rev[pp] = k + def update_electricity_markets(self) -> None: """ Delete electricity markets. Create high, medium and low voltage market groups for electricity. diff --git a/premise/geomap.py b/premise/geomap.py index 5520925c..2920dec0 100644 --- a/premise/geomap.py +++ b/premise/geomap.py @@ -57,8 +57,6 @@ class Geomap: def __init__(self, model: str) -> None: self.model = model self.geo = geomatcher - self.additional_mappings = get_additional_mapping() - self.rev_additional_mappings = {} if model not in ["remind", "image"]: if "EXTRA_TOPOLOGY" in constants: @@ -75,10 +73,12 @@ def __init__(self, model: str) -> None: "REMIND or IMAGE." ) + self.additional_mappings = get_additional_mapping() + self.rev_additional_mappings = {} for key, val in self.additional_mappings.items(): if ( - self.model.upper(), - val[self.model], + self.model.upper(), + val[self.model], ) not in self.rev_additional_mappings: self.rev_additional_mappings[(self.model.upper(), val[self.model])] = [ key diff --git a/premise/iam_variables_mapping/MESSAGE_iso2_map.json b/premise/iam_variables_mapping/MESSAGE_iso2_map.json new file mode 100644 index 00000000..c8c2dbcf --- /dev/null +++ b/premise/iam_variables_mapping/MESSAGE_iso2_map.json @@ -0,0 +1,193 @@ +{ + "SAS": ["AF", "BD", "BT", "IN", "MV", "NP", "PK", "LK"], + "EEU": [ + "AL", + "BA", + "BG", + "HR", + "CZ", + "EE", + "HU", + "LV", + "LT", + "PL", + "RO", + "SK", + "SI", + "MK", + "XK", + "RS", + "ME" + ], + "MEA": [ + "DZ", + "BH", + "EG", + "IR", + "IQ", + "IL", + "JO", + "KW", + "LB", + "LY", + "MA", + "OM", + "QA", + "SA", + "SD", + "SY", + "TN", + "AE", + "YE", + "SS" + ], + "PAS": [ + "AS", + "BN", + "FJ", + "PF", + "KI", + "ID", + "MY", + "MM", + "NC", + "PG", + "PH", + "KR", + "SG", + "SB", + "TW", + "TH", + "TO", + "VU", + "WS" + ], + "WEU": [ + "AD", + "AT", + "BE", + "CY", + "DK", + "FO", + "FI", + "FR", + "DE", + "GI", + "GR", + "GL", + "IS", + "IE", + "IM", + "IT", + "LI", + "LU", + "MT", + "MC", + "NL", + "NO", + "PT", + "ES", + "SE", + "CH", + "TR", + "GB" + ], + "AFR": [ + "AO", + "BJ", + "BW", + "IO", + "BF", + "BI", + "CM", + "CV", + "CF", + "TD", + "KM", + "CG", + "CI", + "DJ", + "GQ", + "ER", + "ET", + "GA", + "GM", + "GH", + "GN", + "GW", + "KE", + "LS", + "LR", + "MG", + "MW", + "ML", + "MR", + "MU", + "MZ", + "NA", + "NE", + "NG", + "RE", + "RW", + "SH", + "ST", + "SN", + "SC", + "SL", + "SO", + "ZA", + "SZ", + "TZ", + "TG", + "UG", + "CD", + "ZM", + "ZW" + ], + "LAM": [ + "AG", + "AR", + "BS", + "BB", + "BZ", + "BM", + "BO", + "BR", + "CL", + "CO", + "CR", + "CU", + "DM", + "DO", + "EC", + "SV", + "GF", + "GD", + "GP", + "GT", + "GY", + "HT", + "HN", + "JM", + "MQ", + "MX", + "NI", + "PA", + "PY", + "PE", + "KN", + "VC", + "LC", + "SR", + "TT", + "UY", + "VE", + "CW" + ], + "FSU": ["AM", "AZ", "BY", "GE", "KZ", "KG", "MD", "RU", "TJ", "TM", "UA", "UZ"], + "PAO": ["AU", "JP", "NZ"], + "RCPA": ["KH", "KP", "LA", "MN", "VN"], + "NAM": ["CA", "GU", "PR", "US", "VI"], + "CHN": ["CN", "HK", "MO"], + "World": ["GLO", "RoW"] +} diff --git a/premise/iam_variables_mapping/biomass_variables.yaml b/premise/iam_variables_mapping/biomass_variables.yaml index 783baa63..3fa8acbc 100644 --- a/premise/iam_variables_mapping/biomass_variables.yaml +++ b/premise/iam_variables_mapping/biomass_variables.yaml @@ -2,17 +2,27 @@ # used in the IAMs regarding the origin of biomass # used in the production of electricity --- -biomass - purpose grown: +biomass crops - purpose grown: iam_aliases: image: Primary Energy|Biomass|Energy Crops + message: Primary Energy|Biomass|Energy Crops remind: SE|Electricity|Biomass|Energy Crops ecoinvent_aliases: name: - market for wood chips reference product: - wood chips +biomass wood - purpose grown: + iam_aliases: + message: Primary Energy|Biomass|Fuelwood + ecoinvent_aliases: + name: + - market for wood chips + reference product: + - wood chips biomass - residual: iam_aliases: + message: Primary Energy|Biomass|Residues image: Primary Energy|Biomass|Residues remind: SE|Electricity|Biomass|Residues ecoinvent_aliases: diff --git a/premise/iam_variables_mapping/carbon_capture_variables.yaml b/premise/iam_variables_mapping/carbon_capture_variables.yaml index 6dcdad8b..82fd3467 100644 --- a/premise/iam_variables_mapping/carbon_capture_variables.yaml +++ b/premise/iam_variables_mapping/carbon_capture_variables.yaml @@ -15,6 +15,10 @@ cement - co2: - Production|Industry|Cement|Efficient dry feed rotary kiln + On-site CCS - Production|Industry|Cement|Efficient dry feed rotary kiln + Oxy-combustion CCS - Production|Industry|Cement|Efficient dry feed rotary kiln + message: + - Carbon Sequestration|CCS|Industrial Processes + - Emissions|CO2|Industrial Processes|Non-Metallic Minerals|Cement + - Emissions|CO2|Energy|Demand|Industry|Non-Metallic Minerals|Cement cement - cco2: iam_aliases: remind: @@ -24,7 +28,8 @@ cement - cco2: - Production|Industry|Cement|Efficient dry feed rotary kiln + MEA CCS - Production|Industry|Cement|Efficient dry feed rotary kiln + On-site CCS - Production|Industry|Cement|Efficient dry feed rotary kiln + Oxy-combustion CCS - + message: + - CCS|Industry|Industrial Processes|Non-Metallic Minerals steel - co2: iam_aliases: remind: @@ -39,6 +44,8 @@ steel - co2: - Production|Industry|Iron and Steel|TGR BF/BOF BAT + CCS - Production|Industry|Iron and Steel|TGR BF/BOF BAT - Production|Industry|Iron and Steel|TGR BF/BOF +# message: +# - Emissions|CO2|Energy|Demand|Industry|Steel # not in the model currently steel - cco2: iam_aliases: remind: diff --git a/premise/iam_variables_mapping/cement_variables.yaml b/premise/iam_variables_mapping/cement_variables.yaml index 9f25b7cf..cbce28c8 100644 --- a/premise/iam_variables_mapping/cement_variables.yaml +++ b/premise/iam_variables_mapping/cement_variables.yaml @@ -5,6 +5,7 @@ cement, dry feed rotary kiln: iam_aliases: remind: Production|Industry|Cement image: Production|Industry|Cement|Dry feed rotary kiln + message: Production|Non-Metallic Minerals|Cement energy_use_aliases: remind: FE|Industry|+++|Cement image: @@ -16,6 +17,17 @@ cement, dry feed rotary kiln: - Final Energy|Industry|Cement|Dry feed rotary kiln|Oil - Final Energy|Industry|Cement|Dry feed rotary kiln|Secondary Heat - Final Energy|Industry|Cement|Dry feed rotary kiln|Traditional Biomass + message: + - Final Energy|Industry|Non-Metallic Minerals|Cement|Electricity + - Final Energy|Industry|Non-Metallic Minerals|Cement|Gases + - Final Energy|Industry|Non-Metallic Minerals|Cement|Heat + - Final Energy|Industry|Non-Metallic Minerals|Cement|Hydrogen + - Final Energy|Industry|Non-Metallic Minerals|Cement|Liquids|Biomass + - Final Energy|Industry|Non-Metallic Minerals|Cement|Liquids|Oil + - Final Energy|Industry|Non-Metallic Minerals|Cement|Liquids|Other + - Final Energy|Industry|Non-Metallic Minerals|Cement|Solar + - Final Energy|Industry|Non-Metallic Minerals|Cement|Solids|Biomass + - Final Energy|Industry|Non-Metallic Minerals|Cement|Solids|Coal eff_aliases: remind: FE|Industry|Specific Energy Consumption|Cement diff --git a/premise/iam_variables_mapping/constants.yaml b/premise/iam_variables_mapping/constants.yaml index 9801e467..a2f2dd08 100644 --- a/premise/iam_variables_mapping/constants.yaml +++ b/premise/iam_variables_mapping/constants.yaml @@ -12,7 +12,8 @@ SUPPORTED_EI_VERSIONS: SUPPORTED_MODELS: - remind - image - + - message + SUPPORTED_PATHWAYS: - SSP2-Base - SSP2-NDC @@ -46,6 +47,20 @@ LIST_TRANSF_FUNC: - update_external_scenario - update_emissions +LIST_MESSAGE_REGIONS: + - AFR + - CHN + - EEU + - FSU + - LAM + - MEA + - NAM + - PAO + - PAS + - RCPA + - SAS + - WEU + - World LIST_REMIND_REGIONS: - CAZ @@ -90,3 +105,6 @@ LIST_IMAGE_REGIONS: - WAF - WEU - World + +EXTRA_TOPOLOGY: + message: /Users/romain/GitHub/premise/premise/iam_variables_mapping/MESSAGE_iso2_map.json \ No newline at end of file diff --git a/premise/iam_variables_mapping/crops_variables.yaml b/premise/iam_variables_mapping/crops_variables.yaml index a8daf429..16fe6aed 100644 --- a/premise/iam_variables_mapping/crops_variables.yaml +++ b/premise/iam_variables_mapping/crops_variables.yaml @@ -10,6 +10,9 @@ sugar: remind: temperate: sugarbeet tropical: sugarcane + message: + temperate: sugarbeet + tropical: sugarcane land_use: image: Land Use|Marginal|Biomass|Sugar land_use_change: @@ -22,6 +25,9 @@ oil: remind: temperate: rapeseed tropical: palm oil + message: + temperate: rapeseed + tropical: palm oil land_use: image: Land Use|Marginal|Biomass|OilCrop land_use_change: @@ -34,6 +40,9 @@ wood: remind: temperate: poplar tropical: eucalyptus + message: + temperate: poplar + tropical: eucalyptus land_use: image: Land Use|Marginal|Biomass|Woody land_use_change: @@ -46,6 +55,9 @@ grass: remind: temperate: switchgrass tropical: miscanthus + message: + temperate: switchgrass + tropical: miscanthus land_use: image: Land Use|Marginal|Biomass|Grassy land_use_change: @@ -58,6 +70,9 @@ grain: remind: temperate: corn tropical: corn + message: + temperate: corn + tropical: corn land_use: image: Land Use|Marginal|Biomass|Maize land_use_change: diff --git a/premise/iam_variables_mapping/electricity_variables.yaml b/premise/iam_variables_mapping/electricity_variables.yaml index 6f05e55b..575cb352 100644 --- a/premise/iam_variables_mapping/electricity_variables.yaml +++ b/premise/iam_variables_mapping/electricity_variables.yaml @@ -23,24 +23,26 @@ Biomass CHP: ecoinvent_fuel_aliases: fltr: - market for wood chips, wet, measured as dry mass + Biomass CHP CCS: iam_aliases: image: Secondary Energy|Electricity|Biomass|w/ CCS|2 eff_aliases: image: Efficiency|Electricity|Biomass|w/ CCS|2 - ecoinvent_aliases: fltr: - electricity production, at co-generation wood-fired power plant, post, pipeline 200km, storage 1000m ecoinvent_fuel_aliases: fltr: - heat and power co-generation, wood chips, 6667 kW + Biomass ST: iam_aliases: + message: Secondary Energy|Electricity|Biomass|w/o CCS|2 image: Secondary Energy|Electricity|Biomass|w/o CCS|1 eff_aliases: + message: Efficiency|Electricity|Biomass|w/o CCS|2 image: Efficiency|Electricity|Biomass|w/o CCS|1 - ecoinvent_aliases: fltr: - electricity production, at wood burning power plant @@ -53,26 +55,30 @@ Biomass ST: Biomass IGCC CCS: iam_aliases: + message: Secondary Energy|Electricity|Biomass|w/ CCS|1 remind: SE|Electricity|Biomass|++|Gasification Combined Cycle w/ CC image: Secondary Energy|Electricity|Biomass|w/ CCS|1 eff_aliases: remind: Tech|Electricity|Biomass|Gasification Combined Cycle w/ CC|Efficiency image: Efficiency|Electricity|Biomass|w/ CCS|1 + message: Efficiency|Electricity|Biomass|w/o CCS|1 ecoinvent_aliases: fltr: - electricity production, at biomass-fired IGCC power plant, pre, pipeline 200km, storage 1000m - ecoinvent_fuel_aliases: fltr: - market for wood chips, wet, measured as dry mass - market for biomass, used as fuel + Biomass IGCC: iam_aliases: + message: Secondary Energy|Electricity|Biomass|w/o CCS|1 remind: SE|Electricity|Biomass|++|Gasification Combined Cycle w/o CC image: Secondary Energy|Electricity|Biomass|w/o CCS|2 eff_aliases: remind: Tech|Electricity|Biomass|Gasification Combined Cycle w/o CC|Efficiency image: Efficiency|Electricity|Biomass|w/o CCS|2 + message: Efficiency|Electricity|Biomass|w/o CCS|1 ecoinvent_aliases: fltr: - electricity production, at biomass-fired IGCC power plant @@ -82,20 +88,24 @@ Biomass IGCC: fltr: - market for wood chips, wet, measured as dry mass - market for biomass, used as fuel + Coal PC: iam_aliases: + message: Secondary Energy|Electricity|Coal|w/o CCS|3 remind: SE|Electricity|Coal|++|Pulverised Coal w/o CC image: Secondary Energy|Electricity|Coal|w/o CCS|1 eff_aliases: + message: Efficiency|Electricity|Coal|w/o CCS|3 remind: Tech|Electricity|Coal|Pulverised Coal w/o CC|Efficiency image: Efficiency|Electricity|Coal|w/o CCS|1 - ecoinvent_aliases: fltr: - electricity production, hard coal - electricity production, lignite mask: - name: mine + name: + - mine + - supercritical ecoinvent_fuel_aliases: fltr: - market for hard coal @@ -106,21 +116,22 @@ Coal PC: - plant - briquettes - ash + Coal IGCC: iam_aliases: + message: Secondary Energy|Electricity|Coal|w/o CCS|1 remind: SE|Electricity|Coal|++|Gasification Combined Cycle w/o CC image: Secondary Energy|Electricity|Coal|w/o CCS|2 eff_aliases: + message: Efficiency|Electricity|Coal|w/o CCS|1 remind: Tech|Electricity|Coal|Gasification Combined Cycle w/o CC|Efficiency image: Efficiency|Electricity|Coal|w/o CCS|2 - ecoinvent_aliases: fltr: - electricity production, at hard coal-fired IGCC power plant - electricity production, at lignite-fired IGCC power plant mask: name: pipeline - ecoinvent_fuel_aliases: fltr: - market for hard coal @@ -131,12 +142,14 @@ Coal IGCC: - plant - briquettes - ash + Coal PC CCS: iam_aliases: + message: Secondary Energy|Electricity|Coal|w/ CCS|2 remind: SE|Electricity|Coal|++|Pulverised Coal w/ CC eff_aliases: + message: Efficiency|Electricity|Coal|w/ CCS|2 remind: Tech|Electricity|Coal|Pulverised Coal w/ CC|Efficiency - ecoinvent_aliases: fltr: - electricity production, at hard coal-fired power plant, oxy, pipeline 200km, storage 1000m @@ -153,19 +166,20 @@ Coal PC CCS: - plant - briquettes - ash + Coal IGCC CCS: iam_aliases: + message: Secondary Energy|Electricity|Coal|w/ CCS|1 remind: SE|Electricity|Coal|++|Gasification Combined Cycle w/ CC image: Secondary Energy|Electricity|Coal|w/ CCS|1 eff_aliases: + message: Efficiency|Electricity|Coal|w/ CCS|1 remind: Tech|Electricity|Coal|Gasification Combined Cycle w/ CC|Efficiency image: Efficiency|Electricity|Coal|w/ CCS|1 - ecoinvent_aliases: fltr: - electricity production, at hard coal-fired IGCC power plant, pre, pipeline 200km, storage 1000m - electricity production, at lignite-fired IGCC power plant, pre, pipeline 200km, storage 1000m - ecoinvent_fuel_aliases: fltr: - market for hard coal @@ -176,6 +190,7 @@ Coal IGCC CCS: - plant - briquettes - ash + Coal CHP: iam_aliases: remind: SE|Electricity|Coal|++|Combined Heat and Power w/o CC @@ -183,7 +198,6 @@ Coal CHP: eff_aliases: remind: Tech|Electricity|Coal|Combined Heat and Power w/o CC|Efficiency image: Efficiency|Electricity|Coal|w/o CCS|3 - ecoinvent_aliases: fltr: - heat and power co-generation, hard coal @@ -200,27 +214,61 @@ Coal CHP: - plant - briquettes - ash + Coal CHP CCS: iam_aliases: image: Secondary Energy|Electricity|Coal|w/ CCS|2 eff_aliases: image: Efficiency|Electricity|Coal|w/ CCS|2 - ecoinvent_aliases: fltr: - electricity production, at co-generation hard coal-fired power plant, post, pipeline 200km, storage 1000m - ecoinvent_fuel_aliases: fltr: - heat and power co-generation, hard coal + +Coal SC: # super critical steam cycle + iam_aliases: + message: Secondary Energy|Electricity|Coal|w/o CCS|2 + eff_aliases: + message: Efficiency|Electricity|Coal|w/o CCS|2 + ecoinvent_aliases: + fltr: + - electricity production, hard coal, supercritical + ecoinvent_fuel_aliases: + fltr: + - market for hard coal + +Coal PCU: # sub critical steam cycle unfiltered + iam_aliases: + message: Secondary Energy|Electricity|Coal|w/o CCS|4 + eff_aliases: + message: Efficiency|Electricity|Coal|w/o CCS|4 + ecoinvent_aliases: + fltr: + - electricity production, hard coal, subcritical + ecoinvent_fuel_aliases: + fltr: + - market for hard coal + exists in database: False + proxy: + name: electricity production, hard coal + reference product: electricity, high voltage + mask: + name: + - mine + - supercritical + new name: electricity production, hard coal, subcritical + Gas OC: iam_aliases: + message: Secondary Energy|Electricity|Gas|w/o CCS|3 remind: SE|Electricity|Gas|++|Gas Turbine image: Secondary Energy|Electricity|Gas|w/o CCS|1 eff_aliases: + message: Efficiency|Electricity|Gas|w/o CCS|3 remind: Tech|Electricity|Gas|Gas Turbine|Efficiency image: Efficiency|Electricity|Gas|w/o CCS|1 - ecoinvent_fuel_aliases: fltr: - market for natural gas, high pressure @@ -235,18 +283,19 @@ Gas OC: - burned - vented - vehicle - ecoinvent_aliases: fltr: - electricity production, natural gas, conventional power plant + Gas CC: iam_aliases: + message: Secondary Energy|Electricity|Gas|w/o CCS|1 remind: SE|Electricity|Gas|++|Combined Cycle w/o CC image: Secondary Energy|Electricity|Gas|w/o CCS|2 eff_aliases: + message: Efficiency|Electricity|Gas|w/o CCS|1 remind: Tech|Electricity|Gas|Combined Cycle w/o CC|Efficiency image: Efficiency|Electricity|Gas|w/o CCS|2 - ecoinvent_aliases: fltr: - electricity production, natural gas, combined cycle power plant @@ -263,6 +312,7 @@ Gas CC: - burned - vented - vehicle + Gas CHP: iam_aliases: remind: SE|Electricity|Gas|++|Combined Heat and Power w/o CC @@ -270,7 +320,6 @@ Gas CHP: eff_aliases: remind: Tech|Electricity|Gas|Combined Heat and Power w/o CC|Efficiency image: Efficiency|Electricity|Gas|w/o CCS|3 - ecoinvent_aliases: fltr: - heat and power co-generation, natural gas, combined cycle power plant, 400MW electrical @@ -297,40 +346,64 @@ Gas CHP CCS: image: Secondary Energy|Electricity|Gas|w/ CCS|2 eff_aliases: image: Efficiency|Electricity|Gas|w/ CCS|2 - ecoinvent_aliases: fltr: - electricity production, at co-generation natural gas-fired power plant, post, pipeline 200km, storage 1000m - ecoinvent_fuel_aliases: fltr: - heat and power co-generation, natural gas, conventional power plant, 100MW electrical Gas CC CCS: iam_aliases: + message: Secondary Energy|Electricity|Gas|w/ CCS|1 remind: SE|Electricity|Gas|++|Combined Cycle w/ CC image: Secondary Energy|Electricity|Gas|w/ CCS|1 eff_aliases: + message: Efficiency|Electricity|Gas|w/ CCS|1 remind: Tech|Electricity|Gas|Combined Cycle w/ CC|Efficiency image: Efficiency|Electricity|Gas|w/ CCS|1 - ecoinvent_aliases: fltr: - electricity production, at natural gas-fired combined cycle power plant, post, pipeline 200km, storage 1000m + ecoinvent_fuel_aliases: + fltr: + - market group for natural gas + - market for natural gas +Gas ST: # ["Note": "Steam cycle sub cricitcal"] + iam_aliases: + message: Secondary Energy|Electricity|Gas|w/o CCS|2 + remind: SE|Electricity|Gas|++|Gas Turbine + image: Secondary Energy|Electricity|Gas|w/o CCS|1 + eff_aliases: + message: Efficiency|Electricity|Gas|w/o CCS|2 + remind: Tech|Electricity|Gas|Gas Turbine|Efficiency + image: Efficiency|Electricity|Gas|w/o CCS|1 + ecoinvent_aliases: + fltr: + - electricity production, natural gas, subcritical, steam cycle ecoinvent_fuel_aliases: fltr: - - market group for natural gas, high pressure + - market group for natural gas + - market for natural gas + exists in database: False + proxy: + name: electricity production, natural gas, conventional power plant + reference product: electricity, high voltage + new name: electricity production, natural gas, subcritical, steam cycle Geothermal: iam_aliases: + message: Secondary Energy|Electricity|Geothermal remind: SE|Electricity|+|Geothermal image: Secondary Energy|Electricity|Other ecoinvent_aliases: fltr: - electricity production, deep geothermal + Hydro: iam_aliases: + message: Secondary Energy|Electricity|Hydro remind: SE|Electricity|+|Hydro image: Secondary Energy|Electricity|Hydro ecoinvent_aliases: @@ -339,11 +412,14 @@ Hydro: - electricity production, hydro, run-of-river mask: name: renewable + Nuclear: iam_aliases: + message: Secondary Energy|Electricity|Nuclear remind: SE|Electricity|+|Nuclear image: Secondary Energy|Electricity|Nuclear eff_aliases: + message: Efficiency|Electricity|Nuclear image: Efficiency|Electricity|Nuclear ecoinvent_aliases: fltr: @@ -370,6 +446,7 @@ Nuclear_EPR: - market for nuclear fuel element, for pressure water reactor - market for nuclear fuel element, for boiling water reactor - market for uranium hexafluoride + Nuclear_SMR: ecoinvent_aliases: fltr: @@ -380,14 +457,16 @@ Nuclear_SMR: - market for nuclear fuel element, for pressure water reactor - market for nuclear fuel element, for boiling water reactor - market for uranium hexafluoride + Oil ST: iam_aliases: + message: Secondary Energy|Electricity|Oil|w/o CCS|2 remind: SE|Electricity|Oil|w/o CC image: Secondary Energy|Electricity|Oil|w/o CCS|1 eff_aliases: remind: Tech|Electricity|Oil|DOT|Efficiency image: Efficiency|Electricity|Oil|w/o CCS|1 - + message: Efficiency|Electricity|Oil|w/o CCS|2 ecoinvent_aliases: fltr: - electricity production, oil @@ -400,12 +479,14 @@ Oil ST: - market group for heavy fuel oil mask: name: burned + Oil CC: iam_aliases: + message: Secondary Energy|Electricity|Oil|w/o CCS|1 image: Secondary Energy|Electricity|Oil|w/o CCS|2 eff_aliases: + message: Efficiency|Electricity|Oil|w/o CCS|1 image: Efficiency|Electricity|Oil|w/o CCS|2 - ecoinvent_aliases: fltr: - electricity production, oil @@ -418,12 +499,12 @@ Oil CC: - market group for heavy fuel oil mask: name: burned + Oil CC CCS: iam_aliases: image: Secondary Energy|Electricity|Oil|w/ CCS|1 eff_aliases: image: Efficiency|Electricity|Oil|w/ CCS|1 - ecoinvent_aliases: fltr: - electricity production, at co-generation oil-fired power plant, post, pipeline 200km, storage 1000m @@ -434,12 +515,12 @@ Oil CC CCS: - heat and power co-generation, oil mask: name: burned + Oil CHP: iam_aliases: image: Secondary Energy|Electricity|Oil|w/o CCS|3 eff_aliases: image: Efficiency|Electricity|Oil|w/o CCS|3 - ecoinvent_aliases: fltr: - heat and power co-generation, oil @@ -452,16 +533,15 @@ Oil CHP: - market group for heavy fuel oil mask: name: burned + Oil CHP CCS: iam_aliases: image: Secondary Energy|Electricity|Oil|w/ CCS|2 eff_aliases: image: Efficiency|Electricity|Oil|w/ CCS|2 - ecoinvent_aliases: fltr: - electricity production, at co-generation oil-fired power plant, post, pipeline 200km, storage 1000m - mask: name: aluminium ecoinvent_fuel_aliases: @@ -469,29 +549,58 @@ Oil CHP CCS: - heat and power co-generation, oil mask: name: burned + +Foil ST: # ["Note": "Steam cycle fuel oil"] + iam_aliases: + message: Secondary Energy|Electricity|Oil|w/o CCS|3 + eff_aliases: + message: Efficiency|Electricity|Oil|w/o CCS|3 + ecoinvent_aliases: + fltr: + - electricity production, oil + ecoinvent_fuel_aliases: + fltr: + - market for heavy fuel oil + - market group for heavy fuel oil + mask: + name: burned + Solar CSP: iam_aliases: + message: Secondary Energy|Electricity|Solar|CSP|1 remind: SE|Electricity|Solar|+|CSP image: Secondary Energy|Electricity|Solar|CSP ecoinvent_aliases: fltr: - electricity production, solar thermal parabolic trough, 50 MW - electricity production, solar tower power plant, 20 MW + +Solar CSP autonomous: + iam_aliases: + message: Secondary Energy|Electricity|Solar|CSP|2 + ecoinvent_aliases: + fltr: + name: electricity production, at 110 MW concentrating solar power plant, with thermal energy storage + Solar PV Centralized: iam_aliases: + message: Secondary Energy|Electricity|Solar|PV remind: SE|Electricity|Solar|+|PV image: Secondary Energy|Electricity|Solar|PV|1 ecoinvent_aliases: fltr: - electricity production, photovoltaic, commercial + Solar PV Residential: iam_aliases: image: Secondary Energy|Electricity|Solar|PV|2 ecoinvent_aliases: fltr: - electricity production, photovoltaic, residential + Wind Onshore: iam_aliases: + message: Secondary Energy|Electricity|Wind|Onshore remind: SE|Electricity|Wind|+|Onshore image: Secondary Energy|Electricity|Wind|1 ecoinvent_aliases: @@ -503,8 +612,10 @@ Wind Onshore: name: - label-certified - renewable + Wind Offshore: iam_aliases: + message: Secondary Energy|Electricity|Wind|Offshore remind: SE|Electricity|Wind|+|Offshore image: Secondary Energy|Electricity|Wind|2 ecoinvent_aliases: @@ -514,6 +625,7 @@ Wind Offshore: name: - label-certified - renewable + Wave: ecoinvent_aliases: fltr: diff --git a/premise/iam_variables_mapping/fuels_variables.yaml b/premise/iam_variables_mapping/fuels_variables.yaml index 1be0df08..c7be27c9 100644 --- a/premise/iam_variables_mapping/fuels_variables.yaml +++ b/premise/iam_variables_mapping/fuels_variables.yaml @@ -244,6 +244,7 @@ diesel: iam_aliases: remind: SE|Liquids|Fossil|+|Oil image: Secondary Energy|Consumption|Liquids|Fossil + message: Secondary Energy|Liquids|Oil eff_aliases: remind: Tech|Liquids|Fossil|Oil|Efficiency ecoinvent_aliases: @@ -273,6 +274,7 @@ gasoline: iam_aliases: remind: SE|Liquids|Fossil|+|Oil image: Secondary Energy|Consumption|Liquids|Fossil + message: Secondary Energy|Liquids|Oil eff_aliases: remind: Tech|Liquids|Fossil|Oil|Efficiency ecoinvent_aliases: @@ -442,7 +444,7 @@ hydrogen, electrolysis: remind: Tech|Hydrogen|Electricity|Efficiency ecoinvent_aliases: fltr: - - hydrogen production, gaseous, 200 bar, from PEM electrolysis, from grid electricity + - hydrogen production, gaseous, 30 bar, from PEM electrolysis, from grid electricity hydrogen, solar: lhv: 120 diff --git a/premise/iam_variables_mapping/gains_regions_mapping.yaml b/premise/iam_variables_mapping/gains_regions_mapping.yaml index 24474364..4d03b9cf 100644 --- a/premise/iam_variables_mapping/gains_regions_mapping.yaml +++ b/premise/iam_variables_mapping/gains_regions_mapping.yaml @@ -1,77 +1,102 @@ # mapping between GAINS-IAM regions and IAM regions --- AFRI_EAST: + message: AFR remind: SSA image: EAF AFRI_NORT: + message: AFR remind: MEA image: NAF AFRI_WEST: + message: AFR remind: SSA image: WAF ASIA_STAN: + message: PAS remind: OAS image: STAN BRAZ_WHOL: + message: LAM remind: LAM image: BRA CANA_WHOL: + message: NAM remind: CAZ image: CAN CEAM_REST: + message: LAM remind: LAM image: RCAM CENT_EURO: + message: EEU remind: EUR image: CEU CHIN_PLUS: + message: CHN remind: CHA image: CHN INDI_WHOL: + message: SAS remind: IND image: INDIA INDO_PLUS: + message: PAS remind: OAS image: INDO JAPA_WHOL: + message: PAO remind: JPN image: JAP KORE_AALL: + message: PAS remind: OAS image: KOR LAME_REST: + message: LAM remind: LAM image: RSAM MEXI_WHOL: + message: LAM remind: LAM image: MEX MIDD_EAST: + message: MEA remind: MEA image: ME OCEA_WHOL: + message: PAO remind: CAZ image: OCE RUSS_PLUS: + message: FSU remind: REF image: RUS SAFR_WHOL: + message: AFR remind: SSA image: SAF SOEA_ASIA: + message: PAS remind: OAS image: SEAS SOUA_REST: + message: SAS remind: OAS image: RSAS TURK_WHOL: + message: WEU remind: MEA image: TUR UKRA_PLUS: + message: FSU remind: REF image: UKR USAM_WHOL: + message: NAM remind: USA image: USA WEST_EURO: + message: WEU remind: NEU image: WEU \ No newline at end of file diff --git a/premise/iam_variables_mapping/iam_region_to_climate.yaml b/premise/iam_variables_mapping/iam_region_to_climate.yaml index 968a605f..d8467bd7 100644 --- a/premise/iam_variables_mapping/iam_region_to_climate.yaml +++ b/premise/iam_variables_mapping/iam_region_to_climate.yaml @@ -40,4 +40,18 @@ remind: MEA: tropical NEU: temperate REF: temperate - USA: temperate \ No newline at end of file + USA: temperate + +message: + AFR: tropical + CHN: temperate + EEU: temperate + FSU: temperate + LAM: tropical + MEA: tropical + NAM: temperate + PAO: temperate + PAS: tropical + RCPA: tropical + SAS: tropical + WEU: temperate \ No newline at end of file diff --git a/premise/iam_variables_mapping/missing_geography_equivalences.yaml b/premise/iam_variables_mapping/missing_geography_equivalences.yaml index 1f4225e3..5ad9b9bc 100644 --- a/premise/iam_variables_mapping/missing_geography_equivalences.yaml +++ b/premise/iam_variables_mapping/missing_geography_equivalences.yaml @@ -5,129 +5,172 @@ Europe without Austria: remind: EUR image: WEU + message: WEU Europe without Switzerland and Austria: remind: EUR image: WEU + message: WEU Europe without Switzerland: remind: EUR image: WEU + message: WEU North America without Quebec: remind: USA image: USA + message: NAM RER w/o RU: remind: EUR image: WEU + message: WEU RER: remind: EUR image: WEU + message: WEU RoW: remind: World image: World + message: World GLO: remind: World image: World + message: World RNA: remind: USA image: USA + message: NAM SAS: remind: IND image: INDIA + message: SAS IAI Area, EU27 & EFTA: remind: EUR image: WEU + message: WEU UN-OCEANIA: remind: CAZ image: OCE + message: PAO UN-SEASIA: remind: OAS image: SEAS + message: PAS RAF: remind: SSA image: RSAF + message: AFR RAS: remind: CHA image: CHN + message: CHN IAI Area, Africa: remind: SSA image: RSAF + message: AFR RER w/o CH+DE: remind: EUR image: WEU + message: WEU RER w/o DE+NL+RU: remind: EUR image: WEU + message: WEU IAI Area, Asia, without China and GCC: remind: OAS image: SEAS + message: PAS Europe, without Russia and Turkey: remind: EUR image: WEU + message: WEU WECC: remind: USA image: USA + message: NAM WEU: remind: EUR image: WEU + message: WEU UCTE: remind: EUR image: WEU + message: WEU UCTE without Germany: remind: EUR image: WEU + message: WEU NORDEL: remind: NEU image: WEU + message: WEU ENTSO-E: remind: EUR image: WEU + message: WEU RLA: remind: LAM image: RSAM + message: LAM IAI Area, South America: remind: LAM image: RSAM + message: LAM IAI Area, Russia & RER w/o EU27 & EFTA: remind: REF image: RUS + message: FSU IAI Area, North America: remind: USA image: USA + message: NAM OCE: remind: CAZ image: OCE + message: PAO US-PR: remind: USA image: USA + message: NAM US only: remind: USA image: USA + message: NAM APAC: remind: OAS image: SEAS + message: PAS CN-NCGC: remind: CHA image: CHN + message: CHN CN-CSG: remind: CHA image: CHN + message: CHN CN-SWG: remind: CHA image: CHN + message: CHN CN-CCG: remind: CHA image: CHN + message: CHN CN-ECGC: remind: CHA image: CHN + message: CHN RoE: remind: EUR image: WEU + message: WEU CN-NWG: remind: CHA image: CHN + message: CHN BR-South-eastern/Mid-western grid: remind: LAM image: RSAM + message: LAM CN-NECG: remind: CHA - image: CHN \ No newline at end of file + image: CHN + message: CHN \ No newline at end of file diff --git a/premise/iam_variables_mapping/other_variables.yaml b/premise/iam_variables_mapping/other_variables.yaml index 3aa277d8..7932d65f 100644 --- a/premise/iam_variables_mapping/other_variables.yaml +++ b/premise/iam_variables_mapping/other_variables.yaml @@ -1,9 +1,12 @@ gdp: iam_aliases: + message: GDP|PPP remind: GDP|PPP image: GDP|PPP + population: iam_aliases: + message: Population remind: Population image: Population @@ -14,4 +17,5 @@ GMST: CO2: iam_aliases: remind: Emi|CO2 - image: Emissions|CO2 \ No newline at end of file + image: Emissions|CO2 + message: Emissions|CO2 \ No newline at end of file diff --git a/premise/iam_variables_mapping/steel_variables.yaml b/premise/iam_variables_mapping/steel_variables.yaml index e06c96b1..c03e8918 100644 --- a/premise/iam_variables_mapping/steel_variables.yaml +++ b/premise/iam_variables_mapping/steel_variables.yaml @@ -5,6 +5,7 @@ steel - primary: iam_aliases: remind: Production|Industry|Steel|Primary image: Production|Steel|Primary + message: Production|Primary|Steel energy_use_aliases: remind: - FE|Industry|Steel|++|Primary @@ -14,6 +15,18 @@ steel - primary: - Final Energy|Industry|Steel|Hydrogen - Final Energy|Industry|Steel|Liquids - Final Energy|Industry|Steel|Solids + message: + - Final Energy|Industry|Steel|Primary|Electricity + - Final Energy|Industry|Steel|Primary|Gases + - Final Energy|Industry|Steel|Primary|Heat + - Final Energy|Industry|Steel|Primary|Hydrogen + - Final Energy|Industry|Steel|Primary|Liquids|Biomass + - Final Energy|Industry|Steel|Primary|Liquids|Oil + - Final Energy|Industry|Steel|Primary|Liquids|Other + - Final Energy|Industry|Steel|Primary|Solar + - Final Energy|Industry|Steel|Primary|Solids|Biomass + - Final Energy|Industry|Steel|Primary|Solids|Coal + ecoinvent_aliases: fltr: - steel production, converter @@ -24,11 +37,16 @@ steel - secondary: iam_aliases: remind: Production|Industry|Steel|Secondary image: Production|Steel|Secondary + message: Production|Secondary|Steel energy_use_aliases: remind: - FE|Industry|Steel|++|Secondary image: - Final Energy|Industry|Steel|Electricity + message: + - Final Energy|Industry|Steel|Secondary|Electricity + - Final Energy|Industry|Steel|Secondary|Gases + ecoinvent_aliases: fltr: - steel production, electric diff --git a/premise/inventory_imports.py b/premise/inventory_imports.py index 063f539c..8191a009 100644 --- a/premise/inventory_imports.py +++ b/premise/inventory_imports.py @@ -559,6 +559,7 @@ def add_biosphere_links(self, delete_missing: bool = False) -> None: assert ( key in self.biosphere_dict ), f"Could not find a biosphere flow for {key}." + y["name"] = new_key[0] else: print(key) continue @@ -568,6 +569,7 @@ def add_biosphere_links(self, delete_missing: bool = False) -> None: self.biosphere_dict[key], ) + def lower_case_technosphere_exchanges(self) -> None: blakclist = [ "NOx", diff --git a/premise/transformation.py b/premise/transformation.py index ffdc22b5..e568555b 100644 --- a/premise/transformation.py +++ b/premise/transformation.py @@ -538,6 +538,7 @@ def fetch_proxies( relink=True, regions=None, delete_original_dataset=False, + empty_original_activity=True, ) -> Dict[str, dict]: """ Fetch dataset proxies, given a dataset `name` and `reference product`. @@ -552,6 +553,8 @@ def fetch_proxies( :param relink: if `relink`, exchanges from the datasets will be relinked to the most geographically-appropriate providers from the database. This is computer-intensive. :param regions: regions to create proxy datasets for. if None, all regions are considered. + :param delete_original_dataset: if True, delete original datasets from the database. + :param empty_original_activity: if True, empty original activities from exchanges. :return: dictionary with IAM regions as keys, proxy datasets as values. """ @@ -591,10 +594,10 @@ def fetch_proxies( if "input" in d_act[region]: del d_act[region]["input"] - if production_variable: + if production_variable is not None: # Add `production volume` field if isinstance(production_variable, str): - production_variable = [production_variable] + production_variable = [production_variable, ] if all( i in self.iam_data.production_volumes.variables @@ -640,13 +643,14 @@ def fetch_proxies( # empty original datasets # and make them link to new regional datasets - self.empty_original_datasets( - name=ds_name, - ref_prod=ds_ref_prod, - loc_map=d_iam_to_eco, - production_variable=production_variable, - regions=regions, - ) + if empty_original_activity is True: + self.empty_original_datasets( + name=ds_name, + ref_prod=ds_ref_prod, + loc_map=d_iam_to_eco, + production_variable=production_variable, + regions=regions, + ) if delete_original_dataset: # remove the dataset from `self.database`