diff --git a/scripts/base_network.py b/scripts/base_network.py index 870fcf19..b811f625 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -272,14 +272,15 @@ def _add_links_from_tyndp(buses, links, links_tyndp, europe_shape): if links_tyndp.empty: return buses, links - tree = spatial.KDTree(buses[["x", "y"]]) + tree_buses = buses.query("carrier=='AC'") + tree = spatial.KDTree(tree_buses[["x", "y"]]) _, ind0 = tree.query(links_tyndp[["x1", "y1"]]) - ind0_b = ind0 < len(buses) - links_tyndp.loc[ind0_b, "bus0"] = buses.index[ind0[ind0_b]] + ind0_b = ind0 < len(tree_buses) + links_tyndp.loc[ind0_b, "bus0"] = tree_buses.index[ind0[ind0_b]] _, ind1 = tree.query(links_tyndp[["x2", "y2"]]) - ind1_b = ind1 < len(buses) - links_tyndp.loc[ind1_b, "bus1"] = buses.index[ind1[ind1_b]] + ind1_b = ind1 < len(tree_buses) + links_tyndp.loc[ind1_b, "bus1"] = tree_buses.index[ind1[ind1_b]] links_tyndp_located_b = ( links_tyndp["bus0"].notnull() & links_tyndp["bus1"].notnull() diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py index 8d983ce9..39fbba03 100644 --- a/scripts/plot_summary.py +++ b/scripts/plot_summary.py @@ -477,9 +477,10 @@ def plot_carbon_budget_distribution(input_eurostat, options): ) emissions = historical_emissions(countries) # add other years https://sdi.eea.europa.eu/data/0569441f-2853-4664-a7cd-db969ef54de0 - emissions.loc[2019] = 2.971372 - emissions.loc[2020] = 2.691958 - emissions.loc[2021] = 2.869355 + emissions.loc[2019] = 3.414362 + emissions.loc[2020] = 3.092434 + emissions.loc[2021] = 3.290418 + emissions.loc[2022] = 3.213025 if snakemake.config["foresight"] == "myopic": path_cb = "results/" + snakemake.params.RDIR + "/csvs/"