-
Notifications
You must be signed in to change notification settings - Fork 76
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
spectral extraction: live-preview and export of background spectrum #1682
Conversation
78863b2
to
414c479
Compare
Codecov ReportBase: 87.63% // Head: 87.64% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1682 +/- ##
=======================================
Coverage 87.63% 87.64%
=======================================
Files 95 95
Lines 10131 10154 +23
=======================================
+ Hits 8878 8899 +21
- Misses 1253 1255 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
7b8582d
to
3d6ae9b
Compare
0eb2392
to
af873d4
Compare
How about a thicker solid line for the extracted spectrum and a thin solid line for the background spectrum? |
@camipacifici @PatrickOgle - I actually like the thinner line idea, what do you think? (Here are videos for the dotted and thin styling and how they both react to zooming) Screen.Recording.2022-10-10.at.2.48.12.PM.movScreen.Recording.2022-10-10.at.2.51.36.PM.mov |
I like the thin line too! |
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.
The code changes seem reasonable to me. A few observations:
-
I am fine with the solid line, too. However, depending on the placement of the initial background region(s), it may not be noticeable if you aren't already looking for it. How do you feel about giving it a different color?
-
When I choose the "Manual" option, I don't see a preview line and the 2D viewer takes 2-3 seconds to adjust when I change the center pixel. (The lag is also present in
main
.) Exporting a spectrum having chosen "Manual" brings up the "background regions overlapped" error from specreduce. "TwoSided" and "OneSided" are snappy and don't raise any errors for me. -
Sometimes when I export the background 1D spectrum and then scroll up to change its appearance in Plot Options, the preview line persists in the 1D viewer:
The preview disappears if I scroll back into the Trace or Extraction sections of the Spectral Extraction plugin, so it looks like the trigger is leaving the Spectral Extraction plugin without registering a mouse move (e.g., pressing "Extract" and immediately scrolling up). I'm not sure how many would run into this but thought I'd mention it.
I would like to avoid this, if possible. We use the same color for all "temporary" previews from plugins at the moment.
I've come across this a few times as well, but is unrelated to this PR (feel free to open an issue if one doesn't already exist).
I suspect the mousemove isn't triggering a change in the "section", but so long as the plugin is opened, I would expect the previews to stay visible, in general. If you moused over a different "section" of the plugin and that wasn't registered, then that may be a bug, although again unrelated to this PR. |
8d6cb8e
to
9dfdefb
Compare
I can see how the lag is unrelated, but do you have thoughts on the "Manual" type's lack of a live preview line and the error upon exporting a spectrum? |
Addressed in #1737 (and independently upstream in astropy/specreduce#146). Good catch! |
9dfdefb
to
2f801b4
Compare
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.
Great, I merged this branch with #1737 and the result fixes both the lag and export error issues with using a "Manual" trace for the background.
Would you consider adjusting the starting pixel for the trace when you select the "Manual" background type? With the image in the example notebook, it starts on the cross-dispersion pixel with the highest flux. This scenario exacerbates the color issue I mentioned earlier since the background's live preview starts off with more flux than the extraction's live preview.
I'll create a separate issue for the persisting preview line.
Yes, this currently starts at the same default position that is determined for the initial trace, which probably isn't ideal. I put a proposed improvement to that logic in #1738 (seemed like it should have its own change log entry since it isn't directly related to this PR, even though they're both dealing with the background subtraction step). |
2f801b4
to
0901564
Compare
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.
Now that the tests are passing and the spinoff issues are underway, I say this branch is ready for a merge.
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.
Just a very minor nitpick. Code looks like code but should second approval come from a PO?
Ooops change log has conflict now. |
0901564
to
bad9681
Compare
bad9681
to
9652679
Compare
Description
This pull request adds live-visualization and export (UI and API) support for the 1D spectrum representing the background region within the spectral extraction plugin.
NOTE: this requires astropy/specreduce#143 (until then, the new test coverage will fail)Rendered updated plugin docs
Screen.Recording.2022-09-28.at.12.51.06.PM.mov
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.New Features > Specviz2d:
Spectral extraction plugin now supports visualizing and exporting the 1D spectrum associated with the background region.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.