cli
This module contains the command line interface for the weatherDB package.
weatherDB
This is the Command line interface of the weatherDB package.
weatherDB [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
Options
- --do-logging, --no-logging
Should the logging be done to the console?
- Default:
True
- -c, --connection <connection>
The connection to use. Default is the value from the configuration file.
- -v, --verbose
Should the verbose mode be activated? -> This will print complete tracebacks on errors.
- Default:
False
create-db-schema
Create the database schema for the first time.
weatherDB create-db-schema [OPTIONS]
Options
- -o, --owner <owner>
The user that should get the ownership of the created tables and schemas. As default is the current user will be the owner.
create-user-config
Create User configuration file.
weatherDB create-user-config [OPTIONS]
Options
- -f, --file <file>
The file to save the user configuration to.
- Default:
'ask'
- -e, --on-exists <on_exists>
What to do if the file already exists. Options are ‘ask’, ‘overwrite’, ‘define’ or ‘error’.
- Default:
'ask'
download-dem
Download the newest DEM data from the Copernicus Sentinel dataset.
Only the GLO-30 DEM, wich has a 30m resolution, is downloaded as it is freely available. If you register as a scientific researcher also the EEA-10, with 10 m resolution, is available. You will have to download the data yourself and define it in the configuration file.
After downloading the data, the files are merged and saved as a single tif file in the data directory in a subfolder called ‘dems’. To use the DEM data in the WeatherDB, you will have to define the path to the tif file in the configuration file.
Source: 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.
weatherDB download-dem [OPTIONS]
Options
- -o, --overwrite, -no-o, --no-overwrite
Should the digital elevation model raster be downloaded even if it already exists?
- -e, --extent <extent>
The extent in WGS84 of the DEM data to download. The default is the boundary of germany + ~40km.
- Default:
5.3, 46.1, 15.6, 55.4
- -u, --update-user-config
Should the user configuration be updated with the path to the downloaded DEM?
- Default:
False
download-ma-rasters
Get the multi annual rasters on which bases the regionalisation is done.
The refined multi annual datasets, that are downloaded are published on Zenodo: 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. https://doi.org/10.5281/zenodo.10066045
weatherDB download-ma-rasters [OPTIONS]
Options
- -o, --overwrite <overwrite>
Should the multi annual rasters be downloaded even if they already exist?
- -w, --which <which>
Which raster to download. Options are ‘dwd’, ‘hyras’, ‘regnie’ or ‘all’.
- Default:
'all'
- -u, --update-user-config
Should the user configuration be updated with the path to the downloaded rasters?
- Default:
False
fillup
Do the filling of the complete database.
weatherDB fillup [OPTIONS]
quality-check
Do the quality check of the complete database.
weatherDB quality-check [OPTIONS]
richter-correct
Do the richter correction of the complete database.
weatherDB richter-correct [OPTIONS]
set-db-version
Set the db version to the current weatherDB version to prevent recalculation of the whole database. (!!!Only use this if you’re sure that the database did all the necessary updates!!!)
weatherDB set-db-version [OPTIONS]
update-db
Update the complete database. Get the newest data from DWD and treat it.
weatherDB update-db [OPTIONS]
update-ma-raster
Update the multi annual raster values in the database.
weatherDB update-ma-raster [OPTIONS]
update-meta
Update the meta data in the database. Get the newest meta data from DWD.
weatherDB update-meta [OPTIONS]
update-raw
Update the raw data of the complete database.
weatherDB update-raw [OPTIONS]
update-richter-class
Update the Richter classes of the precipitation stations in the database.
weatherDB update-richter-class [OPTIONS]
upgrade-db-schema
Use Alembic directly to update or downgrade the database schema. Have a look at the official alembic documentation for more information.
weatherDB upgrade-db-schema [OPTIONS]
Options
- -r, --revision <revision>
The revision ID (weatherDB Version e.g. ‘V1.0.2’) to upgrade/downgrade to.
- Default:
'head'