Facilitates waterflow gauge data ingest from several endpoints. Dependency to several other projects.
Project description
MDBA Gauge Getter
Description
MDBA Gauge Getter provides a unified and simple interface to collect surface water data from the following state water portals:
State | Site | Source |
---|---|---|
NSW | realtimedata.waternsw.com.au | CP |
QLD | water-monitoring.information.qld.gov.au | PUBLISH |
VIC | data.water.vic.gov.au | AT |
SA | bom.gov.au/waterdata/ | BOM Water Data Online |
The tool is configured to abstract away the details specific to each state water portal and return a consistent structure. By default it will return a daily mean of a flow in ML/day for a given gauge number, but storage level, storage volume, other intervals and aggregations are available.
Example of its use can be seen in Gauge_getter_example.ipynb notebook, contact ben.bradshaw@mdba.gov.au for more details.
Local Installation via git
- Clone the repo in your local folder: for example, inside
~./users/john.doe
git clonehttps://github.com/MDBAuth/MDBA_Gauge_Getter.git
which will create a git tracked project repository inside~./users/john.doe/mdba_gauge_getter
. - Create a virtual environment: for example,
conda create --name gauge_getter_env
. - Activate the virtual environment:
conda activate gauge_getter_env
. - Go inside the project folder i.e.,
cd ~./users/john.doe/mdba_gauge_getter
. - Check
git status
andgit branch
. - Install dependencies with
pip3 install -r requirements.txt
- (Optionally) install dev dependencies with
pip3 install -r requirements-dev.txt
- Run
python3 setup.py install
to install the module
Quick Start
- Install via pip with the command:
pip install mdba-gauge-getter
- After installation, import the package with the command:
import mdba_gauge_getter.gauge_getter as gg
- Import datetime for converting your intervals into python datetime object:
import datetime as dt
Usage
There are several options to call Gauge Getter which are as follows:
gauge_numbers
denotes the gauge(s) for which the parameters such as flow, lake/storage level, storage volume etc. will be obtained. It takes a list of strings (gauge numbers) as input.start_time_user
denotes the start time of the userdefined interval. It takes a datetime python object as input.end_time_user
denotes the end time of the userdefined interval. It takes a datetime python object as input.data_source
denotes which state the gauge(s) belong(s) to which API to fetch the data from. Please note that SA does not currently have an API to obtain the data from; hence, the data is fetched from the BOM API. Different data_source options are:- i.e., 'NSW', 'VIC', 'QLD', 'SA'/'BOM'
- 'BOM'
var
denotes the parameter to retreieve such as flow, lake/storage level, storage volume etc. It takes a string indicating the parameter type as input. Different string notation for different var options are:- 'F' for flow (default).
- 'L' for water level used for flow calculation.
- 'LL'/'SL' for lake/storage level.
- 'SV' for storage volume. Please note that this is exclusively a BOM API parameter. Please specify the data source as 'BOM' if you would like to retrieve this parameter.
interval
indicates the duration the parameter data are collected for aggregation. Different interval options are:- 'day'. Alternate options for BOM API call is: 'd'.
- 'hour'. Alternate options for BOM API call is: 'h'.
- 'month'. Alternate options for BOM API call is: 'm'.
- 'year'. Alternate options for BOM API call is: 'y'.
data_type
inidcates the aggregation method. Different data_type options are:- 'mean' (default). Alternate options for BOM API call are: 'avg', 'average', 'av' and 'a'.
- 'min'. Alternate options for BOM API call is: 'minimum'. Only available when obtaining daily interval data.
- 'max'. Alternate options for BOM API call is: 'maximum'. Only available when obtaining daily interval data.
Support
For issues relating to the script, a tutorial, or feedback please contact Ben Bradshaw (ben.bradshaw@mdba.gov.au) or Ahsanul Habib (ahsanul.habib@mdba.gov.au).
For data issues please see the corresponding state water portals.
Project details
Release history Release notifications | RSS feed
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 mdba_gauge_getter-0.4.6.tar.gz
.
File metadata
- Download URL: mdba_gauge_getter-0.4.6.tar.gz
- Upload date:
- Size: 203.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69d89c364659539467054a3e6db923ecf96f9eff0c173c42c2f921dffb9a17c |
|
MD5 | 2be080706290c548397c59ddda41aa76 |
|
BLAKE2b-256 | e47a96fafc86496264a7b1d96e1145e7c0b9627b7cc2bf8ffdb084e37068e8ca |
File details
Details for the file mdba_gauge_getter-0.4.6-py3-none-any.whl
.
File metadata
- Download URL: mdba_gauge_getter-0.4.6-py3-none-any.whl
- Upload date:
- Size: 204.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4116b5fcc6375f53a5ba42d4d21b3b1b6c6fe99653fc5630e971bfc89c61390d |
|
MD5 | 5bb1b5c312e41db59bf26455f9b471ff |
|
BLAKE2b-256 | 9bb7111bb214ec7fb007d40e99491fb5088ce49cc1a8d9b2b5f5c07e49708001 |