-
Notifications
You must be signed in to change notification settings - Fork 30
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 Keck aperture #155
Add Keck aperture #155
Conversation
Codecov Report
@@ Coverage Diff @@
## master #155 +/- ##
==========================================
- Coverage 80.93% 80.86% -0.07%
==========================================
Files 95 95
Lines 6923 7103 +180
==========================================
+ Hits 5603 5744 +141
- Misses 1320 1359 +39
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
- There are lots of flake8 errors. You can look at Azure for a full list of them since the annotations only show the first twenty). Or you can run flake8 yourself locally.
- Lots of whitespace issues. Hcipy uses tabs for indentation (I know... smh; I've been looking for a way to change this without clobbering the whole git history).
- Add a pytest for the Keck aperture, making sure to check normalization and segmentation.
- Put a PNG of the baseline aperture (as checked by the Pytest for an easy check for us and documentation).
- You can also add the Keck aperture (not Lyot stop) to the telescope pupils tutorial. Or I can do that in a separate PR afterwards. Let me know which option you want.
Added by Iva on 23 Feb 2023:
- make sure
return_segments
parameter works as it should, in aperture function - same for
normalized
, in aperture function - I don't see a central obscuration popping up, gotta fix that; in aperture function
7061efe
to
3ee605a
Compare
8424c4a
to
69d60a9
Compare
@ehpor do you really mean a PNG with this or the Sorry for the billion commits and tests, I am flying a little blind since this branch is on a fork (that's not mine) and I didn't want to install the fork in dev mode, in a new env and so on. I should be almost done with things, the tests pass when I copy-paste and run them locally. As for the tutorial notebook, I added what I think needs to be there but because of not importing the forked package I wasn't able to run it. Happy to fix things if there is still something open or something went wrong. |
Two of the new tests are still failing, let me look into it... |
@ehpor please advise: the two tests that are failing do so because the reconstruction of the aperture from the segments does not have the central obscuration, while the original aperture does when This also made me notice how the Keck aperture uses the The simplest solution I see is to (a) always include the central obscuration in Keck, independent of Thoughts? Edit: |
@ivalaginja With the PNG, I literally mean a screenshot of DS9 of the fits file that serves as the baseline. In the past, even a glance at that file showed that the aperture was completely wrong. And people just let the code generate an aperture and assume that because the test passes, that they've implemented the Keck or VLT aperture correctly. |
Where are those though? I wasn't able to locate them on the repo. |
In |
The segments that are returned should be the illuminated part of the segment, not the full segment itself. Therefore, the segments in the first ring of Keck should contain the central obscuration. In principle, the sum of all the segments should be equal to the returned segments. This is what the test is checking for. This would be a few extra lines at the end of the function: if return_segments:
def segment_with_central_obscuration(segment):
return lambda grid: segment(grid) * (1 - make_circular_aperture(central_obscuration_diameter)(grid))
segments = [segment_with_central_obscuration(segment) for segment in segments] or something like this without typos. |
@ehpor just to clarify: this is supposed to be a plain png file, uncompressed? Any preferences on the file name? |
I don't understand. Everything passes locally and I have no uncommitted changes except for the png file and the .DS_Store files, which is completely irrelevant. |
Ah. The old reference files do not have the central obscuration in some cases, while what I compare to locally does. |
There we go. |
Ready for review @ehpor |
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.
LGTM.
Flake8 doesn't report that it finished. This has to do with reviewdog, I think, see #174. I manually checked flake8 and it seems fine. Also, flake8 itself finished successfully on CI. I'm forcing a merge as admin. |
Thanks for the contribution @vkooten! 🎉 |
This adds Keck aperture
and lyot stopfor Keck 2. It solves part of #134 and #153Picture of aperture: