Skip to main content

Location Oriented Observed Meteorology (LOOM)

Project description

metloom

https://img.shields.io/pypi/v/metloom.svg Testing Status Documentation Status Code Coverage

Location Oriented Observed Meteorology

metloom is a python library created with the goal of consistent, simple sampling of meteorology and snow related point measurments from a variety of datasources across the Western US. metloom is developed by M3 Works as a tool for validating computational hydrology model results. Contributions welcome!

Warning - This software is provided as is (see the license), so use at your own risk. This is an opensource package with the goal of making data wrangling easier. We make no guarantees about the quality or accuracy of the data and any interpretation of the meaning of the data is up to you.

  • Free software: BSD license

Features

  • Sampling of daily, hourly, and snow course data

  • Searching for stations from a datasource within a shapefile

  • Current data sources:

Requirements

python >= 3.7

Install

python3 -m pip install metloom

Local install for dev

The recommendation is to use virtualenv, but other local python environment isolation tools will work (pipenv, conda) .. code-block:: bash

python3 -m pip install –upgrade pip python3 -m pip install -r requirements_dev python3 -m pip install .

Testing

pytest

If contributing to the codebase, code coverage should not decrease from the contributions. Make sure to check code coverage before opening a pull request.

pytest --cov=metloom

Documentation

readthedocs coming soon

https://metloom.readthedocs.io.

Usage

See usage documentation https://metloom.readthedocs.io/en/latest/usage.html

NOTES: PointData methods that get point data return a GeoDataFrame indexed on both datetime and station code. To reset the index simply run df.reset_index(inplace=True)

Usage Examples

Use metloom to find data for a station

from datetime import datetime
from metloom.pointdata import SnotelPointData

snotel_point = SnotelPointData("713:CO:SNTL", "MyStation")
df = snotel_point.get_daily_data(
    datetime(2020, 1, 2), datetime(2020, 1, 20),
    [snotel_point.ALLOWED_VARIABLES.SWE]
)
print(df)

Use metloom to find snow courses within a geometry

from metloom.pointdata import CDECPointData
import geopandas as gpd

fp = <path to shape file>
obj = gpd.read_file(fp)

vrs = [
    CdecStationVariables.SWE,
    CdecStationVariables.SNOWDEPTH
]
points = CDECPointData.points_from_geometry(obj, vrs, snow_courses=True)
df = points.to_dataframe()
print(df)

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2021-10-05)

  • This is the first release!

  • Create the package

  • Add CDEC functionality

  • Add SNOTEL functionality

  • Add CLI to find stations from shapefile

  • Write a custom Snotel client using zeep

0.2.0 (2021-12-29)

  • Added mesowest network

  • Added in a token json arg to the get_*_data functions

  • Pinned docutils for an update that happened

  • Added in a resample_df function for the highway stations where the returned data is 5min for air temp.

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

metloom-0.2.3.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

metloom-0.2.3-py2.py3-none-any.whl (26.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file metloom-0.2.3.tar.gz.

File metadata

  • Download URL: metloom-0.2.3.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for metloom-0.2.3.tar.gz
Algorithm Hash digest
SHA256 9a8c1c238a9e075d358f0266bd92a3cad6fd4dbf689b310745e34bf52d0c5168
MD5 297d94569fad457350736fb2ba917fad
BLAKE2b-256 860ab26abe984adaee8f6d53f318d556b3b88d52a1d61967c9738370ba889cd1

See more details on using hashes here.

File details

Details for the file metloom-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: metloom-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for metloom-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a575f97e65713f3b3d38d76668cd4603c2c78e38d1f3e508c188190117a8673
MD5 84bd9188868c68ff15148933ec7ce498
BLAKE2b-256 f5f66cf9e8c3cea24459c6dd44cbc4bed4174e7c1af865bb5fc9e27ce12c63b2

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