-
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
Aperture live-preview plugin marks #2664
Conversation
7135855
to
9a5420b
Compare
dba5bba
to
94ad1f2
Compare
31e57a5
to
b8f06d7
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2664 +/- ##
==========================================
+ Coverage 90.81% 90.85% +0.04%
==========================================
Files 162 162
Lines 20962 21125 +163
==========================================
+ Hits 19036 19194 +158
- Misses 1926 1931 +5 ☔ View full report in Codecov by Sentry. |
ae29000
to
becb20c
Compare
ec9746d
to
8e442e1
Compare
jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py
Show resolved
Hide resolved
@@ -32,7 +33,8 @@ | |||
|
|||
|
|||
@tray_registry('imviz-aper-phot-simple', label="Aperture Photometry") | |||
class SimpleAperturePhotometry(PluginTemplateMixin, DatasetMultiSelectMixin, TableMixin, PlotMixin): | |||
class SimpleAperturePhotometry(PluginTemplateMixin, ApertureSubsetSelectMixin, |
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.
I guess technically this PR would block #2666 since we're touching the same kind of code. It makes sense to get this in first.
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.
Sure, I don't expect much in terms of conflicts though, do you?
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.
Not necessarily, but it does create review churn, as people test our PRs separately and then have to re-test when one is rebased on top of the other one later.
Minor comment: |
a29885b
to
6c386f1
Compare
@camipacifici - fixed, thanks for noticing that! |
Moving to draft now that image rotation is merged. This will now need to handle a change to rotation (although change to link type now requires dropping subsets, so some logic for that can be removed). |
1ef8149
to
3d65c12
Compare
3d65c12
to
d3edf57
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.
As viewer limits readjust (which seems to be much slower when linked by WCS), the outline can disappear. This might confuse the user in thinking that things are broken. Should this behavior be documented as a known thing somewhere in user doc?
Maybe also document that this outline would only appear for the subset selected as aperture, not as background.
|
||
To use in a plugin: | ||
|
||
* add ``ApertureSubsetSelectMixin`` as a mixin to the class BEFORE ``DatasetSelectMixin`` |
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.
Maybe explain here why BEFORE is emphasize here?
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.
because it is necessary to add it before and not after because of inheritance order
Seems to work fine in Cubeviz. But I do wonder if there is a need to outline the entire image when aperture is "Entire Cube" to be consistent. (Maybe not?) |
Co-authored-by: P. L. Lim <[email protected]>
I think this will improve greatly as we improve the zoom performance when linked by WCS. But if it doesn't, we can maybe do some visual tricks to make the transition more smooth.
We can do this temporarily, but I have plans down the road to move away from that as we build out spectral extraction and may want to do the same for aperture photometry 🤷♂️
I am running into tracebacks from the image rotation PR when trying to reproduce this so am not sure that this PR is to blame or if its a more general bug we have to fix. I'll make sure that ticket exists 🐱 and also covers testing the aperture workflow. If there is a way to reproduce without tracebacks from the orientation plugin, then this might be to blame and I'm happy to look into it (please provide a recording or script).
Fixed, thanks! (EDIT: except for the resulting test failure.... working on it)
Yeah, I wasn't sure... we also will need to decide what to do in the future for subsets that are not apertures since spectral extraction will need to be able to select composite subsets, but won't have sub-pixel or wavelength-dependent support for those (most likely). So is the preview intended to show the selection or just to approximately visualize how sub-pixel and wavelength dependence is being handled 🤷♂️ |
I didn't see the traceback. I did this:
|
(including hiding when no dataset is selected)
e4eff61
to
9f42104
Compare
Ah... So I think the calculation needs to be per viewer. Looks to me like you computed the viewer coords for second viewer and then apply it to first viewer. Does that make sense? |
It should be, it loops through each viewer and re-computes the coords based on |
@pllim - turned out to be a super-simple/stupid fix. Should be working now 🤞 |
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 now. Thanks!
* basic infrastructure for ApertureSelect component with associated marks * multiple subset support * radius_factor support for upcoming cones * multiviewer support * update mark when changing link type * changelog entry * code cleanup * simplify coords logic thanks to suggestion by @pllim * support rectangles and ellipses * and rename radius_factor > scale_factor * integrate into cubeviz spectral extraction for future cone support * basic test coverage for cone visualization * update docstrings * update marks on change to subset * revert simplification so that marks update correctly on change to ref * Apply suggestions from code review Co-authored-by: P. L. Lim <[email protected]> * update marks when selected dataset is changed (including hiding when no dataset is selected) * fix aperture preview in multiple viewers with different rotations --------- Co-authored-by: P. L. Lim <[email protected]>
Description
This pull request implements live-preview plugin marks for aperture selection. This is currently only accessible for users in aperture photometry in Imviz, but is designed to be extended for aperture photometry and spectral extraction (including cone support) in cubeviz (see below for the hidden implementation of cone preview in cubeviz's spectral extraction).
Screen.Recording.2024-01-18.at.9.07.06.AM.mov
Feature-Preview: Cone Apertures in Cubeviz
To enable the cone preview (this is not available to users since it doesn't actually do anything yet, so is hidden behind a "feature flag"):
Screen.Recording.2024-01-18.at.1.40.05.PM.mov
Note that this also renames
spatial_subset
within spectral extraction toaperture
(with a deprecation warning).TODO:
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.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.