weatherdb 1.1.2__tar.gz → 1.2.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitlab-ci.yml +40 -10
- {weatherdb-1.1.2 → weatherdb-1.2.1}/CHANGES.md +21 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/PKG-INFO +1 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/docker-compose.yaml +5 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/Methode.md +5 -1
- weatherdb-1.2.1/docs/source/api/weatherdb.broker.rst +7 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.db.rst +10 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.rst +0 -1
- weatherdb-1.2.1/docs/source/api/weatherdb.station.GroupStation.rst +5 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.StationBases.rst +18 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.StationET.rst +5 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.StationP.rst +5 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.StationPD.rst +6 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.StationT.rst +5 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.station.rst +17 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsBase.rst +15 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsET.rst +6 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsP.rst +6 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsPD.rst +7 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsT.rst +7 -0
- weatherdb-1.2.1/docs/source/api/weatherdb.stations.rst +15 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.utils.rst +2 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/conf.py +3 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Quickstart.md +2 -1
- weatherdb-1.2.1/tests/test-data/DEM/COP-DEM_GLO-30-DGED__2023_1_clipped.tif +0 -0
- weatherdb-1.2.1/tests/test-data/DEM/README.md +3 -0
- weatherdb-1.2.1/tests/test-data/DEM/eula_F.pdf +0 -0
- weatherdb-1.2.1/tests/test-data/regionalisation/DWD-grid_ma_1991_2020_DGM25_clipped.tif +0 -0
- weatherdb-1.2.1/tests/test-data/regionalisation/HYRAS_ma_1991_2020_DGM25_clipped.tif +0 -0
- weatherdb-1.2.1/tests/test-data/regionalisation/README.md +3 -0
- weatherdb-1.2.1/tests/test-data/test-data-config.ini +28 -0
- weatherdb-1.2.1/weatherdb/_version.py +1 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/broker.py +12 -2
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/cli.py +20 -5
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/config_default.ini +30 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationBases.py +91 -17
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsBase.py +16 -3
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/get_data.py +12 -7
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/PKG-INFO +1 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/SOURCES.txt +19 -7
- weatherdb-1.1.2/docs/source/api/weatherDB.broker.rst +0 -10
- weatherdb-1.1.2/docs/source/api/weatherdb.station.rst +0 -56
- weatherdb-1.1.2/docs/source/api/weatherdb.stations.rst +0 -46
- weatherdb-1.1.2/weatherDB.egg-info/PKG-INFO +0 -761
- weatherdb-1.1.2/weatherDB.egg-info/SOURCES.txt +0 -84
- weatherdb-1.1.2/weatherDB.egg-info/entry_points.txt +0 -2
- weatherdb-1.1.2/weatherDB.egg-info/requires.txt +0 -21
- weatherdb-1.1.2/weatherDB.egg-info/top_level.txt +0 -5
- weatherdb-1.1.2/weatherdb/_version.py +0 -1
- weatherdb-1.1.2/weatherdb.egg-info/dependency_links.txt +0 -1
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.dockerignore +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/cleanup-cache.yml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/python-publish.yml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/python-test.yml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitignore +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitlab/merge_request_templates/new_version.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/.readthedocs.yaml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/LICENSE +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/MANIFEST.in +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/README.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/Dockerfile +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/docker-compose_test.yaml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/start-docker-test.sh +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/requirements.txt +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/Changelog.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/License.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/custom.css +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/favicon.ico +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/logo.png +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/api.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/cli.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.config.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/index.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Configuration.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Hosting.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Install.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/setup.rst +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/pyproject.toml +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/setup.cfg +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/README.md +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/alembic.ini +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/config.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/env.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/script.py.mako +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.0_initial_database_creation.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.2_more_charachters_for_settings+term_station_ma_raster.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.5_fix-ma-raster-values.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.6_update-views.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/ConfigParser.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/connections.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/fixtures/RichterParameters.json +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/models.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/queries/get_quotient.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/views.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/GroupStation.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationET.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationP.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationPD.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationT.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/constants.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/GroupStations.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsBaseTET.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsET.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsP.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsPD.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsT.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/TimestampPeriod.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/__init__.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/dwd.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/geometry.py +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/logging.py +0 -0
- {weatherdb-1.1.2/weatherDB.egg-info → weatherdb-1.2.1/weatherdb.egg-info}/dependency_links.txt +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/entry_points.txt +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/requires.txt +0 -0
- {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/top_level.txt +0 -0
@@ -1,8 +1,9 @@
|
|
1
1
|
stages:
|
2
2
|
- test_single
|
3
3
|
- test_matrix
|
4
|
+
- test_manual
|
4
5
|
- build
|
5
|
-
-
|
6
|
+
- release
|
6
7
|
|
7
8
|
workflow:
|
8
9
|
auto_cancel:
|
@@ -21,10 +22,10 @@ test_single:
|
|
21
22
|
before_script:
|
22
23
|
- python3 -m pip install --upgrade pip --root-user-action=ignore
|
23
24
|
- python3 -m pip install unittest-xml-reporting --root-user-action=ignore
|
24
|
-
script:
|
25
25
|
- python3 -m pip install .[optionals] --root-user-action=ignore
|
26
26
|
- mkdir -p $WEATHERDB_DATA_BASE_DIR
|
27
27
|
- mkdir -p test-reports
|
28
|
+
script:
|
28
29
|
- python3 -m xmlrunner discover -s tests -p testSuite.py -o test-reports
|
29
30
|
cache:
|
30
31
|
- key: weatherdb-data-cache-$CI_COMMIT_REF_SLUG
|
@@ -61,11 +62,13 @@ test_single:
|
|
61
62
|
WEATHERDB_LOGGING_HANDLER: console
|
62
63
|
WEATHERDB_LOGGING_LEVEL: DEBUG
|
63
64
|
WEATHERDB_HORIZON_RADIUS: 40000
|
65
|
+
WEATHERDB_OPENTOPO_API_KEY: $WEATHERDB_OPENTOPO_API_KEY
|
64
66
|
WEATHERDB_TEST_ARTIFACT_DIR: $CI_PROJECT_DIR/artifacts
|
65
67
|
WEATHERDB_TEST_ARTIFACT_DB_DUMP: ON_FAILURE
|
66
68
|
WEATHERDB_TEST_ARTIFACT_LIST_DATA_FILES: ON_FAILURE
|
67
69
|
WEATHERDB_TEST_ARTIFACT_COPY_USER_CONFIG: ON_FAILURE
|
68
|
-
|
70
|
+
WEATHERDB_TEST_DR_COPY_RASTERS: True
|
71
|
+
WEATHERDB_TEST_DR_UPDATE_USER_CONFIG: True
|
69
72
|
DOCKER_ENV: test
|
70
73
|
tags:
|
71
74
|
- docker
|
@@ -73,20 +76,32 @@ test_single:
|
|
73
76
|
test_matrix:
|
74
77
|
stage: test_matrix
|
75
78
|
extends: test_single
|
76
|
-
dependencies:
|
77
|
-
- test_single
|
78
79
|
parallel:
|
79
80
|
matrix:
|
80
81
|
- PY_VERSION: ["3.9","3.10","3.11","3.12","3.13"]
|
81
82
|
variables:
|
82
83
|
PYTHON_VERSION: $PY_VERSION
|
83
84
|
|
85
|
+
test_download_rasters:
|
86
|
+
extends: test_single
|
87
|
+
stage: test_manual
|
88
|
+
rules:
|
89
|
+
- when: manual
|
90
|
+
allow_failure: true
|
91
|
+
script:
|
92
|
+
- python3 -m xmlrunner discover -s tests -p test_downloadRasters.py --complete -o test-reports
|
93
|
+
variables:
|
94
|
+
PYTHON_VERSION: $PY_VERSION
|
95
|
+
parallel:
|
96
|
+
matrix:
|
97
|
+
- PY_VERSION: ["3.9","3.10","3.11","3.12","3.13"]
|
98
|
+
|
84
99
|
build:
|
100
|
+
stage: build
|
85
101
|
rules:
|
86
|
-
- if: $CI_COMMIT_TAG =~ /^[Vv]
|
102
|
+
- if: $CI_COMMIT_TAG =~ /^[Vv]*\d+\.\d+\.\d+$/
|
87
103
|
dependencies:
|
88
104
|
- test_matrix
|
89
|
-
stage: build
|
90
105
|
image: python:3.11
|
91
106
|
script:
|
92
107
|
- python -m pip install --upgrade pip --root-user-action=ignore
|
@@ -100,12 +115,12 @@ build:
|
|
100
115
|
tags:
|
101
116
|
- docker
|
102
117
|
|
103
|
-
|
118
|
+
release_pypi:
|
119
|
+
stage: release
|
104
120
|
rules:
|
105
121
|
- !reference [build, rules]
|
106
122
|
dependencies:
|
107
123
|
- build
|
108
|
-
stage: deploy
|
109
124
|
image: python:3.11
|
110
125
|
script:
|
111
126
|
- python -m pip install --upgrade pip --root-user-action=ignore
|
@@ -116,4 +131,19 @@ deploy:
|
|
116
131
|
TWINE_PASSWORD: $TWINE_PASSWORD
|
117
132
|
tags:
|
118
133
|
- docker
|
119
|
-
interruptible: false
|
134
|
+
interruptible: false
|
135
|
+
|
136
|
+
release_gitlab:
|
137
|
+
stage: release
|
138
|
+
rules:
|
139
|
+
- !reference [build, rules]
|
140
|
+
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
141
|
+
dependencies:
|
142
|
+
- build
|
143
|
+
- release_pypi
|
144
|
+
script:
|
145
|
+
- echo "running release_gitlab"
|
146
|
+
release:
|
147
|
+
name: '$CI_COMMIT_TAG'
|
148
|
+
tag_name: '$CI_COMMIT_TAG'
|
149
|
+
description: '$CI_COMMIT_TAG_MESSAGE'
|
@@ -1,5 +1,22 @@
|
|
1
1
|
# Change-log
|
2
2
|
|
3
|
+
## Version 1.2.1
|
4
|
+
|
5
|
+
- fix: filllup linear regression did not take configuration value and therefor did never work
|
6
|
+
- config: change LINEAR_INTERPOLATION_LIMIT to be a category
|
7
|
+
- cli: add version parameter
|
8
|
+
- multiprocessing: make process count configurable through user configuration
|
9
|
+
- broker: prevent broker inactivation by other broker
|
10
|
+
- broker: add force deactivate all method to forcefully change the database flag of active brokers
|
11
|
+
|
12
|
+
## Version 1.2.0
|
13
|
+
|
14
|
+
> [!WARNING]
|
15
|
+
> This versions update did have an error and the lienear regression doesn't work at all. PLease use version 1.2.1
|
16
|
+
|
17
|
+
- tests: add test rasters and make downloading the rasters a manual job on GitLab as there were many problems
|
18
|
+
- fillup: add method to linearly interpolate residual missing values
|
19
|
+
|
3
20
|
## Version 1.1.2
|
4
21
|
|
5
22
|
- add method to download DEM data from OpenTopography-API
|
@@ -12,7 +29,10 @@
|
|
12
29
|
|
13
30
|
## Version 1.1.0
|
14
31
|
|
15
|
-
|
32
|
+
> [!NOTE]
|
33
|
+
> **major change:** The module got renamed to `weatherdb`, you need to adapt this in your import and cli statements
|
34
|
+
|
35
|
+
- rename module from weatherDB to weatherdb to be compliant with PEP 8
|
16
36
|
So you need to import the module now with `import weatherdb`
|
17
37
|
- fix some missing stationN variables to stationsP
|
18
38
|
- fix: TimestampPeriod._check_period
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: weatherdb
|
3
|
-
Version: 1.1
|
3
|
+
Version: 1.2.1
|
4
4
|
Summary: This is a package to work with and to create the Weather Database which handles, checks, fills and corrects DWD Weather Station data.
|
5
5
|
Author-email: Max Schmit <max.schmit@hydrology.uni-freiburg.de>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -14,12 +14,14 @@ services:
|
|
14
14
|
WEATHERDB_USER_CONFIG_FILE: /home/config_user.yaml
|
15
15
|
WEATHERDB_DATA_BASE_DIR: /home/data
|
16
16
|
WEATHERDB_HANDLE_NON_EXISTING_CONFIG: create
|
17
|
+
WEATHERDB_OPENTOPO_API_KEY: /run/secrets/opentopo_api_key
|
17
18
|
DOCKER_ENV: main
|
18
19
|
volumes:
|
19
20
|
- weatherdb_home:/home
|
20
21
|
command: ["sleep", "infinity"] # to keep awake
|
21
22
|
secrets:
|
22
23
|
- db_password
|
24
|
+
- opentopo_api_key
|
23
25
|
develop:
|
24
26
|
watch:
|
25
27
|
- action: rebuild
|
@@ -53,6 +55,8 @@ volumes:
|
|
53
55
|
secrets:
|
54
56
|
db_password:
|
55
57
|
file: ./db_password.docker-secret
|
58
|
+
opentopo_api_key:
|
59
|
+
file: ./opentopo_api_key.docker-secret
|
56
60
|
|
57
61
|
# start from parent folder with `docker compose -f docker\\docker-compose.yaml up --build`
|
58
|
-
# To connect to
|
62
|
+
# To connect to the weatherdb service use `docker-compose exec weatherdb bash`
|
@@ -117,7 +117,11 @@ N_{neighbor} * \dfrac{N_{station,ma,winter}}{N_{neighbor,ma,winter}} \space if\s
|
|
117
117
|
N_{neighbor} * \dfrac{N_{station,ma,summer}}{N_{neighbor,ma,summer}} \space if\space month\notin[4:9]
|
118
118
|
\end{cases}$
|
119
119
|
|
120
|
-
For the precipitation stations only stations within a
|
120
|
+
For the precipitation stations only stations within a 110 km radius are taken to fill missing values. For the potential Evapotranspiration and the temperature this radius is 150km. For the temperature stations the median of the regionalised values from the 5 closest stations (but not more than 150 km away) is taken to fill missing values. Those limits can get configured in the user configurations.
|
121
|
+
|
122
|
+
### linear interpolation
|
123
|
+
|
124
|
+
After missing values got filled with regionalised values from the neighboring stations there can still be missing values left. To fill those residual missing values, they get interpolated linearly. Those linear interpolations have configurable limits for how big the interval of missing values can be. The default values are 1h for precipitation and 2 days for temperature and evapotranspiration.
|
121
125
|
|
122
126
|
### adjusting precipitation to daily station measurements
|
123
127
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
StationBases
|
2
|
+
============
|
3
|
+
|
4
|
+
Those are the base station classes on which the real station classes above depend on.
|
5
|
+
None of them is working on its own, because the class variables are not yet set correctly.
|
6
|
+
|
7
|
+
.. py:module:: weatherdb.station.StationBases
|
8
|
+
|
9
|
+
.. autoclass:: weatherdb.station.StationBases.StationBase
|
10
|
+
|
11
|
+
|
12
|
+
.. autoclass:: weatherdb.station.StationBases.StationPBase
|
13
|
+
|
14
|
+
|
15
|
+
.. autoclass:: weatherdb.station.StationBases.StationCanVirtualBase
|
16
|
+
|
17
|
+
|
18
|
+
.. autoclass:: weatherdb.station.StationBases.StationTETBase
|
@@ -0,0 +1,17 @@
|
|
1
|
+
station
|
2
|
+
--------
|
3
|
+
|
4
|
+
.. py:module:: weatherdb.station
|
5
|
+
|
6
|
+
.. toctree::
|
7
|
+
:maxdepth: 1
|
8
|
+
:titlesonly:
|
9
|
+
|
10
|
+
weatherdb.station.StationP
|
11
|
+
weatherdb.station.StationT
|
12
|
+
weatherdb.station.StationET
|
13
|
+
weatherdb.station.StationPD
|
14
|
+
weatherdb.station.GroupStation
|
15
|
+
weatherdb.station.StationBases
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
StationsBase
|
2
|
+
============
|
3
|
+
|
4
|
+
Those are the base stations classes on which the real stations classes above depend on.
|
5
|
+
None of them is working on its own, because the class variables are not yet set correctly.
|
6
|
+
|
7
|
+
.. py:module:: weatherdb.stations.StationsBase
|
8
|
+
|
9
|
+
.. autoclass:: weatherdb.stations.StationsBase.StationsBase
|
10
|
+
|
11
|
+
.. autoclasstoc::
|
12
|
+
|
13
|
+
.. autoclass:: weatherdb.stations.StationsBaseTET.StationsBaseTET
|
14
|
+
|
15
|
+
.. autoclasstoc::
|
@@ -0,0 +1,15 @@
|
|
1
|
+
stations
|
2
|
+
--------
|
3
|
+
|
4
|
+
.. py:module:: weatherdb.stations
|
5
|
+
|
6
|
+
.. toctree::
|
7
|
+
:maxdepth: 1
|
8
|
+
:titlesonly:
|
9
|
+
|
10
|
+
weatherdb.stations.StationsP
|
11
|
+
weatherdb.stations.StationsT
|
12
|
+
weatherdb.stations.StationsET
|
13
|
+
weatherdb.stations.StationsPD
|
14
|
+
weatherdb.stations.GroupStations
|
15
|
+
weatherdb.stations.StationsBase
|
@@ -46,7 +46,8 @@ So there is:
|
|
46
46
|
- "raw" : the raw measurements as on the DWD server
|
47
47
|
- "qc" : The quality checked data
|
48
48
|
- "filled" : The filled timeseries
|
49
|
-
- "filled_by" : The station ID of the station from which the data was taken to fill the measurements
|
49
|
+
- "filled_by" : The station ID of the station from which the data was taken to fill the measurements.
|
50
|
+
If the value was filled by linear intrepolation "filled_by" is `-1`
|
50
51
|
- "corr" : The Richter corrected timeserie.
|
51
52
|
|
52
53
|
If you want more than just one kind of timeseries, e.g. the filled timeseries, together with the id from which station the respective field got filled with use:
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
; Those are configs that should get loaded, when the test files are loaded
|
2
|
+
[data:rasters]
|
3
|
+
DEMS = ${data:BASE_DIR}/DEM/COP-DEM_GLO-30-DGED__2023_1_clipped.tif
|
4
|
+
|
5
|
+
[data:rasters:hyras]
|
6
|
+
FILE = ${data:BASE_DIR}/regionalisation/HYRAS_ma_1991_2020_DGM25_clipped.tif
|
7
|
+
BAND_P_WIHY = n_hyras_wihj
|
8
|
+
BAND_P_SUHY = n_hyras_sohj
|
9
|
+
BAND_P_YEAR = n_hyras_year
|
10
|
+
SRID = 3035
|
11
|
+
FACTOR_P_WIHY = 1
|
12
|
+
FACTOR_P_SUHY = 1
|
13
|
+
FACTOR_P_YEAR = 1
|
14
|
+
|
15
|
+
[data:rasters:dwd]
|
16
|
+
FILE = ${data:BASE_DIR}/regionalisation/DWD-grid_ma_1991_2020_DGM25_clipped.tif
|
17
|
+
BAND_P_WIHY = n_wihj
|
18
|
+
BAND_P_SUHY = n_sohj
|
19
|
+
BAND_P_YEAR = n_year
|
20
|
+
BAND_T_YEAR = t_year
|
21
|
+
BAND_ET_YEAR = et_year
|
22
|
+
SRID = 3035
|
23
|
+
FACTOR_P_WIHY = 1
|
24
|
+
FACTOR_P_SUHY = 1
|
25
|
+
FACTOR_P_YEAR = 1
|
26
|
+
FACTOR_T_YEAR = 0.1
|
27
|
+
FACTOR_ET_YEAR = 1
|
28
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.2.1"
|
@@ -647,8 +647,9 @@ class Broker(object):
|
|
647
647
|
is_active : bool
|
648
648
|
Whether the broker is active.
|
649
649
|
"""
|
650
|
+
if self._is_active != is_active:
|
651
|
+
self.set_setting("broker_active", str(is_active))
|
650
652
|
self._is_active = is_active
|
651
|
-
self.set_setting("broker_active", str(is_active))
|
652
653
|
|
653
654
|
def _deactivate(self):
|
654
655
|
self.is_active = False
|
@@ -664,4 +665,13 @@ class Broker(object):
|
|
664
665
|
yield self
|
665
666
|
finally:
|
666
667
|
self._deactivate()
|
667
|
-
atexit.unregister(self._deactivate)
|
668
|
+
atexit.unregister(self._deactivate)
|
669
|
+
|
670
|
+
def force_deactivate_all(self):
|
671
|
+
"""Forcefully set the active broker flag in the database to deactivated.
|
672
|
+
|
673
|
+
This is useful if the broker got exited before it could deactivate itself.
|
674
|
+
"""
|
675
|
+
if self.is_active:
|
676
|
+
self._deactivate()
|
677
|
+
self.set_setting("broker_active", "False")
|
@@ -16,6 +16,7 @@ import weatherdb
|
|
16
16
|
show_default=True
|
17
17
|
)
|
18
18
|
)
|
19
|
+
@click.version_option(weatherdb.__version__)
|
19
20
|
@click.option('--do-logging/--no-logging',
|
20
21
|
is_flag=True, default=True, show_default=True,
|
21
22
|
help="Should the logging be done to the console?")
|
@@ -98,8 +99,11 @@ def create_user_config(file, on_exists):
|
|
98
99
|
def download_ma_rasters(which, overwrite, update_user_config):
|
99
100
|
"""Get the multi annual rasters on which bases the regionalisation is done.
|
100
101
|
|
101
|
-
The refined multi annual datasets, that are downloaded are published on Zenodo
|
102
|
-
|
102
|
+
The refined multi annual datasets, that are downloaded are published on Zenodo. [1]_
|
103
|
+
|
104
|
+
References:
|
105
|
+
-----------
|
106
|
+
.. [1] Schmit, M.; Weiler, M. (2023). German weather services (DWD) multi annual meteorological rasters for the climate period 1991-2020 refined to 25m grid (1.0.0) [Data set]. Zenodo. `DOI:10.5281/zenodo.10066045 <https://doi.org/10.5281/zenodo.10066045>`_
|
103
107
|
"""
|
104
108
|
click.echo("starting downloading multi annual raster data")
|
105
109
|
from weatherdb.utils.get_data import download_ma_rasters
|
@@ -127,7 +131,7 @@ def download_ma_rasters(which, overwrite, update_user_config):
|
|
127
131
|
help="The service to use to download the DEM. Options are 'prism' or 'openTopography'. " +\
|
128
132
|
"You can use this option muultiple times to test both in the given order until the file could be downloaded.")
|
129
133
|
def download_dem(out_dir, overwrite, extent, update_user_config, service="prism"):
|
130
|
-
"""Download the newest DEM data from the Copernicus Sentinel dataset.
|
134
|
+
"""Download the newest DEM data from the Copernicus Sentinel dataset. [1]_
|
131
135
|
|
132
136
|
Only the GLO-30 DEM, wich has a 30m resolution, is downloaded as it is freely available.
|
133
137
|
If you register as a scientific researcher also the EEA-10, with 10 m resolution, is available.
|
@@ -136,8 +140,9 @@ def download_dem(out_dir, overwrite, extent, update_user_config, service="prism"
|
|
136
140
|
After downloading the data, the files are merged and saved as a single tif file in the data directory in a subfolder called 'dems'.
|
137
141
|
To use the DEM data in the WeatherDB, you will have to define the path to the tif file in the configuration file.
|
138
142
|
|
139
|
-
|
140
|
-
|
143
|
+
References:
|
144
|
+
-----------
|
145
|
+
.. [1] Copernicus DEM - Global and European Digital Elevation Model. Digital Surface Model (DSM) provided in 3 different resolutions (90m, 30m, 10m) with varying geographical extent (EEA: European and GLO: global) and varying format (INSPIRE, DGED, DTED). `DOI:10.5270/ESA-c5d3d65 <https://doi.org/10.5270/ESA-c5d3d65>`_
|
141
146
|
"""
|
142
147
|
click.echo("Starting downloading digital elevation model from Copernicus")
|
143
148
|
from weatherdb.utils.get_data import download_dem
|
@@ -221,6 +226,16 @@ def set_db_version():
|
|
221
226
|
else:
|
222
227
|
click.echo("aborting setting db version")
|
223
228
|
|
229
|
+
@cli.command(short_help="Forcefully set the active broker flag in the database to deactivated. This is useful if the broker got exited before it could deactivate itself. (!!!Only use this if you're sure that the database did all the necessary updates!!!)")
|
230
|
+
def force_deactivate_all_broker():
|
231
|
+
click.echo(dedent("""
|
232
|
+
Are you sure that there is no more broker running? This could lead to problems as multiple brokers could run at the same time contradicting themself."""))
|
233
|
+
if click.confirm("Are you sure you want to set the activation flag in the database to deactivated?"):
|
234
|
+
click.echo("deactivating the brokers flag")
|
235
|
+
broker = weatherdb.broker.Broker()
|
236
|
+
broker.force_deactivate_all()
|
237
|
+
else:
|
238
|
+
click.echo("aborting the deactivation of the brokers flag")
|
224
239
|
|
225
240
|
# cli
|
226
241
|
# ---------------------------------------
|
@@ -143,17 +143,46 @@ RASTER_BUFFER_CRS = ${weatherdb:HORIZON_CRS}
|
|
143
143
|
; The default is 1999-01-01
|
144
144
|
MIN_DATE = 1999-01-01
|
145
145
|
|
146
|
+
[weatherdb:LINEAR_INTERPOLATION_LIMIT]
|
147
|
+
; When there are still NAs after filling with neighboring stations, the module can use linear interpolation to fill the gaps
|
148
|
+
; The limit defines the maximum interval that is allowed to fill with linear interpolation
|
149
|
+
; The value is given with a unit, e.g. 3 days, 30 minutes, 1 hour
|
150
|
+
; For further explanation about the format see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
|
151
|
+
; for precipitation, where the timeseries resolution is 10 minutes, 30 minutes means 3 missing values are interpolated, but not more.
|
152
|
+
; If there shouldn't be any linear interpolation, set the limit to 0
|
153
|
+
; For precipitation, the default is 1 hour
|
154
|
+
P = 1 hour
|
155
|
+
; For temperature, the default is 2 days
|
156
|
+
T = 2 days
|
157
|
+
; For Evapotranspiration, the default is 2 days
|
158
|
+
ET = 2 days
|
159
|
+
|
146
160
|
|
147
161
|
[weatherdb:max_fillup_distance]
|
148
162
|
; The maximum distance in meters to use for the filling of the station data
|
149
163
|
; For each parameter (P, T, ET) the module uses a different distance
|
150
164
|
; Precipitation (P)
|
151
|
-
P =
|
165
|
+
P = 130000
|
152
166
|
; Temperature (T)
|
153
167
|
T = 150000
|
154
168
|
; Evapotranspiration (ET)
|
155
169
|
ET = 150000
|
156
170
|
|
171
|
+
|
172
|
+
[system:parallel_processes]
|
173
|
+
; You can configure how many processes are getting started in parrallel when tghe database is updated.
|
174
|
+
; depending on your system, the database can handle more or less processes
|
175
|
+
; There are 2 possible ways to configure this.
|
176
|
+
; either define the absolute number of processes:
|
177
|
+
; ABSOLUTE =
|
178
|
+
|
179
|
+
; or define the number of processes in relation to the number of CPUs,
|
180
|
+
; by defining how many CPUs should be used less than the maximum available CPUs
|
181
|
+
; if the absolute number is defined, the relative number is ignored
|
182
|
+
; This is the default setting of cpu count -1
|
183
|
+
CPU_COUNT_MINUS = 1
|
184
|
+
|
185
|
+
|
157
186
|
; for developpers:
|
158
187
|
; ----------------
|
159
188
|
;
|