add option to cut Feb 29 in leap years

This commit is contained in:
Fabian Neumann 2022-06-15 13:51:56 +02:00
parent 2b43f43006
commit 4a44c45ace
2 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,7 @@ enable:
build_natura_raster: false
retrieve_natura_raster: true
custom_busmap: false
drop_leap_days: true
electricity:
voltages: [220., 300., 380.]

View File

@ -625,4 +625,8 @@ if __name__ == "__main__":
add_nice_carrier_names(n, snakemake.config)
if snakemake.config['enable'].get('drop_leap_days', True):
leap_days = (n.snapshots.day == 29) & (n.snapshots.month == 2)
n.set_snapshots(n.snapshots[~leap_days])
n.export_to_netcdf(snakemake.output[0])