Skip to main content

Dashboard for groundwater time series validation.

Project description

PyPI - Version

GW DataLens: Dashboard for quality control of head observations

Example error detection result

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

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 .

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:

  1. Modify gwdatalens/app/config.toml, and set DJANGO_APP = true.
  2. Copy GW DataLens to the BRO-Connector root directory with cp_gwdatalens_to_broconnector [BRO_CONNECTOR_PATH] or modify the django_copy.py file to point to the correct path and run the file with python django_copy.py.
  3. Update main/urls.py file and main/settings/settings.py as outlined in this readme file: DJANGO_HELP
  4. Prepare the BRO-Connector application as outlined here
  5. Run the application with python manage.py runserver (from the directory containing the manage.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 resulting ObsCollection 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 pickled ObsCollection. Specify the data source ("dino" or "bro") of the file.
  • Specify an ObsCollection instance using oc=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:

  1. Select a head time series from a database. (Overview)
  2. Run a set of error-detection rules to identify potentially suspect measurements. (Error Detection)
  3. 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

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

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 nnearest KNMI station.

Error Detection tab

Automatic 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:

  1. Use the first dropdown to select or search for any time series in the database.
  2. Optionally modify the rules or parameters used for error detection under the Show Parameters button.
  3. Press the "Run TRAVAL" button.
  4. 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

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

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

gwdatalens-0.2.2.tar.gz (104.5 kB view details)

Uploaded Source

Built Distribution

gwdatalens-0.2.2-py3-none-any.whl (110.3 kB view details)

Uploaded Python 3

File details

Details for the file gwdatalens-0.2.2.tar.gz.

File metadata

  • Download URL: gwdatalens-0.2.2.tar.gz
  • Upload date:
  • Size: 104.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for gwdatalens-0.2.2.tar.gz
Algorithm Hash digest
SHA256 258bf8389c86024648b650eb9adcc6086a07a991119ddb2e7a1734a4877b6959
MD5 3f123a3253aed5792b075c7bf95f02c5
BLAKE2b-256 5efc6c377ec0b454bfe96a51064ffed1af764d0696c7124fc5a87a7668e3752e

See more details on using hashes here.

File details

Details for the file gwdatalens-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: gwdatalens-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 110.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for gwdatalens-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 199402cf1ec43ca08ce5302ec75b8d1b32b4229efeb7e40e412730fcb358bc62
MD5 f6d8c8d4f1c37c9137dd9063d1a40092
BLAKE2b-256 a2ac25e2fe9be450fd5a42f4338e17a9cd166759f89cf3672cbb8c9fb20aa9da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page