Location Oriented Observed Meteorology (LOOM)
Project description
metloom
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
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
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
from metloom.variables import CdecStationVariables
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file metloom-0.2.14.tar.gz
.
File metadata
- Download URL: metloom-0.2.14.tar.gz
- Upload date:
- Size: 40.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59254f7b9f3d7649c7dec4f884fdc2474bef64c8b53bec019ae350963720fd15 |
|
MD5 | fd42dba826ce5e4fa115afdbe122a29e |
|
BLAKE2b-256 | b3789d53dd76a272cba8da4f04ee16792f5054eb431fcd36b0c2869b25ecc079 |
File details
Details for the file metloom-0.2.14-py2.py3-none-any.whl
.
File metadata
- Download URL: metloom-0.2.14-py2.py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f03f1216346c2313ea737749ef0e21b8346f001602971d87ed4db419940bb5 |
|
MD5 | 43b9bb413692895babe037a29992b556 |
|
BLAKE2b-256 | 9d8d3af719efc6312e513edcb50bf5f661f46e831b0afdfe50cdf6cc3c4f6316 |