Pipeline for downloading USGS site data, extracting events, and generating MRMS RadarOnly Zarr datasets.
Project description
Citation
If you use this package in your research, please cite:
Environment Setup & package Installation
(WSL required for Windows users due to GDAL/GRIB dependencies)
- Install Micromamba
curl -Ls https://micro.mamba.pm/install.sh | bash
source ~/.bashrc
micromamba --version
micromamba info
- Create and activate environment
micromamba create -n mrms_usgs_events -c conda-forge python=3.11 gdal geopandas libgdal-grib -y
micromamba activate mrms_usgs_events
- Install the package
python -m pip install --upgrade pip # Upgrade pip
Development mode (code modifications)
pip install -e .
User mode (No code modifications)
python -m pip install mrms-usgs-events # Install the package (Do NOT run if using development mode (-e))
- Verify installation
gdalinfo --formats | grep -i grib # Verify gdal grib
mrms-usgs --help # Verify installation
Example use for the Texas July 4 2025 event at the Mystic Camp. (Use at least 1 year between start and end)
mrms-usgs run-site 08165500
--start 2023-07-01
--end 2025-07-10
--base-dir data
--overwrite
Create input tsv
mrms-usgs masks build-input --basins-dir "$BASE_DIR/basins_json" --out "$MASK_INPUT" --overwrite
mrms-usgs masks build-state-masks
mrms-usgs masks build-state-masks --sample-grib-gz "$SAMPLE_GRIB" --mask-input "$MASK_INPUT" --out-dir "$STATE_MASK_DIR" --overwrite
Create state basin index
mrms-usgs masks build-state-basin-index --sample-grib-gz "$SAMPLE_GRIB" --mask-input "$MASK_INPUT" --state-mask-dir "$STATE_MASK_DIR" --out-dir "$STATE_INDEX_DIR" --overwrite
Extract historical event information (Run using tmux)
./run_ews_by_state_parallel.sh
Training engine, filter data
mrms-usgs ews fit-predictors
--summary-dir "$BASE_DIR/ews_history"
--out-dir "$BASE_DIR/ews_predictors"
Download state current rainfall (Texas example)
BASE_DIR="/data/repository_code/unified_data" STATE="TEXAS"
mkdir -p "$BASE_DIR/current_rain"
mrms-usgs ews state-rain-current
--state "$STATE"
--state-mask "$BASE_DIR/state_masks/${STATE}_mrms_mask.npz"
--out-npz "$BASE_DIR/current_rain/${STATE}_current_rain.npz"
--base-dir "$BASE_DIR"
--hours-back 12
--workers 6
Run state alerts (Texas Example)
mrms-usgs ews run-state
--state "$STATE"
--recent-rain-npz "$BASE_DIR/current_rain/${STATE}_current_rain.npz"
--state-basin-index "$BASE_DIR/state_basin_index/${STATE}_state_basin_index.npz"
--predictor-dir "$BASE_DIR/ews_predictors"
--out-dir "$BASE_DIR/ews_alerts/${STATE}"
Data directory with subfolders created following this structure
data/
├── _mrms_cache/ # Temporary cache of downloaded MRMS .grib2 files to avoid re-downloading
├── basins_json/ # Watershed boundaries (GeoJSON) for each USGS station (used to mask rainfall)
├── events/ # Detected hydrologic events (CSV files with peaks, volumes, and timing)
├── logs/ # Execution logs for debugging and tracking pipeline progress
├── rain_zarr/ # Processed rainfall data stored in Zarr format (spatial + temporal arrays)
├── site_meta/ # Metadata for each USGS station (location, name, timezone, etc.)
└── stage_parquet/ # Time series of water level (stage) data from USGS in Parquet format
Acknowledgements
This material is based upon work supported by the U.S. National Science Foundation under Grant No. TI-2303756 and the Tethys Geoscience Foundation.
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
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 mrms_usgs_events-0.1.2.tar.gz.
File metadata
- Download URL: mrms_usgs_events-0.1.2.tar.gz
- Upload date:
- Size: 66.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cf08b604bbf5c9a58e179a9c337770467b21977c042bc3920b793bd913ffeb4
|
|
| MD5 |
8ce393cd301cae82262a7c37ebdb6643
|
|
| BLAKE2b-256 |
c720e01e7ff726e1330739da7b11375d60fd87a66add7ba1e7ea341730981603
|
Provenance
The following attestation bundles were made for mrms_usgs_events-0.1.2.tar.gz:
Publisher:
publish_to_pypi.yml on GonzaloAlbertoForeroBuitrago/mrms_usgs_events
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrms_usgs_events-0.1.2.tar.gz -
Subject digest:
9cf08b604bbf5c9a58e179a9c337770467b21977c042bc3920b793bd913ffeb4 - Sigstore transparency entry: 1849957695
- Sigstore integration time:
-
Permalink:
GonzaloAlbertoForeroBuitrago/mrms_usgs_events@bdbe9678a5a41dde6968dd8ff33d896d4677acbd -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/GonzaloAlbertoForeroBuitrago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@bdbe9678a5a41dde6968dd8ff33d896d4677acbd -
Trigger Event:
push
-
Statement type:
File details
Details for the file mrms_usgs_events-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mrms_usgs_events-0.1.2-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23726101d2052a4d1ec21ff0a99de206ccd503d1be7342eee133944166d2cc79
|
|
| MD5 |
d54bafa9e20a753b63a9f666e5897c7d
|
|
| BLAKE2b-256 |
f6def70ca713f9164c2a8e8fae1c3419f037d36093714964b4b0b76bd4144a6b
|
Provenance
The following attestation bundles were made for mrms_usgs_events-0.1.2-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on GonzaloAlbertoForeroBuitrago/mrms_usgs_events
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrms_usgs_events-0.1.2-py3-none-any.whl -
Subject digest:
23726101d2052a4d1ec21ff0a99de206ccd503d1be7342eee133944166d2cc79 - Sigstore transparency entry: 1849957829
- Sigstore integration time:
-
Permalink:
GonzaloAlbertoForeroBuitrago/mrms_usgs_events@bdbe9678a5a41dde6968dd8ff33d896d4677acbd -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/GonzaloAlbertoForeroBuitrago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@bdbe9678a5a41dde6968dd8ff33d896d4677acbd -
Trigger Event:
push
-
Statement type: