Skip to main content

BoM Water

A python tool for requesting data from BoM Sensor Observation Service (SOS2, as WaterML 2.0 format)

website license status CI pypi codecov

This package has been developed to access to the BoM Water Data Sensor Observation Service (SOS) with a goal to easily and efficiently integrate data into scientific workflows

License

MIT-derived (see License.txt)

Installation

From pypi:

pip install pybomwater

From source:

  • Using poetry
    • I like to keep the .venv in my project directory so I use poetry config --local virtualenvs.in-project true
    • poetry install which will install the dependencies listed in the poetry.lock
    • poetry shell which is initialize the environment within your running application (eg cmd), or in VS Code Cmd+Shift+p and then type Python Interpreter and select the environment you just built.

Usage

see Jupyter Notebook example


NOTE

The first time a BomWater object is instantiated (bm = bom_water.BomWater()) a cache of data is created. This process obtains data from the BoM service and will take a little while to complete. Once cached this process is not repeated and performance will return to normal.


Running tests

By default, pytest skips tests that call the live BoM SOS service. To run those integration tests explicitly:

PYBOMWATER_RUN_LIVE=1 pytest -m live_bom

The progressive observation load test is gated separately. It makes five increasingly large requests, stops immediately on HTTP 429, and prints timings, response sizes, observation counts, and any rate-limit headers:

PYBOMWATER_RUN_LOAD=1 pytest -m load_bom -s

The companion notebook test is also gated separately. It clones bomwater-notebook into a temporary directory and executes every notebook against the current pybomwater checkout. Install its optional runtime and run it with:

python -m pip install -r requirements-notebooks.txt

PYBOMWATER_RUN_NOTEBOOKS=1 pytest -m notebook_bom -s

Documentation

Bureau of Meteorology (BoM) documentation on using their SOS service is available at the following links:

The following cells implement requests that access the BoM SOS2 service.

GetCapabilties

Lists services available and the filters that can be used to select data output by those services. It also provides an overview of parameters, time series types and geographic area covered by the services.

GetFeatureOfInterest

Provides details about a set of geographical features or locations at which observations are measured. They can be selected according to the parameter measured, type of time series available, and area or point location.

GetDataAvailability

Lists the type of data available for a ‘feature of interest’ and its coverage. This includes a list of parameters, the time series types available for each of the parameters, and the observed period of record for each time series type.

GetObservation

Returns observations of a specified ‘feature of interest’ and parameter, within a specific time series type. Each observation has a datetime, value, quality and interpolation type.

Parameter currently available via SOS2

Parameter Water regulation Data Subcategory
Dry Air Temperature 4f
Electrical Conductivity @ 25C 9a
Evaporation 4c
Ground Water Level 2a
Rainfall 4a
Relative Humidity 4h
Storage Level 3a
Storage Volume 3b
Turbidity 9d
Water Course Discharge (standard time series types) 1b
Water Course Discharge (flood warning time series types) 11b
Water Course Level (standard time series types) 1a
Water Course Level (flood warning time series types) 11a
Water pH 9g
Water Temperature 9h
Wind Direction 4

Timeseries pattern and aggreated available

Time series name Procedure Identifier Time series description
DMQaQc.Merged.DailyMean.24HR Pat1_C_B_1_DailyMean or Pat9_C_B_1_DailyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to daily means, reported from midnight to midnight.
DMQaQc.Merged.DailyMax.24HR Pat1_C_B_1_DailyMax or Pat9_C_B_1_DailyMax Maximum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight
DMQaQc.Merged.DailyMin.24HR Pat1_C_B_1_DailyMin or Pat9_C_B_1_DailyMin Minimum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.MonthlyMean.CalMonth Pat1_C_B_1_MonthlyMean or Pat9_C_B_1_MonthlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to monthly means.
DMQaQc.Merged.YearlyMean.CalYear Pat1_C_B_1_YearlyMean or Pat9_C_B_1_YearlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to yearly means.
DMQaQc.Merged.DailyTotal.09HR Pat2_C_B_1_DailyTot09 DMQaQc.Merged.AsStored.1 timeseries aggregated to daily totals, reported from 9am to 9am.
DMQaQc.Merged.DailyTotal.24HR Pat2_C_B_1_DailyTot24 DMQaQc.Merged.AsStored.1 timeseries aggregated to daily totals,reported from midnight to midnight.
DMQaQc.Merged.MonthlyTotal.CalMonth Pat2_C_B_1_MonthlyTot24 DMQaQc.Merged.AsStored.1 timeseries aggregated to monthly totals.
DMQaQc.Merged.YearlyTotal.CalYear Pat2_C_B_1_YearlyTot24 DMQaQc.Merged.AsStored.1 timeseries aggregated to yearly totals.
DMQaQc.Merged.HourlyMean.HR Pat3_C_B_1_HourlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to hourly means.
DMQaQc.Merged.DailyMean.24HR Pat3_C_B_1_DailyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to daily means, reported from midnight to midnight.
DMQaQc.Merged.DailyMax.24HR Pat3_C_B_1_DailyMax Maximum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.DailyMin.24HR Pat3_C_B_1_DailyMin Minimum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.MonthlyMean.CalMonth Pat3_C_B_1_MonthlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to monthly means.
DMQaQc.Merged.YearlyMean.CalYear Pat3_C_B_1_YearlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to yearly means.
DMQaQc.Merged.HourlyMean.HR Pat4_C_B_1_HourlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to hourly means.
DMQaQc.Merged.DailyMean.09HR Pat4_C_B_1_DailyMean09 DMQaQc.Merged.AsStored.1 timeseries aggregated to daily means, reported from 9am to 9am.
DMQaQc.Merged.DailyMax.24HR Pat4_C_B_1_DailyMax Maximum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.DailyMin.24HR Pat4_C_B_1_DailyMin Minimum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.DailyMean.24HR Pat4_C_B_1_DailyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to daily means, reported from midnight to midnight.
DMQaQc.Merged.MonthlyMean.CalMonth Pat4_C_B_1_MonthlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to monthly means.
DMQaQc.Merged.YearlyMean.CalYear Pat4_C_B_1_YearlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to yearly means.
DMQaQc.Merged.HourlyMean.HR Pat6_C_B_1_HourlyMean or Pat7_C_B_1_HourlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to hourly means.
DMQaQc.Merged.DailyMean.24HR Pat6_C_B_1_DailyMean or Pat7_C_B_1_DailyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to daily means, reported from midnight to midnight.
DMQaQc.Merged.DailyMax.24HR Pat6_C_B_1_DailyMax or Pat7_C_B_1_DailyMax Maximum of values in theDMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.DailyMin.24HR Pat6_C_B_1_DailyMin or Pat7_C_B_1_DailyMin Minimum of values in the DMQaQc.Merged.AsStored.1 timeseries - from midnight to midnight.
DMQaQc.Merged.MonthlyMean.CalMonth Pat6_C_B_1_MonthlyMean or Pat7_C_B_1_MonthlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to monthly means.
DMQaQc.Merged.YearlyMean.CalYear Pat6_C_B_1_YearlyMean or Pat7_C_B_1_YearlyMean DMQaQc.Merged.AsStored.1 timeseries aggregated to yearly means.

Task list

Metadata

Release files for pybomwater 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybomwater 0.1.5
File Size Uploaded
pybomwater-0.1.5.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybomwater 0.1.5
File Interpreter ABI Platform
pybomwater-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 MB

Release files / pybomwater-0.1.5.tar.gz

Download URL pybomwater-0.1.5.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
ccde7594796c9e8f622c940e8e18143cffc75caef16d4c5f6c67f56c9e67b35c
BLAKE2b-256 checksum
How to use checksums
56a44cda7bb7c91e4b0f0229e056648cb84108ec86e02b73d9de30daa07bc33a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.0 Windows/11

Release files / pybomwater-0.1.5-py3-none-any.whl

Download URL pybomwater-0.1.5-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b3f21f1686dcabe8b27e9bebadd125cc353a0f4b84cb5730010416a6b24167ba
BLAKE2b-256 checksum
How to use checksums
274d7722cc0a6fa66d7aef8f6732e38c82fb41d46d7ce948a5f81a44726bd8af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.0 Windows/11

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page