Skip to main content

geocat-rs

Rust-accelerated drop-in replacements for GeoCAT-comp computational functions.

GeoCAT-comp is NCAR's Python replacement for NCL. geocat-rs accelerates the compute-heavy functions using Rust + rayon parallelism, while leaving the xarray/scipy wrapper functions alone (they're already fast).

Performance

Real-world benchmarks on CESM-like 3D atmospheric fields. Every result verified identical to geocat.comp.

The #1 workflow: interp_hybrid_to_pressure

The function CESM researchers use most — converting hybrid-sigma vertical coordinates to standard pressure levels (replacing NCL's vinth2p).

Grid size geocat.comp geocat-rs Speedup Max diff
32 lev x 192 lat x 288 lon (1.8M pts) 161 ms 21 ms 7.5x 0.0
32 lev x 500 lat x 500 lon (8M pts) 724 ms 95 ms 7.6x 0.0

Tested with 14 drop-in compatibility tests: standard/full CESM grids, custom levels, multiple timesteps, mountain pressure extremes, 4 random seeds. All pass.

Meteorology functions on 3D fields (12.5M elements)

Function geocat.comp geocat-rs Speedup
Dewpoint temperature 189 ms 12 ms 16x
Relative humidity (table lookup) 353 ms 17 ms 21x
Relative humidity over water 223 ms 16 ms 14x
Saturation vapor pressure 6.1 ms 4.5 ms 1.4x

WGS84 gradient functions (250K grid points)

Function geocat.comp geocat-rs Speedup
rad_lat_wgs84 (degree-48 polynomial) 67 ms 1.0 ms 66x
arc_lat_wgs84 (degree-49 polynomial) 69 ms 1.0 ms 70x

Overall across all accelerated functions

geocat.comp geocat-rs
Total time 908 ms 53 ms
Overall speedup 17x

Accuracy

All functions verified against geocat.comp to machine precision:

Test suite Tests Result
interp_hybrid_to_pressure compatibility 14 All pass (max diff: 0.0)
Meteorology functions (scalar + array) 20 All pass (rtol < 1e-12)
WGS84 gradient functions 6 All pass (rtol < 1e-10)
Delta pressure 1 Pass
Total 44 All pass
pytest tests/ -v
python tests/bench_interp_hybrid.py
python tests/bench_workflow.py

Installation

pip install geocat-rs

Requires metrust for interp_hybrid_to_pressure (uses its Rust interpolation engine).

Usage

interp_hybrid_to_pressure (drop-in replacement)

# Before
from geocat.comp import interp_hybrid_to_pressure

# After (same API, 7.5x faster)
from geocat_rs.interp_hybrid import interp_hybrid_to_pressure

# Usage is identical
output = interp_hybrid_to_pressure(
    data, ps, hyam, hybm,
    new_levels=new_levels,
    lev_dim='lev',
)

Meteorology (array functions via Rust + rayon)

from geocat_rs._geocat_rs import meteorology as met

# Scalar
td = met.dewtemp_scalar(300.0, 50.0)  # T(K), RH(%) -> Td(K)
hi = met.heat_index_scalar(95.0, 50.0, False)  # T(F), RH(%) -> HI(F)
rh = met.relhum_scalar(300.0, 0.01, 101325.0)  # T(K), w(kg/kg), P(Pa) -> RH(%)

# Array (rayon-parallel)
import numpy as np
td_array = met.dewtemp_array(temp_k, rh_pct)
rh_array = met.relhum_array(temp_k, mixr, pressure)
svp_array = met.saturation_vapor_pressure_array(temp_f)

WGS84 gradient (66-70x faster)

from geocat_rs._geocat_rs import gradient as grad

radius = grad.rad_lat_wgs84_array(lat_grid.ravel())  # meters
arc = grad.arc_lat_wgs84_array(lat_grid.ravel())      # meters from equator

What's accelerated

Function Source Speedup Notes
interp_hybrid_to_pressure Rust column interpolator + rayon 7.5x #1 most-used geocat function
dewtemp Rust + rayon 16x Dutton formula
relhum (table) Rust + rayon 21x NCL lookup table
relhum_ice / relhum_water Rust + rayon 14x Alduchov/Murray
heat_index Rust + rayon -- NWS Rothfusz regression
saturation_vapor_pressure Rust + rayon 1.4x Tetens/FAO-56
saturation_vapor_pressure_slope Rust + rayon -- FAO-56 Eq. 13
psychrometric_constant Rust + rayon -- FAO-56 Eq. 8
max_daylight Rust + rayon -- FAO-56 solar declination
rad_lat_wgs84 Rust + rayon 66x Degree-48 polynomial
arc_lat_wgs84 Rust + rayon 70x Degree-49 polynomial
arc_lon_wgs84 Rust + rayon -- Radius * cos(lat) * lon
temp_extrapolate Rust + rayon -- ECMWF Eq. 16
geo_height_extrapolate Rust + rayon -- ECMWF Eq. 15
delta_pressure_1d Rust -- Simmons & Burridge

What's NOT accelerated (and why)

Function Why not
climatology_average, calendar_average, month_to_season xarray groupby — already optimized
eofunc_eofs, eofunc_pcs Wraps eofs library (LAPACK)
fourier_filter, fourier_*_pass numpy FFT (FFTW backend)
decomposition, recomposition scipy spherical harmonics
interp_multidim, interp_sigma_to_hybrid Wraps metpy (already Rust via metrust)

License

Apache-2.0 (same as GeoCAT-comp)

Release files for geocat-rs 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geocat-rs 0.1.1
File Size Uploaded
geocat_rs-0.1.1.tar.gz 26.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for geocat-rs 0.1.1
File
geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
geocat_rs-0.1.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
geocat_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
geocat_rs-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details

Total release size: 4.5 MB

Release files / geocat_rs-0.1.1.tar.gz

Download URL geocat_rs-0.1.1.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
66813304d38090d97e7869cbc7ef592a2516e729572ce267e9786073131a390f
BLAKE2b-256 checksum
How to use checksums
e674fc67c13cea27dd6189068120deaf1afb14a3ee139308ed54dceca62db6d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 431.8 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0cbf8d347baa6025ae08e5ed9c0a5b30f3c357d9fb089cf6454ccbaa61843173
BLAKE2b-256 checksum
How to use checksums
4184a1b46e9a609db92b699418fe9c1add7e03a5fc3faaf422841a0fc9f564a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL geocat_rs-0.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 423.5 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
9c03d1aa4e907153f59307b091458fb941ddf937f7c2b37e0b5edd40ac662355
BLAKE2b-256 checksum
How to use checksums
5981d93bd3b8fdab63f250de78fac42a0306d9ddc0341504dedef1b66d0df826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp312-cp312-win_amd64.whl

Download URL geocat_rs-0.1.1-cp312-cp312-win_amd64.whl
Size 274.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c7b6069b4787e29c427b81259a08a922180d22df10762473abeabf1a9622677f
BLAKE2b-256 checksum
How to use checksums
092a4a1cc076298200ca0861c2b2a4883ba056246c6e555ed922c749f457352c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.8 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5932bc6786a8b6cd90ca9d7abda38ef89d62e0470bdcd4d0385fe14f73e7eb33
BLAKE2b-256 checksum
How to use checksums
57add9648e25d83d4d04a7d43230ef7f976af339a6b51873946f6b304577f6ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL geocat_rs-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 424.4 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
bc4fd28ca3fd666a423f8b61b0204b5c419043246ebca20a5398d2b9932ddd6e
BLAKE2b-256 checksum
How to use checksums
13ac2322344d2b0c5d345a0390891bc39c121cb39c22cb95cfb9f696c09edd2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL geocat_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Size 376.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1a54a4449c66119494aa9abde203d2a003a38ad4b68729e04fd5dd23e1e0eeae
BLAKE2b-256 checksum
How to use checksums
ba3780e141ba67376a60a0f7935fd484e535a94018fab7354e2a50435ee3a557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL geocat_rs-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 382.1 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0a6a8ef7b17f018704a7b491ee2328294ab87daa4bbd5fa79ebfe00f7400857f
BLAKE2b-256 checksum
How to use checksums
903d7383c6790dfb7ce3359e244c3222b6385b4183d7deb6161e4d5e056e39b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2428c93194d2372709887679d25eb7770c5f97939e04dad813bf2f107fdd448c
BLAKE2b-256 checksum
How to use checksums
86757b1f92a60738a5e01aba3777283bbcb55907e12c1b10a2db5c5c38da6d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL geocat_rs-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 424.0 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
65f63abb9d53468ce41f12c3f04ae73f33bd8ef58520b12ae6a6b2e103923891
BLAKE2b-256 checksum
How to use checksums
e3b8f02749a639fea5d99abd45fcf9177d536c61ea81acdc6e08219feb52cf76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
40b3049510f7f84b19df440ef1258895b6666b044fffb7e9d617a0556dd82260
BLAKE2b-256 checksum
How to use checksums
c559adc66e6a85fad3589342bc7f9bcc92435dc39bebe11e1b9d46ac6f001dcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release files / geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL geocat_rs-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 424.0 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
cf87a6e2f653742683f092ca1d380cf8e0141a363f78ecd3aec54459291c8649
BLAKE2b-256 checksum
How to use checksums
38b9fcb35bd7285e4969773c3a9f1e10f914a1eb317bbf258a74f8ae1a967c2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.12.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

12 release files

0.1.0

12 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page