Atmospheric River Categorization Toolkit
Project description
ARCat: Atmospheric River Categorization Toolkit
ARCat is a Python package for categorizing Atmospheric River (AR) events based on Integrated Vapor Transport (IVT) data. It provides:
- Event-based AR categorization: Collapses each AR event to its peak intensity.
- Evolution-based AR categorization: Preserves the intensity evolution within AR events.
Additionally, ARCat computes:
- Cumulative IVT per AR event.
- IVT-only values for each AR event.
- Duration-only values (number of timesteps per event).
It is fully compatible with NumPy arrays, xarray, and Dask, allowing analysis of large datasets efficiently.
Features
- Event-based and evolution-based AR categorization.
- Automatic handling of duration rules:
- Events < 1 day → downgrade category
- Events 1–2 days → unchanged
- Events ≥ 2 days → upgrade category
- Maximum category enforcement.
- Option to extract IVT-only and duration-only arrays.
- Easy integration with xarray/Dask for large datasets.
- Fully documented and tested, with CI support.
Installation
Clone the repository and install locally:
git clone https://github.com/yourusername/arcat.git
cd arcat
pip install -e .
Quick Start
Import the package
import numpy as np
from arcat.core import AR_categorization_scheme, AR_categorization_evolution_scheme
Prepare your IVT array
# Example: random IVT values for demonstration
ivt = np.random.rand(20) * 1500 # IVT in kg/m/s
Event-based AR categorization
# Run the event-based AR scheme
final_cat, cum_ivt, ivt_event, duration_event = AR_categorization_scheme(
ivt,
time_resolution_hours=6, # Data resolution in hours
bin_width=250.0, # IVT bin size
max_category=6 # Maximum AR category
)
print("Categorized AR events:", final_cat)
print("Cumulative IVT:", cum_ivt)
print("IVT-only values:", ivt_event)
print("Duration per timestep:", duration_event)
Evolution-based AR categorization
# Run the evolution-based AR scheme
final_cat, cum_ivt, ivt_event, duration_event = AR_categorization_evolution_scheme(
ivt,
time_resolution_hours=6, # Data resolution in hours
bin_width=250.0, # IVT bin size
max_category=6 # Maximum AR category
)
print("Evolution categories:", final_cat)
print("Cumulative IVT:", cum_ivt)
print("IVT-only values:", ivt_event)
print("Duration per timestep:", duration_event)
Parameters
| Parameter | Description |
|---|---|
ivt_array |
1D NumPy array of IVT values (kg/m/s) |
time_resolution_hours |
Temporal resolution of your data in hours (default: 6) |
bin_width |
Width of each IVT bin for categorization (default: 250) |
max_category |
Maximum AR category (default: 6) |
Returns
final_categories: Array of AR categories (1–6) after duration adjustments.cumulative_ivt: Cumulative IVT during AR events.ivt_event: Original IVT values during AR events (0 elsewhere).duration_event: Number of timesteps per AR event (0 elsewhere).
Usage Notes
- Event-based scheme collapses each AR event to its maximum intensity (
max_bounded_replace). - Evolution-based scheme preserves temporal evolution of IVT within AR events.
- Duration rules are applied per continuous AR segment.
- Works with any NumPy array, and can be integrated with xarray or Dask arrays for large datasets.
Adopting for xarray data
final_cat, cum_ivt, ivt_event, duration_event = xr.apply_ufunc(AR_categorization_scheme,
Ivt_ds['IVT'].as_numpy(),
input_core_dims = [['time']],
output_core_dims = [['time'],['time'],['time'],['time']],
vectorize=True, # Auto-vectorize over lat/lon
dask='parallelized', # Enable parallelization using Dask
output_dtypes=[np.int8,np.float32,np.float32, np.int8])
Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature-name - Make your changes
- Run tests
- Submit a pull request
License
This project is licensed under the Creative Commons License.
References
- Ralph, F. M., Rutz, J. J., Cordeira, J. M., Dettinger, M., Anderson, M., Reynolds, D., ... & Smallcomb, C. (2019). A scale to characterize the strength and impacts of atmospheric rivers. Bulletin of the American Meteorological Society, 100(2), 269-289.
- Visit the Atmospheric River Tracking Model Intercomparison Project (ARTMIP) to follow Atmospheric River community research and publications.
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 arcat-0.1.0.tar.gz.
File metadata
- Download URL: arcat-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa574c8cdf5c0e6a413bbdbc9e4bd7af696d269c1e1bdefb647eab1326430ad0
|
|
| MD5 |
619a1dfddf784b03b76bc57b21d9b6dd
|
|
| BLAKE2b-256 |
2d9dfb6e03d0b19a75d51cac39687d9b001ce74004a425f87750f0e3f048d631
|
File details
Details for the file arcat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arcat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da032bf4161628c6aa4f3dc5e5cfeeb6c306490250b081737aeaa5d245142402
|
|
| MD5 |
a5572c2ac6def9b5e682c650493a6275
|
|
| BLAKE2b-256 |
4a2d2ba41fe2570bab12676f4d3bc4726a978b2c59f26d2cd7fe3adb3f963ea7
|