build_cutout: Fix cutout generation
This commit is contained in:
parent
c6a4de7469
commit
cfa641386e
@ -31,8 +31,7 @@ electricity:
|
||||
conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
|
||||
|
||||
atlite:
|
||||
cutout_directory: 'cutouts'
|
||||
nprocesses: 1
|
||||
nprocesses: 4
|
||||
cutouts:
|
||||
europe-2013-era5:
|
||||
module: era5
|
||||
|
@ -5,8 +5,13 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
logging.basicConfig(level=snakemake.config['logging_level'])
|
||||
|
||||
cutout_params = snakemake.config['atlite']['cutouts'][snakemake.wildcards.cutout]
|
||||
for p in ('xs', 'ys', 'years', 'months'):
|
||||
if p in cutout_params:
|
||||
cutout_params[p] = slice(*cutout_params[p])
|
||||
|
||||
cutout = atlite.Cutout(snakemake.wildcards.cutout,
|
||||
cutout_dir=os.path.dirname(snakemake.output.cutout),
|
||||
**snakemake.config['atlite']['cutouts'][snakemake.wildcards.cutout])
|
||||
cutout_dir=os.path.dirname(snakemake.output[0]),
|
||||
**cutout_params)
|
||||
|
||||
cutout.prepare(nprocesses=snakemake.config['atlite'].get('nprocesses', 4))
|
||||
|
Loading…
Reference in New Issue
Block a user