Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Healpix grid #162

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Add Healpix grid #162

wants to merge 28 commits into from

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Jun 18, 2024

  • implement the grid interface
    • grid properties
    • neighbors indices & distances
    • nodes areas
    • nodes status
  • convenient constructors, factories an/or helpers (e.g., construct a grid given a approx. fixed cell resolution)
  • Python bindings
  • ghost node status: skip in flow routers, sink resolvers and eroders
  • node status utility methods (e.g., set continental mask from arbitrary polygons).
  • interpolation utility methods (some requires little work while others may require much more work, not all may be needed)
    • return geodetic or geocentric coordinates of a given cell index, a vector of cell indices or all cells -> useful for mapping field values from an external mesh onto the healpix grid using 3rd-party interpolation
    • return an interpolated value at an arbitrary point (and/or vectorized version), using Healpix's (local) linear interpolation methods -> useful for mapping field values from the Healpix grid onto another mesh of similar resolution
    • return an aggregated field value (mean) for a given bounding box or arbitrary polygon, using Healpix's spatial query methods -> useful for mapping fields values from the Healpix grid onto a coarse grid or mesh.
    • return interpolated values for a given set of arbitrary points using global, point-wise interpolation (spherical harmonics, polynomial fitting) -> useful for mapping fields between different Healpix grids of different resolutions with fine control on the surface smoothing. Might require a lot of work (no high-level method for this available in Healpix, only command-line programs built on top basic functionality, e.g., see smoothing_cxx)
  • configuration
    • FindHealpix CMake module
    • Cmake option to enable / disable Healpix support (opt-in)
  • tests
    • C++ tests
    • Python tests
  • documentation
    • C++ API reference
    • Python API reference
    • User guide
    • Example (at least Python)
  • Python types
  • consider using ducc0 instead of healpix original library (the latter is not supported on Windows), see Gradual migration from Healpix C++ to ducc back-end healpy/healpy#717.

benbovy added 28 commits June 18, 2024 15:03
Also add ``fastscapelib::node_status::ghost``
Also use RING scheme (slower for getting the neighbors but more flexible
regarding the choice of the nside value).
Quick & dirty solution. Alternatively, we could just not define the
class but static checkers may not be happy with dynamically defining
__all__ and we would also need to add a check in fastscapelib's root
__init__. Another alternative is to create another class and raise
within its __init__ method, but that's not great either.
Maybe this will fix googletest link errors? googletest and google
benchmark can be easily build from source as part of the cmake
configuration here.
macos 11 seems not responsive anymore?
macos 14 for testing on arm64
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.

1 participant