xarrams
Python utilities for working with RAMS (Regional Atmospheric Modeling System) output using xarray.
Features
- File I/O — Read RAMS HDF5 output files into xarray Datasets with automatic dimension naming, coordinate assignment from header files, and optional pint unit attachment.
- Thermodynamic calculations — Derive temperature, pressure, humidity, buoyancy, and hydrometeor fields from raw RAMS output using MetPy.
- Idealized soundings — Generate Weisman & Klemp (1984) soundings with veering or unidirectional shear, and plot SkewT diagrams.
- Simulation execution — Generate RAMSIN configuration files from templates and launch serial or MPI-parallel RAMS runs.
- Source building — Build RAMS executables from Jinja2-templated Fortran source trees.
- Dask integration — Parallel reading and intermediate result caching for large datasets.
Installation
pip install xarrams
With optional extras:
pip install xarrams[dask] # dask + h5netcdf for parallel reading
pip install xarrams[build] # jinja2 for templated source building
pip install xarrams[dev] # development tools (pytest, ruff, mypy, etc.)
Quick start
Reading RAMS output
import xarrams
# Read one or more RAMS output files
ds = xarrams.read_rams_output(
["a-A-2020-01-01-120000-g1.h5", "a-A-2020-01-01-121500-g1.h5"],
parallel=True,
)
Computing derived variables
# Add thermodynamic variables (T, P, RH, buoyancy, etc.)
ds = xarrams.calculate_thermodynamic_variables(ds)
Generating an idealized sounding
import numpy as np
z_levels = xarrams.get_z_levels(deltaz=100, dzrat=1.1, dzmax=1000, nnzp=50)
sounding = xarrams.wk84_sounding(
U_s=30,
q_v0=14,
shear_layer_depth=6000,
veering=True,
z_levels=z_levels,
)
Running RAMS simulations
xarrams.run_rams(
parameter_sets_dict={"control": {"TIMMAX": "3600."}},
run_dir="./runs",
rams_executable_path="/path/to/rams",
ramsin_template_path="./RAMSIN.template",
)
Package structure
| Module | Description |
|---|---|
xarrams.constants |
RAMS constants, variable metadata, unit registry |
xarrams.io |
HDF5 file reading, filename parsing, dimension handling |
xarrams.calculations |
Thermodynamic and derived variable computations |
xarrams.soundings |
Sounding generation, SkewT plotting, RAMSIN formatting |
xarrams.execution |
RAMSIN generation and simulation launching |
xarrams.utils |
Grid generation, time utilities, log parsing |
xarrams.build |
Jinja2-templated RAMS source building |
xarrams.dask |
Dask diagnostics and intermediate caching |
xarrams.schedulers |
SLURM submission script generation |
Development
# Install with pixi (recommended)
pixi run -e dev install
pixi run -e dev test
# Or with pip
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for xarrams 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xarrams-1.1.0.tar.gz | 70.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xarrams-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 138.1 kB
Release files / xarrams-1.1.0.tar.gz
| Download URL | xarrams-1.1.0.tar.gz |
|---|---|
| Size | 70.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b8f8dc97941d5acf8e00eddf544d8e3f1f243a6b477149f54de6058d42b723d
|
|
BLAKE2b-256 checksum How to use checksums |
b290d34447d1e87d3af36090756963d93fea5e189328dfb7bd3b0c8cdeb74063
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / xarrams-1.1.0-py3-none-any.whl
| Download URL | xarrams-1.1.0-py3-none-any.whl |
|---|---|
| Size | 68.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b229f921d47fa06a78e96cef90d1b855a3f619c3afb0d266738c10e0907c70ee
|
|
BLAKE2b-256 checksum How to use checksums |
d1c4489d2f14df9214f7e7760c6c63d2d6af715298ffe0f98c8b9e20bc00a6f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for xarrams 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.