Dashboard for groundwater time series validation.
Project description
GW DataLens: Dashboard for quality control of head observations
GW DataLens is a dashboard that can be used to view and check head time series. This dashboard runs in a browser (e.g. Firefox, Chrome) and connects to a database (e.g. PostgreSQL, or Hydropandas ObsCollection) to load and run error detection algorithms on stored head time series.
Installation
Install gwdatalens
with:
pip install gwdatalens
Or clone the repository to your computer (or download a zip from GitHub and
extract it). Open a terminal (e.g. Terminal, Anaconda Prompt), navigate to the
folder containing the repository and install gwdatalens
with:
pip install -e .
Pixi environment
If you cloned gwdatalens, it comes with a pixi.toml
file. If you have pixi,
the application can be launched with the following command:
pixi run gwdatalens
Or activate the pixi environment using pixi shell
and launch the gwdatalens
from there.
Usage
The dashboard can be run both as a stand-alone application, or as part of the Django application BRO-Connector.
The settings for the dashboard are stored in the gwdatalens/app/config.toml
file.
Stand-alone
Currently, the app is set up to connect to a PostgreSQL database (a local copy of the Provincie Zeeland database). For more information about the database, see DJANGO HELP.
For a standalone run the configuration settings for the database (user,
password, host, etc.) are stored in the database.toml
file. See the
database_template.toml
file. Modify entries to match your database and rename
the file to database.toml
.
Once you have modified the TOML files for your setup, the dashboard can be launched from the command-line with:
gwdatalens [--debug True|False] [--port int] # --debug and --port are optional
BRO-Connector
For implementing GW DataLens under BRO-Connector, follow these steps:
- Modify
gwdatalens/app/config.toml
, and setDJANGO_APP = true
. - Copy GW DataLens to the BRO-Connector root directory with
cp_gwdatalens_to_broconnector [BRO_CONNECTOR_PATH]
or modify thedjango_copy.py
file to point to the correct path and run the file withpython django_copy.py
. - Update
main/urls.py
file andmain/settings/settings.py
as outlined in this readme file: DJANGO_HELP - Prepare the BRO-Connector application as outlined here
- Run the application with
python manage.py runserver
(from the directory containing themanage.py
file).
More background and information is available in DJANGO_HELP and at the BRO-Connector repository.
Using a HydroPandas ObsCollection as "database"
The application can also be run using a HydroPandas ObsCollection as a data source.
Replace the current PostgreSQLDataSource()
with HydropandasDataSource()
. This
data source can be instantiated in a few ways:
- specify an extent (xmin, xmax, ymin, ymax) and
source="bro"
. This will download all groundwater level observations within an extent, and store the resultingObsCollection
as a pickle-file (for faster loading next time). To update the data, delete the pickle-file and let the download run again. - specify a file name (e.g.
fname="oc.pkl"
) containing a pickledObsCollection
. Specify the data source ("dino"
or"bro"
) of the file. - Specify an
ObsCollection
instance usingoc=oc
.
See the documentation for HydropandasDataSource
for more information.
Data validation with GW DataLens
The GW DataLens dashboard can be used to validate/check groundwater measurements.
The validation process consists of the following steps:
- Select a head time series from a database. (Overview)
- Run a set of error-detection rules to identify potentially suspect measurements. (Error Detection)
- The time series is manually reviewed (accepting or rejecting) suggestions made by the error detection algorithm. (Manual Review)
Optionally, time series models can be inspected or created using the Time Series Models tab. These models can be used in the error detection step.
Overview tab
The overview tab consists of three elements:
- Interactive map view showing measurement locations (top left)
- Interactive table showing measurement location metadata (top right)
- Interactive chart showing time series (bottom)
There are two ways of plotting head time series:
- Select one or multiple (up to 10, this value can be changed in
config.toml
) measurement locations on the map using your mouse or the rectangle selection tool. - (Shift+)Click on row(s) in the table.
Time Series Models tab
The time series models tab allows users to create or inspect time series models using Pastas and Pastastore. Models are created using precipitation and evaporation from the nearest KNMI station.
Error Detection tab
The Error Detection tab lets you run automatic error detection schemes on head time
series (see the traval
package). The rules that
comprise the error detection algorithm are shown in the expandable section at the
bottom. The error detection rules that are applied can be modified or adjusted in the
dashboard.
Steps:
- Use the first dropdown to select or search for any time series in the database.
- Optionally modify the rules or parameters used for error detection under the
Show Parameters
button. - Press the "Run TRAVAL" button.
- The chart will update showing the original time series and the measurements that were deemed suspect by the error detection algorithm. If available a pastas model simulation and prediction interval are also shown in the chart.
Manual Review tab
The Manual Review tab lets you review the results of the error detection scheme and commit your manual review to the database, or download the results as a CSV file.
References
- Documentation for hydropandas.
- Documentation for pastas.
- Documentation for pastastore.
- Documentation for traval.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gwdatalens-0.2.4.tar.gz
.
File metadata
- Download URL: gwdatalens-0.2.4.tar.gz
- Upload date:
- Size: 5.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f819c93405d40ec5cb022802912c72191510f29b2eaca59d3c1a8fbd2a894ac |
|
MD5 | a651c567d221fa1f609a52c54c07e74f |
|
BLAKE2b-256 | 26bb0f0970c7c8ceedfa4f458ca93b1b900514847925be6b058b5b9f9651028f |
File details
Details for the file gwdatalens-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: gwdatalens-0.2.4-py3-none-any.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b89423d45c8481b694c315020e0e50baa51ce300ff79bc664fc49c17c0db0ea1 |
|
MD5 | 24edbc3b5e4b3cf18977f51c7d81f518 |
|
BLAKE2b-256 | bbebc584915af274c3f300da6997acdd1a72303225bedc30908565bcb5684c73 |