Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add native scalar Clenshaw-Curtis grid transforms - #534

Draft
mwyau wants to merge 1 commit into
SHTOOLS:developfrom
mwyau:feat/cc-grid
Draft

Add native scalar Clenshaw-Curtis grid transforms#534
mwyau wants to merge 1 commit into
SHTOOLS:developfrom
mwyau:feat/cc-grid

Conversation

@mwyau

@mwyau mwyau commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • Driscoll and Healy grid's sampling and expand scheme does not match atmospheric science datasets' common fixed latitude-longitude grid. It is either missing the south-pole, has a duplicate longitude column, or with the wrong longitudinal resolution.
  • Clenshaw-Curtis grid is the native grid for many atmospheric datasets (in addition to Gauss-Legendre quadrature), with a fixed latitude-longitude interval.
  • Clenshaw-Curtis grid is natively supported by DUCC which is pyshtools' default backend.
  • First PR will be DUCC backend only. I can follow-up with a second PR for Fortran backend. I have work in progress to add vector analysis and synthesis as discussed in Looking for functions to calculate vorticity and divergence #315 and Spherical cap harmonic analysis #316

Reminders

  • Base all changes on the develop branch: the master branch is used only when releasing new versions.
  • Run make check to ensure that the python code follows standard formatting conventions.
  • If adding new features, update the docstring to provide all information that is required to use the feature.

AI Disclaimer

I designed the detailed specification and used Codex/GPT-5.6 Terra for implementation. I review and test all changes.

@mwyau
mwyau changed the base branch from master to develop August 13, 2026 22:16
@MarkWieczorek

Copy link
Copy Markdown
Member

Hi, thanks for the PR. Could you please provide a human readable summary as to why this PR is necessary, what Clenshaw-Curtis grid transforms are, references to the technique, what the advantages are over the grids and transforms that we are using now, etc.? And what is the maximum degree that this approach can handle?

This is a big PR and will take considerable time to review. If possible, I would prefer that it be divided into several smaller PRs, but if not, that is ok.

Also note that I will soon be moving this repo to Codeberg, and will be asking all contributors to abide by their new AI policies.

@mwyau

mwyau commented Aug 14, 2026

Copy link
Copy Markdown
Author

Hi @MarkWieczorek, this is not ready for review yet, as I am still trying to contain the scope and to conform to the repo standard. I have been working on my private repo for a while and opened the PR as a draft for visibility. My original intention was to update the DUCC wrapper only and add CC grid support to the Python API, as I had already implemented DUCC directly in my project and the work was mostly done. After I started to include Fortran changes the scope grew quite a bit. And I am also proposing moving ducc0.sht.experimental.* functions to the stable ducc0.sht.* API in 0.33.

Updated the PR description on splitting the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants