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.10 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
File details
Details for the file uscrn-0.2.0.dev0.tar.gz
.
File metadata
- Download URL: uscrn-0.2.0.dev0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5acc7ef04debcefc552ff1f2e01a4419298b297e2e2e1b54d5566a958cad86f3 |
|
MD5 | 3fb0372a67d743ce16ac97e5fbf8eefb |
|
BLAKE2b-256 | c29caac575948b66d5cb8a591ec9b19ece7dd0450edaab2aaf301aa50bc8b464 |
Provenance
File details
Details for the file uscrn-0.2.0.dev0-py3-none-any.whl
.
File metadata
- Download URL: uscrn-0.2.0.dev0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f430bde035aae87784aa28a53f5648e765d02366ffea2b7b578245b1195353 |
|
MD5 | 3d859519732ba40f2685b30e3a5a7c34 |
|
BLAKE2b-256 | b7d760e398782b45ea1858b4fda08b109be86970548a1653b439eb4f4d1d3281 |