update for atlite version 0.2.4
This commit is contained in:
parent
c5b3551687
commit
e4dad6429d
@ -5,9 +5,9 @@ import pandas as pd
|
|||||||
import atlite
|
import atlite
|
||||||
import helper
|
import helper
|
||||||
|
|
||||||
|
cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc"
|
||||||
|
|
||||||
cutout = atlite.Cutout(snakemake.config['atlite']['cutout_name'],
|
cutout = atlite.Cutout(path=cutout_path)
|
||||||
cutout_dir=snakemake.config['atlite']['cutout_dir'])
|
|
||||||
|
|
||||||
|
|
||||||
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
||||||
|
@ -18,8 +18,8 @@ if 'snakemake' not in globals():
|
|||||||
time = pd.date_range(freq='m', **snakemake.config['snapshots'])
|
time = pd.date_range(freq='m', **snakemake.config['snapshots'])
|
||||||
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
||||||
|
|
||||||
cutout = atlite.Cutout(snakemake.config['atlite']['cutout_name'],
|
cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc"
|
||||||
cutout_dir=snakemake.config['atlite']['cutout_dir'],
|
cutout = atlite.Cutout(path=cutout_path,
|
||||||
**params)
|
**params)
|
||||||
|
|
||||||
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
||||||
|
@ -18,11 +18,10 @@ if 'snakemake' not in globals():
|
|||||||
snakemake.config = yaml.safe_load(f)
|
snakemake.config = yaml.safe_load(f)
|
||||||
snakemake.input = Dict()
|
snakemake.input = Dict()
|
||||||
snakemake.output = Dict()
|
snakemake.output = Dict()
|
||||||
|
|
||||||
snakemake.input["urban_percent"] = "data/urban_percent.csv"
|
snakemake.input["urban_percent"] = "data/urban_percent.csv"
|
||||||
|
|
||||||
cutout = atlite.Cutout(snakemake.config['atlite']['cutout_name'],
|
cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc"
|
||||||
cutout_dir=snakemake.config['atlite']['cutout_dir'])
|
cutout = atlite.Cutout(path=cutout_path)
|
||||||
|
|
||||||
grid_cells = cutout.grid_cells()
|
grid_cells = cutout.grid_cells()
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ def prepare_temperature_data():
|
|||||||
temperature_factor = (t_threshold - temperature_average_d_heat) * d_heat * 1/365
|
temperature_factor = (t_threshold - temperature_average_d_heat) * d_heat * 1/365
|
||||||
|
|
||||||
"""
|
"""
|
||||||
temperature = xr.open_dataarray(snakemake.input.air_temperature).T.to_pandas()
|
temperature = xr.open_dataarray(snakemake.input.air_temperature).to_pandas()
|
||||||
d_heat = (temperature.groupby(temperature.columns.str[:2], axis=1).mean()
|
d_heat = (temperature.groupby(temperature.columns.str[:2], axis=1).mean()
|
||||||
.resample("1D").mean()<t_threshold).sum()
|
.resample("1D").mean()<t_threshold).sum()
|
||||||
temperature_average_d_heat = (temperature.groupby(temperature.columns.str[:2], axis=1)
|
temperature_average_d_heat = (temperature.groupby(temperature.columns.str[:2], axis=1)
|
||||||
@ -834,7 +834,7 @@ if __name__ == "__main__":
|
|||||||
wildcards=dict(
|
wildcards=dict(
|
||||||
network='elec',
|
network='elec',
|
||||||
simpl='',
|
simpl='',
|
||||||
clusters='48',
|
clusters='50',
|
||||||
lv='1',
|
lv='1',
|
||||||
opts='Co2L-3H',
|
opts='Co2L-3H',
|
||||||
sector_opts="[Co2L0p0-168H-T-H-B-I]"),
|
sector_opts="[Co2L0p0-168H-T-H-B-I]"),
|
||||||
|
@ -19,9 +19,8 @@ time = pd.date_range(freq='m', **snakemake.config['snapshots'])
|
|||||||
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
||||||
|
|
||||||
|
|
||||||
|
cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc"
|
||||||
cutout = atlite.Cutout(snakemake.config['atlite']['cutout_name'],
|
cutout = atlite.Cutout(path=cutout_path,
|
||||||
cutout_dir=snakemake.config['atlite']['cutout_dir'],
|
|
||||||
**params)
|
**params)
|
||||||
|
|
||||||
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
||||||
|
@ -18,9 +18,8 @@ if 'snakemake' not in globals():
|
|||||||
time = pd.date_range(freq='m', **snakemake.config['snapshots'])
|
time = pd.date_range(freq='m', **snakemake.config['snapshots'])
|
||||||
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]]))
|
||||||
|
|
||||||
|
cutout_path = snakemake.config['atlite']['cutout_dir'] + "/" + snakemake.config['atlite']['cutout_name']+ ".nc"
|
||||||
cutout = atlite.Cutout(snakemake.config['atlite']['cutout_name'],
|
cutout = atlite.Cutout(path=cutout_path,
|
||||||
cutout_dir=snakemake.config['atlite']['cutout_dir'],
|
|
||||||
**params)
|
**params)
|
||||||
|
|
||||||
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
clustered_busregions_as_geopd = gpd.read_file(snakemake.input.regions_onshore).set_index('name', drop=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user