Skip to main content

Provides access to the Global Lake Level Database and extended functionality for lake water level analysis

Project description

LakePy

DOI

LakePy is the pythonic user-centered front-end to the Global Lake Level Database. This package can instantly deliver lake water levels for some 2000+ lakes scattered across the globe. Data comes from three sources (so far!)

Funding for this work comes from the Earth Science Information Partners (ESIP) Winter 2020 Grant

See the funded proposal here

Motivation

Lake level data is incredibly important to federal and local governments, scientists, and citizens. Until now, accessing lake level data involves laborious data-preparation and wrangling. We aim to provide this data quickly and on-demand.

Software Used

Built with

Quickstart

Installation

pip install lakepy

if you are using conda for package management you can still use pip!

Searching the Global Lake Level Database

The database can be searched using a name, a source ("grealm", "hydroweb", or "usgs"), or an identification number . The best practice for searching is to first specify a name.

Let's search for Lake Mead instantiating a Lake() object.

import lakepy as lk
my_lake = lk.search("mead")

If there is more than one Lake matching "Mead", the search function will return a RuntimeWarning and display a table.

"Search Result: 'Mead' has more than 1 Result. Showing the 2 most relevant results. Specify 'id_No' or narrow search name."

id_No source lake_name
0 138 hydroweb Mead
1 1556 usgs MEAD LAKE WEST BAY NEAR WILLARD, WI

We will select id_No 138 corresponding to Lake Mead from HydroWeb's database and re-run our search 1 of 2 ways:

  • Specify the id_No explicitly as a string
my_lake = lk.search(id_No = "138")
  • Specify a name and a source
my_lake = lk.search(name="mead", source="hydroweb", markdown=True)

We highly recommend specifying an id_No whenever possible to avoid issues with similarly named lakes. Either way , the search returns a metadata markdown dataframe

id_No source lake_name basin status country end_date latitude longitude identifier start_date
0 138 hydroweb Mead Colorado research USA 2014-12-29 00:21 36.13 -114.45 L_mead 2000-06-14 10:22

It is important to note that different databases will return different types and amounts of metadata. Currently latitude & longitude are only available from the USGS and HydroWeb databases, but GREALM lakes will soon have them!

Lake() object

The "my_lake" variable is now an object of class Lake() which comes with several attributes

  • name
  • country
  • continent (currently not supported for HydroWeb)
  • source
  • original_id
  • id_No
  • observation_period
  • latitude (currently not supported for G-REALM)
  • longitude (currently not supported for G-REALM)
  • misc_data
  • dataframe
  • data

importantly, my_lake.dataframe and my_lake.data are pandas dataframe instances with associated methods

my_lake.dataframe.describe().to_markdown()
water_level
count 119
mean 342.807
std 7.34547
min 330.75
25% 337.905
50% 342.26
75% 347.555
max 365.43

Plotting

LakePy allows for native time series plotting as well as map-view plots

my_lake.plot_timeseries()

Plotly (default)

Seaborn/Matplotlib

my_lake.plot_timeseries(how='seaborn')

my_lake.plot_mapview()

API Reference

Please refer to the LakePy documentation

Contribute

We would love your help in making this project better. Please refer to our contribution guide to learn how.

Citing LakePy

Please consider citing us if you use LakePy in your research! The recommended citation is:

James Gearon, & John Franey. (2021, January 4). ESIPFed/LakePy v2.1.0 (Version v2.1.0). Zenodo. http://doi.org/10. 5281/zenodo.4415936

Credits

This work is based on funding provided by the ESIP Lab with support from the National Aeronautics and Space Administration (NASA), National Oceanic and Atmospheric Administration (NOAA) and the United States Geologic Survey (USGS). LakePy received additional, generous support in 2021 from Derek Masaki and Farial Shahnaz. Many thanks to them.

License

MIT © James Hooker Gearon & John Franey

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

lakepy-3.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

lakepy-3.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file lakepy-3.1.tar.gz.

File metadata

  • Download URL: lakepy-3.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for lakepy-3.1.tar.gz
Algorithm Hash digest
SHA256 05585e365d9e27d691a7476e3011c9abceab0c2de5424e834f5f71b2f7ff61b6
MD5 ce312218d15f6b1003a0d6b2645ba068
BLAKE2b-256 db2821a047d9eeb6eec9bcd012b99a6f5345d2b6c6a09337338138f26a43e74a

See more details on using hashes here.

File details

Details for the file lakepy-3.1-py3-none-any.whl.

File metadata

  • Download URL: lakepy-3.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for lakepy-3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 384af036604925321abee649a4f6872b429217176ff0cb6b52690f80e766bf27
MD5 694cbe7f32d61f3f06785d5e04657571
BLAKE2b-256 3123c575f956976b9280ec8c6b064a612704d3dd1ef4dae89f759ca1b0bc092d

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