Skip to content

Commit

Permalink
Development of PR 24h decumulation filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gnrgomes committed May 29, 2024
1 parent d4c5a1b commit f7a970a
Show file tree
Hide file tree
Showing 8 changed files with 562 additions and 11 deletions.
14 changes: 14 additions & 0 deletions bin/decumulate
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!python

import os
import sys

current_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.normpath(os.path.join(current_dir, '../src/'))
if os.path.exists(src_dir):
sys.path.append(src_dir)

from lisfloodutilities.gridding.decumulate_daily_grids import main_script

if __name__ == '__main__':
main_script()
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def run(self):
'compare: compare two set of netCDF files; '
'thresholds: compute discharge return period thresholds; '
'gridding: interpolate meteo variables observations; '
'decumulate: decumulate daily grids into 6 hourly grids in kiwis format; '
'ncextract: extract values from netCDF files; '
'catchstats: calculates catchment statistics; ',
long_description=long_description,
Expand All @@ -143,12 +144,12 @@ def run(self):
# 'GDAL=={}'.format(gdal_version),
'netCDF4>=1.5.3', 'toolz', 'xarray>=0.15.1',
'dask', 'pandas>=0.25.1', 'nine', 'pyg2p'],
author="Valerio Lorini, Stefania Grimaldi, Carlo Russo, Domenico Nappo, Lorenzo Alfieri",
author_email="[email protected],[email protected],[email protected],[email protected],[email protected]",
author="Valerio Lorini, Stefania Grimaldi, Carlo Russo, Goncalo Gomes, Domenico Nappo, Lorenzo Alfieri",
author_email="[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]",
keywords=['netCDF4', 'PCRaster', 'mapstack', 'lisflood', 'efas', 'glofas', 'ecmwf', 'copernicus'],
license='EUPL 1.2',
url='https://github.com/ec-jrc/lisflood-utilities',
scripts=['bin/pcr2nc', 'bin/cutmaps', 'bin/compare', 'bin/nc2pcr', 'bin/thresholds', 'bin/gridding', 'bin/cddmap', 'bin/ncextract','bin/catchstats',],
scripts=['bin/pcr2nc', 'bin/cutmaps', 'bin/compare', 'bin/nc2pcr', 'bin/thresholds', 'bin/gridding', 'bin/decumulate', 'bin/cddmap', 'bin/ncextract','bin/catchstats',],
zip_safe=True,
classifiers=[
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
10 changes: 10 additions & 0 deletions src/lisfloodutilities/gridding/configuration/1arcmin/config_pr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ VALUE_OFFSET = 0.0
DATA_TYPE_PACKED = i2
STANDARD_NAME = precipitation_amount
LONG_NAME = Daily Accumulated Precipitation

# 1280 - IMGW
# 1295 - MARS
# 1302 - CarpatClim
# 1303 - ERAinterim
# 1304 - EURO4M-APGD
# 1310 - HNMS
# 1329 - ERA5-land
KIWIS_FILTER_PLUGIN_CLASSES = {'ObservationsKiwisFilter': {'1303': 100.0, '1329': 100.0}}

# 1310/HNMS until 31/12/2000, 1295/MARS until 01/01/2008, 1304/EURO4M-APGD until 31/12/2008 and 1302/CarpatClim until 31/12/2010
KIWIS_FILTER_DECUMULATION_CONFIG = [{'START': '1989-12-31 00:00:00', 'END': '2000-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1295': 1.5, '1302': 1.5, '1304': 1.5, '1310': 1.5}},{'START': '2001-01-01 00:00:00', 'END': '2007-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1295': 1.5, '1302': 1.5, '1304': 1.5}},{'START': '2008-01-01 00:00:00', 'END': '2008-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1302': 1.5, '1304': 1.5}},{'START': '2009-01-01 00:00:00', 'END': '2010-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1302': 1.5}}]


[VAR_TIME]

UNIT = days since 1990-01-02 06:00:00.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ VALUE_OFFSET = 0.0
DATA_TYPE_PACKED = i2
STANDARD_NAME = precipitation_amount
LONG_NAME = 6 Hourly Accumulated Precipitation
# 1304 - EURO4M-APGD
# 1302 - CarpatClim

# 1280 - IMGW
# 1295 - MARS
# 1302 - CarpatClim
# 1303 - ERAinterim
# 1304 - EURO4M-APGD
# 1310 - HNMS
# 1329 - ERA5-land
KIWIS_FILTER_PLUGIN_CLASSES = {'DowgradedObservationsKiwisFilter': {'1304': 1.0, '1302': 1.0, '1295': 1.0}, 'ObservationsKiwisFilter': {'1303': 100.0, '1329': 100.0}}

Expand Down
11 changes: 11 additions & 0 deletions src/lisfloodutilities/gridding/configuration/1arcmin/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,21 @@ VALUE_OFFSET = 0.0
DATA_TYPE_PACKED = i2
STANDARD_NAME = DUMMY_STANDARD_NAME
LONG_NAME = DUMMY LONG NAME

KIWIS_FILTER_COLUMNS = {'COL_LAT': 'station_local_y', 'COL_LON': 'station_local_x', 'COL_IS_IN_DOMAIN': 'EFAS_ADDATTR_ISINNEWDOMAIN'}
# KIWIS_FILTER_COLUMNS = {}
KIWIS_FILTER_PLUGIN_CLASSES = {'KiwisFilter': {}}

# 1280 - IMGW
# 1295 - MARS
# 1302 - CarpatClim
# 1303 - ERAinterim
# 1304 - EURO4M-APGD
# 1310 - HNMS
# 1329 - ERA5-land
# KIWIS_FILTER_DECUMULATION_CONFIG = [{'START': '1989-12-31 00:00:00', 'END': '2000-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1295': 1.5, '1302': 1.5}}]
KIWIS_FILTER_DECUMULATION_CONFIG = []

[DIMENSION]

TOP = 72.25000000000000000000
Expand Down
10 changes: 10 additions & 0 deletions src/lisfloodutilities/gridding/configuration/5x5km/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@ VALUE_OFFSET = 0.0
DATA_TYPE_PACKED = i2
STANDARD_NAME = DUMMY_STANDARD_NAME
LONG_NAME = DUMMY LONG NAME

KIWIS_FILTER_COLUMNS = {'COL_LAT': 'station_local_y', 'COL_LON': 'station_local_x', 'COL_IS_IN_DOMAIN': 'EFAS_ADDATTR_ISINNEWDOMAIN'}
KIWIS_FILTER_PLUGIN_CLASSES = {'KiwisFilter': {}}
# 1280 - IMGW
# 1295 - MARS
# 1302 - CarpatClim
# 1303 - ERAinterim
# 1304 - EURO4M-APGD
# 1310 - HNMS
# 1329 - ERA5-land
# KIWIS_FILTER_DECUMULATION_CONFIG = [{'START': '1989-12-31 00:00:00', 'END': '2000-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1295': 1.5, '1302': 1.5}}]
KIWIS_FILTER_DECUMULATION_CONFIG = []

[DIMENSION]

Expand Down
Loading

0 comments on commit f7a970a

Please sign in to comment.