-
Notifications
You must be signed in to change notification settings - Fork 45
Fix HEALPix face area calculation to enforce equal area property #1379
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
Conversation
erogluorhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good except a few inline comments and the following:
Per today's discussion:
- Did you have a chance to look into how the current UXarray area calculation behaves between coarse and fine resolutions, compared to the HEALPIx areas at those levels?
- Could you please have a look into where in the documentation we could make some clear statements about how our geometric representation of HEALPix pixels (i.e. GCAs) differ from their own algorithmic geometry, and how we did this area adjustments because of that?
|
What do you think about adding documentation and a cross-reference in area_calc.ipynb and healpix.ipynb? |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
I think this makes sense in such a way:
Makes sense? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing this PR's latest revisions on healpix.ipynb made me notice something and further think about how to deliver this area adjustment in the best possible (least confusing?) way:
- With the added parts, the "Working with HEALPix" notebook now discusses Best Practices, i.e. about using the
face_areasproperty and avoiding thecompute_face_areasfunction when it is a HEALPix.- This might easily be overlooked or forgotten by the user though; hence it could lead confusions. Then I started to think why we should provide a
compute_face_areasAPI even though we have aface_areasAPI already. Why don't we have it only as an internal API?- Then I dug into finding where
compute_face_areashas been used so far. It is used in:grid.calculate_total_face_area,dataarray.integrate, anddataset.integrate.
- Also, none of them seems to have been modified in this PR to use
face_areasto leverage the HEALPix area adjustment.
- Then I dug into finding where
- This might easily be overlooked or forgotten by the user though; hence it could lead confusions. Then I started to think why we should provide a
I'd suggest that:
- We convert
compute_face_areasinto internal API- Relatedly, remove its references from the docs, tests, etc.
- Also relatedly, revise
healpix.ipynbagain to only mention howface_areasis adjusted when it is a HEALPix grid (after discussing the systematic difference between UXarray and HEALPix as you already did)
- Turn
compute_face_areasusages mentioned above intoface_areasinstead - Likewise, create
compute_healpix_face_areasas an internal API, not user API
Do these make sense?
Good observation/plan and I agree with most of proposed changes. It did look cumbersome while doing this notebook. |
Yeah, that's a good point! Thinking out loud: How about making all the suggested changes above in my comment,but adding an admonition into the HEALPix notebook about its workflow possibility and guiding the reader about an internal function ( |
Done. |
908d6f9 to
8e16a33
Compare
erogluorhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for the updates; this is getting there! Please see below and other comments:
- The HEALPix notebook needs to be updated per yesterday's discussion after today's updates.
- Update user API doc to remove
compute_face_areas.
Co-authored-by: Orhan Eroglu <32553057+erogluorhan@users.noreply.github.com>
…he code but marked as deprecated
erogluorhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great; thanks a lot for this fix!

Address #1236 and update face area calculation API