diff --git a/config.yaml b/config.yaml index 88d65c53..dc373c61 100644 --- a/config.yaml +++ b/config.yaml @@ -10,7 +10,7 @@ scenario: lv: [1.0,1.25]#[1.0, 1.125, 1.25, 1.5, 2.0, opt]# or opt clusters: [128] #[90, 128, 181] #[45, 64, 90, 128, 181, 256] #, 362] # (2**np.r_[5.5:9:.5]).astype(int) minimum is 37 opts: [''] #for pypsa-eur - sector_opts: [Co2L0-3H-T-H-B-I,Co2L0-3H-T-H-B-I-onwind0,Co2L0p1-3H-T-H-B-I]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] + sector_opts: [Co2L0-3H-T-H-B-I,Co2L0-3H-T-H-B-I-onwind0,Co2L0p1-3H-T-H-B-I,Co2L0-3H-T-H-B-I-onwind0-solar2-offwind2]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] # Co2L will give default (5%); Co2L0p25 will give 25% CO2 emissions; Co2Lm0p05 will give 5% negative emissions diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index a24b8195..10f5d4f5 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1177,7 +1177,8 @@ def add_industry(network): def restrict_technology_potential(n,tech,limit): print("restricting potentials (p_nom_max) for {} to {} of technical potential".format(tech,limit)) - gens = n.generators.index[n.generators.carrier == tech] + gens = n.generators.index[n.generators.carrier.str.contains(tech)] + #beware if limit is 0 and p_nom_max is np.inf, 0*np.inf is nan n.generators.loc[gens,"p_nom_max"] *=limit @@ -1261,9 +1262,10 @@ if __name__ == "__main__": # if 'Ep' in opts: # add_emission_prices(n) - if "onwind" in o: - limit = o[o.find("onwind")+6:] - limit = float(limit.replace("p",".").replace("m","-")) - restrict_technology_potential(n,"onwind",limit) + for tech in ["solar","onwind","offwind"]: + if tech in o: + limit = o[o.find(tech)+len(tech):] + limit = float(limit.replace("p",".").replace("m","-")) + restrict_technology_potential(n,tech,limit) n.export_to_netcdf(snakemake.output[0])