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

Provide cell corners #66

Open
florianziemen opened this issue Dec 5, 2024 · 2 comments
Open

Provide cell corners #66

florianziemen opened this issue Dec 5, 2024 · 2 comments

Comments

@florianziemen
Copy link

Moin Nicolas,

First of all, thanks a lot for providing the healpix package!

To add HEALPix support to UXarray, an xarray extension for unstructured grids, we need a function that computes the vertices, and ideally also a mapping of the vertices to the cells.
I've played a bit with the healpix package, and found that the _uv functions will provide the corners if supplied with the correct arguments, as in this gist. From there, one can move on with unique functions as in this gist by @philipc2.

I'm sure this is not the most efficient way of generating the vertices, but I was wondering if you would be interested in supporting this operation in your library. I'd be more than happy to create a merge request if that helps.

Pinging @philipc2 and @erogluorhan, as they are core developers of UXarray.

Cheers

Flo

@ntessore
Copy link
Owner

ntessore commented Dec 5, 2024

Hi Flo!

Thanks for getting in touch. It would be great if we added add a healpy-compatible function such as

def boundaries(nside, ipix, step=1, nest=False):
    ...

to the code. In the first instance, I think that using the pix2ang_uv functions at the Python layer, as in your examples, is perfectly fine. In a second step, it could make sense to add the boundaries() function directly to the C library. That might save a bit of overhead -- but it would anyway be good to have the Python functions in place to make the comparison.

How does that sound?

@philipc2
Copy link

philipc2 commented Dec 5, 2024

Thanks for pinging me @florianziemen!

We are excited to use this package to add support for HEALPix within UXarray. To add onto what Flo already mentioned:

  • UXarray is written around the UGRID conventions, which requires at least the vertices (node_lon, node_lat) and cell- vertex indicies(face_node_connectivity) to represent an arbitrary 2D unstructured grid. This would be for loading a HEALPix grid into UXarray.
  • Going the other way, converting from UGRID to HEALPix can be achieved using a nearest neighbor remap, however for conservative remapping, knowing the boundaries is important

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

No branches or pull requests

3 participants