refactor: remove pyshtools and use ducc0 natively for SHT operations#112
Merged
refactor: remove pyshtools and use ducc0 natively for SHT operations#112
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
==========================================
- Coverage 62.82% 62.57% -0.25%
==========================================
Files 25 25
Lines 2437 2357 -80
==========================================
- Hits 1531 1475 -56
+ Misses 906 882 -24
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
… make ducc0 a mandatory dependency
…cy and silence SHTns warnings
…ic transforms and tapering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spectral Filter Parity vs. NCL (SPHEREPACK)
shtnsducc0shtnsducc0Benchmarks generated using
benchmark/calculate_spectral_errors.pyagainst ERA5 MSL test data.Kinematics (Vorticity & Divergence) Parity vs. NCL
Vorticity and divergence are small-magnitude fields ($\sim 10^{-5} \text{ s}^{-1}$ for synoptic scales). The 11-16% relative error for
shtnsis primarily due to different default quadrature weights on regular grids (Fejer-like) compared to the Clenshaw-Curtis weights used by NCL/SPHEREPACK.ducc0is configured to match NCL/SPHEREPACK exactly for these grids.Reference Mean Absolute Values (ERA5 850hPa):
shtnsducc0shtnsducc0Benchmarks generated using
benchmark/calculate_vodv_errors.pyagainst ERA5 UV test data.Why
shtnswas removed from KinematicsWhile
shtnsremains an excellent and high-precision engine for scalar transforms (as shown in the Spectral Filter benchmarks above), it has been removed as a backend for the kinematics (vorticity/divergence) module.Exhaustive testing revealed that on regular latitude-longitude grids,$(u, v) \rightarrow (\zeta, \delta)$ , this results in a persistent ~11-16% relative error compared to our reference baseline. In contrast, $RMSE=0.0$ ) and is now the sole engine for these calculations to ensure scientific integrity.
shtnsuses a different quadrature weighting scheme than NCL/SPHEREPACK. For vector-to-scalar transforms likeducc0provides a perfect bit-wise match (