Skip to main content

Module by Artesia for loading observation data into custom DataFrames.

Project description

Artesia

PyPi PyPi Supported Python Versions Binder

hydropandas Codacy Badge Codacy Badge Documentation Status

Format: isort Format: Black Linter: flake8 Linter: ruff

HydroPandas

Hydropandas is a Python package for reading, analyzing and writing (hydrological) timeseries data.

Introduction

The HydroPandas package allows users to store a timeseries and metadata in a single object. This object inherits from a pandas DataFrame, with all its wonderful features, and is extended with custom methods and attributes related to hydrological timeseries.

The HydroPandas package also provides convenient read functions for Dutch hydrological data from:

Install

Install the module with pip:

pip install hydropandas

HydroPandas requires pandas, scipy, matplotlib, tqdm, requests and colorama.

For some functionality additional packages are required:

  • geopandas: for dealing with shapefiles
  • pastastore: for reading or storing data from PastaStore
  • bokeh, branca, folium: for interactive maps
  • flopy: for reading data from MODFLOW models
  • xarray: for loading data from REGIS

For installing in development mode, clone the repository and install by typing pip install -e . from the module root directory. For installing all the optional packages use pip install -e .[full].

Get in touch

Examples

Importing a groundwater time series from the BRO using the BRO-id and the tube number:

import hydropandas as hpd
gw_bro = hpd.GroundwaterObs.from_bro("GMW000000041261", 1)

Or import all groundwater time series from the BRO within a certain extent:

oc = hpd.read_bro(extent=(117850, 118180, 439550, 439900))

The Obs class

The Obs class holds the measurements and metadata for one timeseries. There are currently 5 specific Obs classes for different types of measurements:

  • GroundwaterObs: for groundwater measurements
  • WaterQualityObs: for groundwater quality measurements
  • WaterlvlObs: for surface water level measurements
  • ModelObs: for "observations" from a MODFLOW model
  • MeteoObs: for meteorological observations
  • PrecipitationObs: for precipitation observations, subclass of MeteoObs
  • EvaporationObs: for evaporation observations, subclass of MeteoObs

Each of these Obs classes is essentially a pandas DataFrame with additional methods and attributes related to the type of measurement that it holds. Each Obs object also contain specific methods to read data from specific sources.

The ObsCollection class

The ObsCollection class, as the name implies, represents a collection of Obs classes, e.g. 10 timeseries of the groundwater level in a certain area. The ObsCollection is also a pandas DataFrame in which each timeseries is stored in a different row. Each row contains metadata (e.g. latitude and longitude of the observation point) and the Obs object (DataFrame) that holds the measurements. It is recommended to let an ObsCollection contain only one Obs type, e.g. to create an ObsCollection for 10 GroundwaterObs, and a separate ObsCollection for 5 PrecipitationObs.

Like the Obs class, the ObsCollection class contains a bunch of methods for reading data from different sources. See the next section for supported data sources.

Authors

  • Onno Ebbens, Artesia
  • Ruben Caljé, Artesia
  • Davíd Brakenhoff, Artesia
  • Martin Vonk, Artesia

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

hydropandas-0.11.3.tar.gz (154.6 kB view details)

Uploaded Source

Built Distribution

hydropandas-0.11.3-py3-none-any.whl (153.2 kB view details)

Uploaded Python 3

File details

Details for the file hydropandas-0.11.3.tar.gz.

File metadata

  • Download URL: hydropandas-0.11.3.tar.gz
  • Upload date:
  • Size: 154.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for hydropandas-0.11.3.tar.gz
Algorithm Hash digest
SHA256 46493c653bea084a129f5dee6654fc3f567589bfcc20b2bf114bb64638cc4f55
MD5 8c50d287af7c85047d3c8eae6c17e4ea
BLAKE2b-256 2aae43b87971a00898bc7180c14cfc1bce7dbd6a81be7b9ddf14b97a9852f667

See more details on using hashes here.

File details

Details for the file hydropandas-0.11.3-py3-none-any.whl.

File metadata

  • Download URL: hydropandas-0.11.3-py3-none-any.whl
  • Upload date:
  • Size: 153.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for hydropandas-0.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 95ae6c78ae1a0cdd385f6abc99791d19996c0190e2e19d02451f095841c028c1
MD5 767e0aa3243ca8408cf0014e1a03c7ae
BLAKE2b-256 3b1b14655ca32dacd925f8aaf6a3455abf9b82bbd73d56d18666d4b838d4abd2

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