Load `U.S. Climate Reference Network <https://www.ncei.noaa.gov/access/crn/>`__ (USCRN) data.
Project description
uscrn
Easily load U.S. Climate Reference Network (USCRN) data.
With uscrn, fetching and loading years of data for all USCRN sites[^a] takes just one line of code[^b].
Example:
import uscrn
df = uscrn.get_data(2019, "hourly", n_jobs=6) # pandas.DataFrame
ds = uscrn.to_xarray(df) # xarray.Dataset, with soil depth dimension if applicable (hourly, daily)
Both df (pandas) and ds (xarray) include dataset and variable metadata.
For df, these are in df.attrs and can be preserved by
writing to Parquet with the PyArrow engine[^d] with
pandas v2.1+.
df.to_parquet("uscrn_2019_hourly.parquet", engine="pyarrow")
Conda install example[^c]:
conda create -n crn -c conda-forge python=3.11 joblib numpy pandas pyyaml requests xarray pyarrow netcdf4
conda activate crn
pip install --no-deps uscrn
[^a]: Use uscrn.load_meta() to load the site metadata table.
[^b]: Not counting the import statement...
[^c]: uscrn is not yet on conda-forge.
[^d]: Or the fastparquet engine with fastparquet v2024.2.0+.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uscrn-0.2.0.tar.gz.
File metadata
- Download URL: uscrn-0.2.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8cd00d8d079cdb3e78e0df37a1a040bf2ff79e613bf74b5fc8a237ede6ecfaf
|
|
| MD5 |
0f9d3f2a4462544e14518504a5c4c533
|
|
| BLAKE2b-256 |
2cd1fd185f3256acfe1255b2bf34c121e42281b0be4fd5b62f4e3b63995c5dc7
|
File details
Details for the file uscrn-0.2.0-py3-none-any.whl.
File metadata
- Download URL: uscrn-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef12dd3a6ce19e2beca99a0cf94332cdd6a8a39897a4e0b549d3ee9483f7fce
|
|
| MD5 |
0b114e789de185a2f6a787605fd4bbab
|
|
| BLAKE2b-256 |
8f81e41366e41b9acc79dde8c29e2519a11dbea4b2b812cb68244debf182224c
|