Skip to content

Commit 5ce0da2

Browse files
authored
Merge pull request #73 from ec-jrc/DailyDecumulation
Daily decumulation and Gridding
2 parents eecb95a + 44a9771 commit 5ce0da2

File tree

72 files changed

+562885
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+562885
-101
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ tests/**/*aux.xml
5353
!src/lisfloodutilities/gridding/**/*.nc
5454
tests/data/gridding/meteo_out/**/*.nc
5555
tests/data/gridding/meteo_out/**/*.tiff
56+
tests/data/gridding/meteo_out/**/*.kiwis
5657
.settings
5758
.project
5859
.pydevproject

README.md

Lines changed: 193 additions & 21 deletions
Large diffs are not rendered by default.

bin/decumulate

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!python
2+
3+
import os
4+
import sys
5+
6+
current_dir = os.path.dirname(os.path.abspath(__file__))
7+
src_dir = os.path.normpath(os.path.join(current_dir, '../src/'))
8+
if os.path.exists(src_dir):
9+
sys.path.append(src_dir)
10+
11+
from lisfloodutilities.gridding.decumulate_daily_grids import main_script
12+
13+
if __name__ == '__main__':
14+
main_script()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ more-itertools>=8.2.0
1616
netCDF4>=1.5.3,<=1.6.4
1717
nine>=1.1.0
1818
numexpr>=2.8.4
19-
numpy>=1.21.6
19+
numpy>=1.22.3
2020
packaging>=23.1
2121
pandas>=1.3.5
2222
partd>=1.4.0

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def run(self):
130130
'compare: compare two set of netCDF files; '
131131
'thresholds: compute discharge return period thresholds; '
132132
'gridding: interpolate meteo variables observations; '
133+
'decumulate: decumulate daily grids into 6 hourly grids in kiwis format; '
133134
'ncextract: extract values from netCDF files; '
134135
'catchstats: calculates catchment statistics; ',
135136
long_description=long_description,
@@ -143,12 +144,12 @@ def run(self):
143144
# 'GDAL=={}'.format(gdal_version),
144145
'netCDF4>=1.5.3', 'toolz', 'xarray>=0.15.1',
145146
'dask', 'pandas>=0.25.1', 'nine', 'pyg2p'],
146-
author="Valerio Lorini, Stefania Grimaldi, Carlo Russo, Domenico Nappo, Lorenzo Alfieri",
147-
147+
author="Valerio Lorini, Stefania Grimaldi, Carlo Russo, Goncalo Gomes, Domenico Nappo, Lorenzo Alfieri",
148+
148149
keywords=['netCDF4', 'PCRaster', 'mapstack', 'lisflood', 'efas', 'glofas', 'ecmwf', 'copernicus'],
149150
license='EUPL 1.2',
150151
url='https://github.com/ec-jrc/lisflood-utilities',
151-
scripts=['bin/pcr2nc', 'bin/cutmaps', 'bin/compare', 'bin/nc2pcr', 'bin/thresholds', 'bin/gridding', 'bin/cddmap', 'bin/ncextract','bin/catchstats',],
152+
scripts=['bin/pcr2nc', 'bin/cutmaps', 'bin/compare', 'bin/nc2pcr', 'bin/thresholds', 'bin/gridding', 'bin/decumulate', 'bin/cddmap', 'bin/ncextract','bin/catchstats',],
152153
zip_safe=True,
153154
classifiers=[
154155
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers

src/lisfloodutilities/gridding/configuration/1arcmin/config_pr.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@ VALUE_OFFSET = 0.0
1111
DATA_TYPE_PACKED = i2
1212
STANDARD_NAME = precipitation_amount
1313
LONG_NAME = Daily Accumulated Precipitation
14+
15+
# 1280 - IMGW
16+
# 1295 - MARS
17+
# 1302 - CarpatClim
1418
# 1303 - ERAinterim
19+
# 1304 - EURO4M-APGD
20+
# 1310 - HNMS
1521
# 1329 - ERA5-land
1622
KIWIS_FILTER_PLUGIN_CLASSES = {'ObservationsKiwisFilter': {'1303': 100.0, '1329': 100.0}}
1723

24+
# 1310/HNMS until 31/12/2000, 1304/EURO4M-APGD until 31/12/2008, 1302/CarpatClim until 31/12/2010, 1280/IMGW until 31/12/2020 and 1295/MARS until the end of times
25+
KIWIS_FILTER_DECUMULATION_CONFIG = [{'START': '1989-12-31 00:00:00', 'END': '2000-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1280': 1.5, '1295': 1.5, '1302': 1.5, '1304': 1.5, '1310': 1.5}},{'START': '2001-01-01 00:00:00', 'END': '2008-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1280': 1.5, '1295': 1.5, '1302': 1.5, '1304': 1.5}},{'START': '2009-01-01 00:00:00', 'END': '2010-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1280': 1.5, '1295': 1.5, '1302': 1.5}},{'START': '2011-01-01 00:00:00', 'END': '2020-12-31 23:59:59', 'PROVIDERS_RADIUS': {'1280': 1.5, '1295': 1.5}},{'START': '2021-01-01 00:00:00', 'END': '', 'PROVIDERS_RADIUS': {'1295': 1.5}}]
26+
1827
[VAR_TIME]
1928

2029
UNIT = days since 1990-01-02 06:00:00.0

src/lisfloodutilities/gridding/configuration/1arcmin/config_pr6.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ VALUE_OFFSET = 0.0
1111
DATA_TYPE_PACKED = i2
1212
STANDARD_NAME = precipitation_amount
1313
LONG_NAME = 6 Hourly Accumulated Precipitation
14-
# 1304 - EURO4M-APGD
15-
# 1302 - CarpatClim
14+
15+
# 1280 - IMGW
1616
# 1295 - MARS
17+
# 1302 - CarpatClim
1718
# 1303 - ERAinterim
19+
# 1304 - EURO4M-APGD
20+
# 1310 - HNMS
1821
# 1329 - ERA5-land
19-
KIWIS_FILTER_PLUGIN_CLASSES = {'DowgradedObservationsKiwisFilter': {'1304': 1.0, '1302': 1.0, '1295': 1.0}, 'ObservationsKiwisFilter': {'1303': 100.0, '1329': 100.0}}
22+
# KIWIS_FILTER_PLUGIN_CLASSES = {'DowgradedObservationsKiwisFilter': {'1304': 1.0, '1302': 1.0, '1295': 1.0}, 'ObservationsKiwisFilter': {'1303': 100.0, '1329': 100.0}}
2023

2124

2225
[VAR_TIME]

src/lisfloodutilities/gridding/configuration/1arcmin/config_rg.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ DATA_TYPE_PACKED = i2
1212
STANDARD_NAME = integral_wrt_time_of_surface_downwelling_shortwave_flux_in_air
1313
LONG_NAME = Daily Calculated Radiation
1414

15+
KIWIS_FILTER_PLUGIN_CLASSES = {'SolarRadiationLimitsKiwisFilter': {'EXCLUDE_BELLOW_LATITUDE': 66.0, 'EXCLUDE_BELLOW_VALUE': 0.0}}
16+
1517
[VAR_TIME]
1618

1719
UNIT = days since 1990-01-02 00:00:00.0

src/lisfloodutilities/gridding/configuration/1arcmin/config_ta6.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ DATA_TYPE_PACKED = i2
1313
STANDARD_NAME = air_temperature
1414
LONG_NAME = 6 Hourly Average Temperature
1515

16+
# 1280 - IMGW
17+
# 1295 - MARS
18+
# 1302 - CarpatClim
19+
# 1303 - ERAinterim
20+
# 1304 - EURO4M-APGD
21+
# 1310 - HNMS
22+
# 1323 - ICON
23+
# 1329 - ERA5-land
24+
KIWIS_FILTER_PLUGIN_CLASSES = {'ObservationsKiwisFilter': {'1329': 700.0}, 'ProvidersKiwisFilter': {'1323': [('2022-01-01 06:00:00', '2023-12-31 06:00:00')]}}
25+
1626
[VAR_TIME]
1727

1828
UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f

src/lisfloodutilities/gridding/configuration/1arcmin/config_tn.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ DATA_TYPE_PACKED = i2
1313
STANDARD_NAME = air_temperature
1414
LONG_NAME = Daily Minimum Temperature
1515

16+
# 1280 - IMGW
17+
# 1295 - MARS
18+
# 1302 - CarpatClim
19+
# 1303 - ERAinterim
20+
# 1304 - EURO4M-APGD
21+
# 1310 - HNMS
22+
# 1323 - ICON
23+
# 1329 - ERA5-land
24+
KIWIS_FILTER_PLUGIN_CLASSES = {'ObservationsKiwisFilter': {'1329': 700.0}, 'ProvidersKiwisFilter': {'1323': [('2022-01-01 06:00:00', '2023-12-31 06:00:00')]}}
25+
1626
[VAR_TIME]
1727

1828
UNIT = days since 1990-01-01 06:00:00.0

src/lisfloodutilities/gridding/configuration/1arcmin/config_tx.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ DATA_TYPE_PACKED = i2
1313
STANDARD_NAME = air_temperature
1414
LONG_NAME = Daily Maximum Temperature
1515

16+
# 1280 - IMGW
17+
# 1295 - MARS
18+
# 1302 - CarpatClim
19+
# 1303 - ERAinterim
20+
# 1304 - EURO4M-APGD
21+
# 1310 - HNMS
22+
# 1323 - ICON
23+
# 1329 - ERA5-land
24+
KIWIS_FILTER_PLUGIN_CLASSES = {'ObservationsKiwisFilter': {'1329': 700.0}, 'ProvidersKiwisFilter': {'1323': [('2022-01-01 18:00:00', '2023-12-31 18:00:00')]}}
25+
1626
[VAR_TIME]
1727

1828
UNIT = days since 1990-01-01 18:00:00.0

src/lisfloodutilities/gridding/configuration/1arcmin/default.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,21 @@ VALUE_OFFSET = 0.0
3232
DATA_TYPE_PACKED = i2
3333
STANDARD_NAME = DUMMY_STANDARD_NAME
3434
LONG_NAME = DUMMY LONG NAME
35+
3536
KIWIS_FILTER_COLUMNS = {'COL_LAT': 'station_local_y', 'COL_LON': 'station_local_x', 'COL_IS_IN_DOMAIN': 'EFAS_ADDATTR_ISINNEWDOMAIN'}
3637
# KIWIS_FILTER_COLUMNS = {}
3738
KIWIS_FILTER_PLUGIN_CLASSES = {'KiwisFilter': {}}
3839

40+
# 1280 - IMGW
41+
# 1295 - MARS
42+
# 1302 - CarpatClim
43+
# 1303 - ERAinterim
44+
# 1304 - EURO4M-APGD
45+
# 1310 - HNMS
46+
# 1329 - ERA5-land
47+
# 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}}]
48+
KIWIS_FILTER_DECUMULATION_CONFIG = []
49+
3950
[DIMENSION]
4051

4152
TOP = 72.25000000000000000000

src/lisfloodutilities/gridding/configuration/5x5km/default.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,18 @@ VALUE_OFFSET = 0.0
3333
DATA_TYPE_PACKED = i2
3434
STANDARD_NAME = DUMMY_STANDARD_NAME
3535
LONG_NAME = DUMMY LONG NAME
36+
3637
KIWIS_FILTER_COLUMNS = {'COL_LAT': 'station_local_y', 'COL_LON': 'station_local_x', 'COL_IS_IN_DOMAIN': 'EFAS_ADDATTR_ISINNEWDOMAIN'}
3738
KIWIS_FILTER_PLUGIN_CLASSES = {'KiwisFilter': {}}
39+
# 1280 - IMGW
40+
# 1295 - MARS
41+
# 1302 - CarpatClim
42+
# 1303 - ERAinterim
43+
# 1304 - EURO4M-APGD
44+
# 1310 - HNMS
45+
# 1329 - ERA5-land
46+
# 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}}]
47+
KIWIS_FILTER_DECUMULATION_CONFIG = []
3848

3949
[DIMENSION]
4050

0 commit comments

Comments
 (0)