-
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
Fix Cubeviz mouseover bugs, add WCS to moment map #2009
Conversation
Moment map now has WCS attached to it. Fix tests.
Codecov ReportBase: 92.09% // Head: 92.08% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2009 +/- ##
==========================================
- Coverage 92.09% 92.08% -0.02%
==========================================
Files 140 140
Lines 15373 15381 +8
==========================================
+ Hits 14158 14163 +5
- Misses 1215 1218 +3
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. |
@@ -36,7 +37,7 @@ def test_moment_calculation(cubeviz_helper, spectrum1d_cube, tmpdir): | |||
assert len(mv_data) == 1 | |||
assert mv_data[0].label == 'moment 0' | |||
|
|||
assert len(dc.links) == 8 | |||
assert len(dc.links) == 14 |
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.
Do you know why there are so many more links? Is it because the moment map now has WCS and WCS uses more links?
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.
That is my guess. Before this, moment map has no WCS, and we hacked Cubeviz to secretly grab the WCS from the "flux" cube.
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.
But why 14 and not 10, that I don't know. Someone who knows how to read the links mini-language can tell me.
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.
If you run the test case in an interactive notebook, you can get out the following. Does this look about right? Or is something off?
for i, link in enumerate(dc.links):
print(f"{i+1}: " + link.to_html() + "<br/>")
2: [test[FLUX]].Declination ← using([test[FLUX]].Pixel Axis 0 [z], [test[FLUX]].Pixel Axis 1 [y])
3: [test[FLUX]].Wave ← using([test[FLUX]].Pixel Axis 2 [x])
4: [moment 0].Pixel Axis 0 [y] ← using([moment 0].Declination, [moment 0].Right Ascension)
5: [moment 0].Pixel Axis 1 [x] ← using([moment 0].Declination, [moment 0].Right Ascension)
6: [test[FLUX]].Pixel Axis 0 [z] ← WCSLink.backwards_2([moment 0].Pixel Axis 1 [x], [moment 0].Pixel Axis 0 [y])
7: [test[FLUX]].Pixel Axis 0 [z] ← using([test[FLUX]].Right Ascension, [test[FLUX]].Declination)
8: [moment 0].Pixel Axis 0 [y] ← WCSLink.forwards_2([test[FLUX]].Pixel Axis 1 [y], [test[FLUX]].Pixel Axis 0 [z])
9: [moment 0].Declination ← using([moment 0].Pixel Axis 0 [y], [moment 0].Pixel Axis 1 [x])
10: [test[FLUX]].Pixel Axis 1 [y] ← using([test[FLUX]].Right Ascension, [test[FLUX]].Declination)
11: [moment 0].Right Ascension ← using([moment 0].Pixel Axis 0 [y], [moment 0].Pixel Axis 1 [x])
12: [test[FLUX]].Pixel Axis 2 [x] ← using([test[FLUX]].Wave)
13: [test[FLUX]].Pixel Axis 1 [y] ← WCSLink.backwards_1([moment 0].Pixel Axis 1 [x], [moment 0].Pixel Axis 0 [y])
14: [test[FLUX]].Right Ascension ← using([test[FLUX]].Pixel Axis 0 [z], [test[FLUX]].Pixel Axis 1 [y])
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 original 8:
3: [test[FLUX]].Wave ← using([test[FLUX]].Pixel Axis 2 [x])
6: [test[FLUX]].Pixel Axis 0 [z] ← WCSLink.backwards_2([moment 0].Pixel Axis 1 [x], [moment 0].Pixel Axis 0 [y])
7: [test[FLUX]].Pixel Axis 0 [z] ← using([test[FLUX]].Right Ascension, [test[FLUX]].Declination)
10: [test[FLUX]].Pixel Axis 1 [y] ← using([test[FLUX]].Right Ascension, [test[FLUX]].Declination)
12: [test[FLUX]].Pixel Axis 2 [x] ← using([test[FLUX]].Wave)
13: [test[FLUX]].Pixel Axis 1 [y] ← WCSLink.backwards_1([moment 0].Pixel Axis 1 [x], [moment 0].Pixel Axis 0 [y])
14: [test[FLUX]].Right Ascension ← using([test[FLUX]].Pixel Axis 0 [z], [test[FLUX]].Pixel Axis 1 [y])
Additional 6:
4: [moment 0].Pixel Axis 0 [y] ← using([moment 0].Declination, [moment 0].Right Ascension)
5: [moment 0].Pixel Axis 1 [x] ← using([moment 0].Declination, [moment 0].Right Ascension)
8: [moment 0].Pixel Axis 0 [y] ← WCSLink.forwards_2([test[FLUX]].Pixel Axis 1 [y], [test[FLUX]].Pixel Axis 0 [z])
9: [moment 0].Declination ← using([moment 0].Pixel Axis 0 [y], [moment 0].Pixel Axis 1 [x])
11: [moment 0].Right Ascension ← using([moment 0].Pixel Axis 0 [y], [moment 0].Pixel Axis 1 [x])
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.
It looks like there are two links between the moment and flux data pixel axes, two mapping pixel to RA/Dec, and two mapping RA/Dec to pixel. Considering similar pixels <-> RA/Dec links exist for the flux data, this doesn't worry me (despite not 100% understanding all of the underlying linking logic). I'd be ok merging.
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.
Tested and it works well! I'm just worried about all the changes to linking in the tests but the added functionality is worth the slightly slower load time.
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.
Does this same fix affect - or should be applied to - any other plugins (collapse for example)?
# Link 3: | ||
# Pixel Axis 0 [z] from cube.pixel_component_ids[0] | ||
# Pixel Axis 1 [x] from plugin.pixel_component_ids[1] | ||
assert dc.external_links[2].cids1[0] == dc[0].pixel_component_ids[0] | ||
assert dc.external_links[2].cids2[0] == dc[-1].pixel_component_ids[1] | ||
# Link 4: | ||
# Pixel Axis 1 [y] from cube.pixel_component_ids[1] | ||
# Pixel Axis 0 [y] from plugin.pixel_component_ids[0] | ||
assert dc.external_links[3].cids1[0] == dc[0].pixel_component_ids[1] | ||
assert dc.external_links[3].cids2[0] == dc[-1].pixel_component_ids[0] |
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.
should these tests be replaced with anything with the new linking, or are they irrelevant 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.
Those external links do not exist anymore. There is nothing to replace.
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.
but now there are new internal links..... do those need testing or is that testing covered by other WCS linking tests?
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.
Please see #2009 (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.
ok... so should we hold off merge until someone can dig into that and confirm? @javerbukh?
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.
Probably cannot get to that today but it's a good opportunity for someone to get familiar with linking! 😉
Maybe spatial collapse, but then again, you cannot really write it back out in the plugin, so it does not matter for 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.
Maybe spatial collapse, but then again, you cannot really write it back out in the plugin, so it does not matter for now?
Discussed offline and decided this can be a follow-up effort (technically the user can still manually save to a file, and we may implement saving to a file in the UI in the future... so would probably still be good to update).
Since @rosteen looked at the links and no one sees any major issues... once that ticket is created and this is rebased and passing CI (EDIT: nevermind, just changelog in conflict, so CI should be good to go!), feel free to merge!
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Okay, we cannot backport this because it builds on #1976. |
NOTE: this is just switching one wrong value for another since spacetelescope#2009 is not being backported
NOTE: this is just switching one wrong value for another since spacetelescope#2009 is not being backported
…r) (#2060) * Backport PR #2056: fix initial slice of uncert-viewer * update mouseover test NOTE: this is just switching one wrong value for another since #2009 is not being backported --------- Co-authored-by: P. L. Lim <[email protected]> Co-authored-by: Kyle Conroy <[email protected]>
Description
This pull request is to:
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.