-
Notifications
You must be signed in to change notification settings - Fork 103
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
Tweak edges using a gradient method #1796
Conversation
# Conflicts: # doc/help/run_pypeit.rst # doc/releases/1.15.1dev.rst # pypeit/core/datacube.py # pypeit/par/pypeitpar.py
# Conflicts: # doc/help/run_pypeit.rst # doc/releases/1.15.1dev.rst
# Conflicts: # doc/releases/1.15.1dev.rst
# Conflicts: # doc/releases/1.15.1dev.rst
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## kcwi_cube_updates #1796 +/- ##
=====================================================
- Coverage 38.22% 38.19% -0.03%
=====================================================
Files 208 208
Lines 48256 48311 +55
=====================================================
+ Hits 18444 18451 +7
- Misses 29812 29860 +48 ☔ View full report in Codecov by Sentry. |
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 good to me, so I'm approving now. As far as I can tell, you mostly remove the initial=True
flags for the code relevant to the SlicerIFU only. Is that true? There was at least one case where I wanted to make sure that we understand changes to the default behavior.
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 for the review, @kbwestfall - all addressed!
# Conflicts: # doc/releases/1.15.1dev.rst
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.
This looks good for me in general. I'm approving.
But I have a question. The fact that you removed initial=True
to all the code relevant to the SlicerIFU, does it mean that the parameter tweak_slits
cannot be False
for SlicerIFU? If it's correct, is that clear to the users?
Similarly, spatial_fit_finecorr()
also have initial=False
. Does it mean that it is always run only when tweak_slits=True
? Is that clear to the users?
Thanks for the feedback, @debora-pe!
Just to confirm,
Like the above response, the So, the full functionality is still available to all users - thanks for checking 👍 |
Thank you @rcooke-ast for the explanation! |
This PR adds additional functionality to the tweak-edges algorithm. The current implementation is prone to error when there's vignetting (see below image for an example).
The top panel is the slit profile (black), and some vertical lines that show the initial, tweaked (threshold - already implemented in PypeIt), and tweaked (gradient - new method in this PR) determinations of the slit edges. The tweaked (gradient) is a new method that I’ve implementing that is based on the strongest gradients of the slit profile (see bottom panel)… the smoothed profile is in purple, which is what the tweaked locations is based on. The key problem with the old approach is vignetting.
I will soon be submitting another PR that refactors the spatial flexure to be (optionally) slit-dependent. This is the start of that effort, and I won't develop further on this until PR #1755 clears.