Skip to main content

No project description provided

Project description

WHOS data retrieval functionality for HydroSOS

Purpose

To facilitate interoperable timeseries data retrieval from the WHOS (WMO Hydrological Observations System).

How to use

  1. Install this module (see Installation)

  2. Register into WHOS and save your access token

  3. Explore WHOS portals and search engines to select the timeseries of interest

  1. Take note of the feature id (site) plus observedProperty, or the observationIdentifier

  2. Use either a python script or notebook (see get_test.ipynb) or the command line interface to get the data (see get_test.sh) for a given time period

Installation

python3 -m venv .
source bin/activate
pip3 install -r requirements

Output

Output format is either:

  • a JSON-serializable list of dicts:

    [
      {
        "date": "ISO format date string",
        "value": float
      },
      ...
    ]
    
  • or CSV:

    date,value
    string,float
    ...
    

Command line interface

data

Usage: om_ogc_timeseries_client.py data [OPTIONS] BEGIN_POSITION END_POSITION

Options:
  -t, --token TEXT                WHOS access token
  -u, --url TEXT                  WHOS OM OGC timeseries API url
  -o, --output TEXT               Save result into this file (instead of print
                                  on stdout)
  -c, --csv                       Use CSV format for output (instead of JSON)
  -m, --monitoring_point TEXT     site identifier. It must be user together
                                  with --variable_name
  -v, --variable_name TEXT        variable identifier. It must be used
                                  together with --monitoring_point
  -s, --timeseries_identifier TEXT
                                  timeseries identifier. If set,
                                  --monitoring_point and --variable_name are
                                  ignored
  --help                          Show this message and exit.

metadata

$ python om_ogc_timeseries_client.py metadata --help
Usage: om_ogc_timeseries_client.py metadata [OPTIONS]

Options:
  -t, --token TEXT                WHOS access token
  -u, --url TEXT                  WHOS OM OGC timeseries API url
  -o, --output TEXT               Save result into this file (instead of print
                                  on stdout)
  -m, --monitoring_point TEXT     site (feature) identifier. It must be user
                                  together with --variable_name
  -v, --variable_name TEXT        variable identifier (=observedProperty). It
                                  must be used together with
                                  --monitoring_point
  -s, --timeseries_identifier TEXT
                                  timeseries identifier. If set,
                                  --monitoring_point and --variable_name are
                                  ignored
  -l, --limit INTEGER             pagination page size
  -h, --has_data                  return only observations with data
  -W, --west FLOAT                west longitude of bounding box
  -S, --south FLOAT               south latitude of bounding box
  -E, --east FLOAT                east longitude of bounding box
  -N, --north FLOAT               north latitude of bounding box
  -O, --ontology TEXT             The ontology to be used to expand the
                                  observed property search term (or URI) with
                                  additional terms from the ontology that are
                                  synonyms and associated to narrower
                                  concepts. Two ontologies are available: whos
                                  or his-central
  -V, --view TEXT                 Identifier of the data subset interesting
                                  for the user
  -T, --time_interpolation TEXT   The interpolation used on the time axis (for
                                  example, MAX, MIN, TOTAL, AVERAGE, MAX_PREC,
                                  MAX_SUCC, CONTINUOUS, ...)
  -i, --intended_observation_spacing TEXT
                                  The expected duration between individual
                                  observations, expressed as ISO8601 duration
                                  (e.g., P1D)
  -a, --aggregation_duration TEXT
                                  Time aggregation that has occurred to the
                                  value in the timeseries, expressed as
                                  ISO8601 duration (e.g., P1D)
  -f, --format TEXT               Response format (e.g. JSON or CSV)
  --help                          Show this message and exit.

Credits

Programa de Sistemas de Información y Alerta Hidrológico de la Cuenca del Plata

Laboratorio de Hidrología

Instituto Nacional del Agua

Argentina

2025-05-21

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

whosclient-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whosclient-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file whosclient-0.1.1.tar.gz.

File metadata

  • Download URL: whosclient-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for whosclient-0.1.1.tar.gz
Algorithm Hash digest
SHA256 938fadee77e3676db17803317b4323b78a3e3daeeb1353e5562791c53ededce3
MD5 5423329e2db98470b44ac053c3115a53
BLAKE2b-256 fa3227c40ad6f45b95358d0083050b995424f23acfa5bd4c1dc2b87e5da9cc4a

See more details on using hashes here.

File details

Details for the file whosclient-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: whosclient-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for whosclient-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c216f1012eb792f34b30827084e42edd2a91e42e4c1eab0aa79f7497f04326c
MD5 0e6cb3e72858b36b7e4a0f8386d21bca
BLAKE2b-256 cc74c13f6a511da223b5414bd324d37dab29f56c089c1e21c5f37df1cbf432dd

See more details on using hashes here.

Supported by

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