Skip to content

Commit

Permalink
Merge pull request #75 from pypsa-meets-africa/adapt_for_15nodes
Browse files Browse the repository at this point in the history
Adapt for 15nodes
  • Loading branch information
energyLS authored Apr 7, 2022
2 parents 916054c + 116879f commit 3ee93d4
Show file tree
Hide file tree
Showing 13 changed files with 26,376 additions and 28 deletions.
34 changes: 17 additions & 17 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ rule prepare_sector_network:
network='networks/elec_s{simpl}_{clusters}.nc',
costs=CDIR + "costs_{planning_horizons}.csv",
h2_cavern="data/hydrogen_salt_cavern_potentials.csv",
nodal_energy_totals='resources/nodal_energy_totals.csv',
transport='resources/transport.csv',
avail_profile='resources/avail_profile.csv',
dsm_profile='resources/dsm_profile.csv',
nodal_transport_data='resources/nodal_transport_data.csv',
nodal_energy_totals='resources/nodal_energy_totals_{simpl}_{clusters}.csv',
transport='resources/transport_{simpl}_{clusters}.csv',
avail_profile='resources/avail_profile_{simpl}_{clusters}.csv',
dsm_profile='resources/dsm_profile_{simpl}_{clusters}.csv',
nodal_transport_data='resources/nodal_transport_data_{simpl}_{clusters}.csv',
overrides="data/override_component_attrs",

output: RDIR + '/prenetworks/elec_s{simpl}_{clusters}_{planning_horizons}.nc'
Expand All @@ -47,25 +47,25 @@ rule prepare_sector_network:

rule prepare_transport_data:
input:
network='networks/elec_s_4.nc', # hardcoded wildcards temporary
# network='networks/elec_s{simpl}_{clusters}.nc',
#network='networks/elec_s_4.nc', # hardcoded wildcards temporary
network='networks/elec_s{simpl}_{clusters}.nc',
energy_totals_name='resources/energy_totals.csv',
traffic_data_KFZ = "data/emobility/KFZ__count",
traffic_data_Pkw = "data/emobility/Pkw__count",
transport_name='resources/transport_data.csv',
clustered_pop_layout="resources/pop_layout_elec_s_4.csv", # hardcoded wildcards temporary
# clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
#clustered_pop_layout="resources/pop_layout_elec_s_4.csv", # hardcoded wildcards temporary
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
# This is probably still dummy data, investigate and use real data TODO
temp_air_total="resources/temp_air_total_elec_s_4.nc", # hardcoded wildcards temporary
# temp_air_total="resources/temp_air_total_elec_s{simpl}_{clusters}.nc",
#temp_air_total="resources/temp_air_total_elec_s_4.nc", # hardcoded wildcards temporary
temp_air_total="resources/temp_air_total_elec_s{simpl}_{clusters}.nc",

output:
nodal_energy_totals='resources/nodal_energy_totals.csv',
transport='resources/transport.csv',
avail_profile='resources/avail_profile.csv',
dsm_profile='resources/dsm_profile.csv',
nodal_transport_data='resources/nodal_transport_data.csv',
# dummy_wildcard="resources/dummy{simpl}_{clusters}.nc"
nodal_energy_totals='resources/nodal_energy_totals_{simpl}_{clusters}.csv',
transport='resources/transport_{simpl}_{clusters}.csv',
avail_profile='resources/avail_profile_{simpl}_{clusters}.csv',
dsm_profile='resources/dsm_profile_{simpl}_{clusters}.csv',
nodal_transport_data='resources/nodal_transport_data_{simpl}_{clusters}.csv',
#dummy_wildcard="resources/dummy{simpl}_{clusters}.nc"

script: "scripts/prepare_transport_data.py"

Expand Down
7 changes: 4 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ logging_level: INFO
results_dir: results/
summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data
run: MVP_test3
run: Test_01April

foresight: overnight

Expand All @@ -13,7 +13,7 @@ scenario:
simpl: # only relevant for PyPSA-Eur
- ''
clusters: # number of nodes in Europe, any integer between 37 (1 node per country-zone) and several hundred
- 4
- 15
planning_horizons: # investment years for myopic and perfect; or costs year for overnight
- 2030

Expand Down Expand Up @@ -102,7 +102,7 @@ snapshots:
closed: left # end is not inclusive

atlite:
cutout: /cutouts/africa-2013-era5.nc
cutout: cutouts/africa-2013-era5.nc

solving:
#tmpdir: "path/to/tmp"
Expand Down Expand Up @@ -310,6 +310,7 @@ plotting:
process emissions to atmosphere: '#888888'
process emissions: '#222222'
oil emissions: '#666666'
industry oil emissions: '#666666'
land transport oil emissions: '#666666'
land transport fuel cell: '#AAAAAA'
biogas: '#800000'
Expand Down
8,761 changes: 8,761 additions & 0 deletions resources/avail_profile__15.csv

Large diffs are not rendered by default.

8,761 changes: 8,761 additions & 0 deletions resources/dsm_profile__15.csv

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions resources/nodal_energy_totals__15.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name,total residential space,electricity residential space,total residential water,electricity residential water,total residential cooking,electricity residential cooking,total residential,electricity residential,derived heat residential,thermal uses residential,total services space,electricity services space,total services water,electricity services water,total services cooking,electricity services cooking,total services,electricity services,derived heat services,thermal uses services,total agriculture electricity,total agriculture heat,total agriculture machinery,total agriculture,total road,electricity road,total two-wheel,total passenger cars,electricity passenger cars,total other road passenger,electricity other road passenger,total light duty road freight,electricity light duty road freight,total heavy duty road freight,total rail,electricity rail,total rail passenger,electricity rail passenger,total rail freight,electricity rail freight,total aviation passenger,total aviation freight,total domestic aviation passenger,total international aviation passenger,total domestic aviation freight,total international aviation freight,total domestic aviation,total international aviation,total domestic navigation,district heat share,total international navigation
MAR.10_1,2.846710776523009,0.4894566611863687,1.4010917195157515,0.3060745681825454,0.6999075076330443,0.3247636759691357,6.61396092780989,2.840071471602159,0.0,5.010626060966941,1.5721478522235521,0.3677922667614348,0.4884168654229803,0.2618155210444157,0.6304654149902479,0.47596871019407433,4.451161166096946,2.8795070413007933,0.0,3.0226286962593463,0.12113765495705804,0.5434159612848767,0.3245231501983659,0.9890767664403005,11.758648116317183,5.998909631529087e-05,0.19744372720081238,6.888751964265812,5.998909631529087e-05,0.41114407362712047,0.0,0.8134999246297804,0.0,3.44780842659366,0.3751761290953585,0.15991671728406875,0.2623169713231214,0.14169531346563524,0.11285915777223718,0.01822140381843353,2.3319247173809687,0.03812123330371837,0.8690260313014632,1.4628986860795055,0.014204021165332249,0.023917212138386112,0.8832300524667953,1.4868158982178916,0.34064285543351586,0.0,3.513284289189849
MAR.11_1,3.206460540453615,0.5513111775524909,1.5781530562338284,0.3447543858011524,0.7883575049846497,0.3658053078506273,7.449792548657598,3.19898220109427,0.0,5.643838102542543,1.7708262087906481,0.4142715867661656,0.5501399788086874,0.2949021530499822,0.710139748638635,0.5361187024387429,5.01367148218754,3.2434013950537715,0.0,3.404609882720909,0.13644628523074423,0.6120895214514402,0.365534385915285,1.1140701925974694,13.244633597833129,6.757014860055167e-05,0.22239544861763583,7.759309982789931,6.757014860055167e-05,0.46310192781049536,0.0,0.9163050315822268,0.0,3.8835212070328424,0.42258857611581296,0.1801260064629887,0.29546697352452056,0.15960189392675134,0.12712160259129243,0.02052411253623738,2.626618991734473,0.042938759831125814,0.9788481854129896,1.6477708063214835,0.015999037822182392,0.02693972200894341,0.9948472232351718,1.6747105283304269,0.38369120015385083,0.0,3.957271505622456
MAR.12_1,9.042330307694742,1.554716706118742,4.450446537709596,0.9722193652816424,2.2231955986000784,1.031583698025297,21.008674237180912,9.021241130458003,0.0,15.915819852603944,4.993791532872753,1.1682602911753128,1.551413884903942,0.8316343340844747,2.0026188037559436,1.5118733976055776,14.138728053642497,9.146504803194969,0.0,9.60111834841077,0.3847832726298813,1.7261137509771873,1.0308196887396506,3.141716712346719,37.350327654135384,0.00019055017046920193,0.6271629043793336,21.88152417252388,0.00019055017046920193,1.305963552197745,0.0,2.5840120761308385,0.0,10.951664948903595,1.191714490569406,0.5079616065426094,0.8332271474782121,0.4500828949590568,0.35848734309119384,0.05787871158355257,7.407156962039904,0.12108879697639652,2.760385946411717,4.646771015628188,0.045117843419026825,0.07597095355736969,2.8055037898307433,4.722741969185557,1.082022536742683,0.0,11.159643357408838
MAR.13_1,2.1050847705468128,0.3619432545812011,1.0360788546612705,0.22633592335633632,0.5175673789064289,0.24015613877868133,4.890889702230251,2.1001751394767507,0.0,3.7052561499519863,1.1625713887260198,0.27197490727528045,0.36117434674411425,0.1936072573963937,0.4662163625464885,0.3519691889142841,3.2915432292158386,2.1293369418892274,0.0,2.235172497321625,0.08957883417342534,0.4018450604841781,0.2399782748589789,0.7314021695165823,8.695281331710024,4.436071767235397e-05,0.14600562396369954,5.094092089594896,4.436071767235397e-05,0.30403268748999773,0.0,0.6015666629367851,0.0,2.5495842677246485,0.2774351234219809,0.11825516272563015,0.19397806968740527,0.10478080488341264,0.08345705373457568,0.01347435784221753,1.7244109409021589,0.028189877357381363,0.6426270904611731,1.081783850440986,0.01050358500844486,0.017686292348936497,0.6531306754696178,1.0994701427899223,0.2518984693079788,0.0,2.5980023375638344
MAR.14_1,6.248566708106451,1.0743636562494892,3.07541431527615,0.6718376073594258,1.536305966527209,0.7128604389314259,14.517729164150547,6.233993348552144,0.0,10.998388543556185,3.450884723043008,0.807308748235925,1.0720812911971902,0.5746884305759599,1.383879681494134,1.0447574306272422,9.770355915419376,6.320554930419295,0.0,6.63470880082949,0.26589870811789557,1.1928050128386125,0.7123324817760771,2.171036202732585,25.810383604090845,0.00013167683671151063,0.4333915165130849,15.120899017668913,0.00013167683671151063,0.9024665209718146,0.0,1.7856427804363804,0.0,7.567983768500656,0.8235164208725357,0.3510192478743465,0.5757891203766702,0.31102303251807706,0.2477273004958657,0.03999621535626952,5.118604698098135,0.08367659660336701,1.9075232975724492,3.211081400525687,0.031178008846877006,0.052498587756489995,1.938701306419326,3.2635799882821765,0.7477154417548473,0.0,7.711704127652425
MAR.15_1,2.404270749718548,0.4133845782473984,1.1833319586540576,0.2585040031403701,0.5911268408397578,0.2742884219721695,5.586009274162081,2.3986633354524742,0.0,4.231867099219137,1.3278022925640103,0.31062944512658036,0.41250638908950665,0.22112376299718617,0.5324775416144096,0.4019929446779287,3.7593550711889443,2.431969770200552,0.0,2.5528472444792873,0.10231026028519996,0.45895744359502755,0.2740852790747651,0.8353529829549925,9.931101520901557,5.066550165980193e-05,0.16675672918347303,5.818091878648781,5.066550165980193e-05,0.3472434496310781,0.0,0.6870645552810748,0.0,2.9119449081571513,0.31686569658416075,0.1350622230146988,0.22154727712706304,0.11967281690405122,0.09531841945709774,0.015389406110647609,1.9694935062537915,0.03219637447232105,0.7339607117917606,1.2355327944620311,0.011996411050195587,0.020199963422125454,0.745957122841956,1.2557327578841564,0.2876996357247557,0.0,2.9672444147142887
MAR.1_1,13.376705794200369,2.299958889289976,6.583735824945343,1.4382456705579336,3.288868293179628,1.5260658658791695,31.079029944064395,13.345507672727463,0.0,23.544952727573342,7.387529304914084,1.728257393207647,2.2950728846675146,1.2302722237360795,2.962559610654856,2.236578951405704,20.91602485665,13.53081557897343,0.0,14.203344831663442,0.5692263451291382,2.5535138651700042,1.5249356342806364,4.647675844579778,55.25393646825645,0.00028188901341418357,0.9277888963843167,32.37027416875655,0.00028188901341418357,1.9319677142110234,0.0,3.8226395337105616,0.0,16.201266155194006,1.7629541930653467,0.7514493205017783,1.232628540684041,0.6658268680746958,0.5303256523813059,0.08562245242708252,10.957723958430707,0.17913183405261607,4.083556940203009,6.874167018227698,0.066744754609499,0.11238707944311706,4.150301694812509,6.9865540976708145,1.6006821963122042,0.0,16.508937506212135
MAR.2_1,2.6433814312677253,0.45449669852679114,1.3010172531101074,0.2842128665790325,0.6499158694097525,0.3015670849623887,6.141551733280415,2.6372163457630666,0.0,4.652736764766698,1.459855519587093,0.34152231288789814,0.453531171281832,0.243115068961028,0.5854337520994212,0.4419721387812353,4.13323224511479,2.6738351879484172,0.0,2.8067342264632584,0.11248526909780214,0.5046018982193339,0.30134373900064304,0.918430906317779,10.918774166952268,5.57043113006564e-05,0.18334109896488787,6.3967155276626455,5.57043113006564e-05,0.38177767083494807,0.0,0.7553948271944074,0.0,3.201545042295381,0.34837877500041775,0.14849449564887374,0.2435807026201852,0.13157457498025266,0.10479807238023256,0.01691992066862108,2.1653645139770905,0.03539838366549966,0.806954922634026,1.3584095913430645,0.013189483844801663,0.022208899820697993,0.8201444064788276,1.3806184911637625,0.3163120771428653,0.0,3.262344221759057
MAR.3_1,8.626952512993212,1.4832976388210477,4.246006243519307,0.9275584955528341,2.121068596653378,0.9841958071880025,20.04359814757854,8.606832109914746,0.0,15.184694365447646,4.7643915835744295,1.1145938836373332,1.4801465394020474,0.7934315230904853,1.91062444455585,1.442422424637812,13.489236884998832,8.726341541613488,0.0,9.160071490961034,0.3671074720580943,1.6468212125620894,0.9834668942195004,2.9973955788396838,35.63456454834041,0.00018179686165431123,0.5983529034973697,20.87635194963387,0.00018179686165431123,1.2459714658866694,0.0,2.4653102369874516,0.0,10.448577992335053,1.1369706667803834,0.4846273592038271,0.7949511673682593,0.4294074237056033,0.3420194994121242,0.05521993549822383,7.06689417366532,0.1155263373294275,2.633582015574345,4.433312158090975,0.04304526371187585,0.07248107361755163,2.6766272792862202,4.505793231708527,1.0323176354798895,0.0,10.647002490539439
MAR.4_1,2.598392728337788,0.4467614482481913,1.2788747510804916,0.2793757408914022,0.6388547067517758,0.2964346013040187,6.037026354086506,2.5923325687424303,0.0,4.573550087564043,1.4350096893506916,0.335709816175651,0.445812353674613,0.23897740215066776,0.5754700348519529,0.43445004869626325,4.062887210752219,2.6283281810778516,0.0,2.7589653608640603,0.11057083998985152,0.49601388869927565,0.2962150565512113,0.9027997852403384,10.732943442129285,5.475625867254207e-05,0.18022074783484912,6.287847419868108,5.475625867254207e-05,0.37528005304308826,0.0,0.7425384784762572,0.0,3.1470567429069853,0.34244958558030714,0.14596721196879045,0.23943511101542403,0.12933525779473376,0.10301447456488312,0.01663195417405671,2.1285113607764097,0.03479592525821511,0.7932210532564151,1.3352903075199947,0.01296500705780675,0.02183091820040835,0.8061860603142218,1.3571212257204028,0.3109286429160057,0.0,3.2068211582647623
MAR.5_1,2.4404882130785364,0.4196117225147452,1.2011574393576239,0.2623980567793967,0.6000314597150345,0.2784202490028852,5.6701558230643645,2.4347963298229574,0.0,4.295615115796825,1.3478040460628102,0.31530870620760565,0.41872030448749553,0.22445472802486072,0.5404986789408501,0.4080484876098348,3.815985259184165,2.4686044861763414,0.0,2.591302835036798,0.10385144199431648,0.46587108857413095,0.2782140460006883,0.8479365765691357,10.080701687812743,5.142871684685777e-05,0.16926871986918968,5.905734474419111,5.142871684685777e-05,0.35247425689996903,0.0,0.6974143610838331,0.0,2.9558098755406426,0.32163889933489814,0.13709677387130517,0.2248846218885854,0.12147554476318126,0.09675427744631279,0.015621229108123916,1.999161570430354,0.03268137434719465,0.7450169521050035,1.2541446183253506,0.012177122635075404,0.020504251712119243,0.7571940747400788,1.2746488700374696,0.2920334866509724,0.0,3.0119424030263895
MAR.6_1,0.5756768835658268,0.09898051030546133,0.2833361651392878,0.061896015219816546,0.14153899163252753,0.06567542527296956,1.3375100998487288,0.5743342482698919,0.0,1.0132752576341149,0.31792803945408027,0.07437689408948028,0.09877023731617525,0.0529457170243702,0.1274960450112618,0.09625290564081869,0.9001373126769453,0.5823091173900633,0.0,0.6112519341232607,0.02449709617965749,0.10989244487088388,0.0656267848816534,0.20001632593219476,2.3778959065228884,1.2131311793078374e-05,0.039928112996928555,1.393079794108988,1.2131311793078374e-05,0.08314372536689854,0.0,0.16451024995377564,0.0,0.6972340240962981,0.07587009771667284,0.032339202912848496,0.05304712294733547,0.028654374425564524,0.02282297476933738,0.0036848284872839756,0.47157412866917814,0.007709077074831884,0.17573903241700164,0.2958350962521765,0.002872412155810526,0.0048366649190213565,0.17861144457281214,0.30067176117119787,0.06888659678467546,0.0,0.7104748987362559
MAR.8_1,9.580524457292862,1.6472525245463796,4.715334482320099,1.0300852866443375,2.3555188851715347,1.0929829493472218,22.259098097017333,9.558180064705386,0.0,16.863120032894837,5.291019050099994,1.2377944524504547,1.6437531213671428,0.8811327175739957,2.1218134900128107,1.6018592076607507,14.980256781558337,9.690899357125568,0.0,10.172571231559337,0.4076853453418674,1.8288510200997554,1.0921734666809555,3.3287098321225783,39.573397056048584,0.00020189160386764566,0.6644912693578492,23.183899544049595,0.00020189160386764566,1.3836937300903942,0.0,2.7378109459510513,0.0,11.603501566599698,1.2626446319147147,0.5381951808048827,0.8828203342784662,0.4768715625545126,0.3798242976362487,0.06132361825037022,7.848026561631116,0.12829593052460522,2.9246824846312327,4.923344076999884,0.047803230763253886,0.08049269976135133,2.972485715394486,5.003836776761235,1.1464238779005786,0.0,11.823858726919061
MAR.9_1,14.676765032886449,2.5234879740005027,7.2235978893408745,1.5780263161276207,3.6085077974904496,1.674381606563237,34.0995478974233,14.64253481915746,0.0,25.83324655632601,8.105510687750638,1.8962237838448148,2.518127106915831,1.3498402844510284,3.25048573022758,2.453948247969472,22.948817666017536,14.845852484997684,0.0,15.583743709588532,0.6245484834996701,2.801685525861426,1.6731415296818568,5.099375539042952,60.62397238625314,0.00030928532621431274,1.0179591180257128,35.516285947690875,0.00030928532621431274,2.1197323637701277,0.0,4.194155355200911,0.0,17.775839601565533,1.9342927065481406,0.8244813992925276,1.3524256078273738,0.7305374466374107,0.5818670987207671,0.09394395265511697,12.02268647508455,0.1965413517160646,4.480430879757942,7.5422555953266075,0.07323156355924322,0.12330978815682134,4.553662443317185,7.665565383483429,1.7562497709850537,0.0,18.113413006835586
15 changes: 15 additions & 0 deletions resources/nodal_transport_data__15.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name,number cars,average fuel efficiency
MAR.10_1,789030.14300841,0.7464642087952883
MAR.11_1,888742.9097644725,0.7464642087952883
MAR.12_1,2506285.933453344,0.7464642087952883
MAR.13_1,583471.7566840786,0.7464642087952883
MAR.14_1,1731931.2955693845,0.7464642087952883
MAR.15_1,666397.9035476245,0.7464642087952883
MAR.1_1,3707655.927965689,0.7464642087952883
MAR.2_1,732672.8257538147,0.7464642087952883
MAR.3_1,2391154.6024242826,0.7464642087952883
MAR.4_1,720203.1913254347,0.7464642087952883
MAR.5_1,676436.3909591335,0.7464642087952883
MAR.6_1,159561.8415163957,0.7464642087952883
MAR.8_1,2655458.5892516845,0.7464642087952883
MAR.9_1,4067996.6887762356,0.7464642087952883
15 changes: 15 additions & 0 deletions resources/pop_layout_elec_s_15.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name,total,urban,rural,ct,fraction
MAR.10_1,2281.7677624178073,116.5275749765795,2235.168240105768,MA,0.03541904848087318
MAR.11_1,2570.1235099155797,2739.63065579274,0.23061731226435472,MA,0.0398950895436761
MAR.12_1,7247.8377372892055,3991.84260456956,3780.70123142068,MA,0.11250554084721218
MAR.13_1,1687.320891958404,1830.058019123266,4.33813404145695,MA,0.02619166659263276
MAR.14_1,5008.509537905702,5160.129534847999,13.992324300188706,MA,0.07774526621939155
MAR.15_1,1927.1320198999924,2022.8731463545612,46.39802378853335,MA,0.0299141672374029
MAR.1_1,10722.036218176774,10642.350085363056,22.36136313448308,MA,0.16643425631663555
MAR.2_1,2118.7900728740497,2126.954513217444,57.82766273277966,MA,0.03288920526793622
MAR.3_1,6914.8936008526225,4962.711474231675,2449.0038890937517,MA,0.10733737049083282
MAR.4_1,2082.729587606243,2191.882093660378,3.158749906636781,MA,0.03232945151166837
MAR.5_1,1956.1619589485663,1327.5165734219643,0.0,MA,0.030364788389780264
MAR.6_1,461.43112441301577,0.5932451546727684,488.73757856241645,MA,0.007162626992700861
MAR.8_1,7679.224750891894,8130.609834984562,73.08662999924616,MA,0.11920180406929506
MAR.9_1,11764.092645029716,7817.0783583252005,4683.2620999571145,MA,0.18260971803996215
Loading

0 comments on commit 3ee93d4

Please sign in to comment.