Skip to content
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

BUG: Imviz bug fixes ported from PR 1340 #1392

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jun 10, 2022

Description

This pull request is to fix some bugs. The fixes were part of #1340 but now separated out into a proper bugfix PR.

  1. Fix Imviz coordinates display shows wrong X and Y for dithered image on load #1299
  2. Fixed a bug where Compass zoom box is wrong when the second image is rotated w.r.t. the reference image and they are linked by WCS.
  3. Fixed a bug where Line Profile might crash when the second image is rotated w.r.t. the reference image and they are linked by WCS, causing insufficient data for plot limit calculations.

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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@pllim pllim added the bug Something isn't working label Jun 10, 2022
@pllim pllim added this to the 2.7 milestone Jun 10, 2022
@github-actions github-actions bot added the imviz label Jun 10, 2022
@pllim pllim mentioned this pull request Jun 10, 2022
21 tasks
@pllim pllim force-pushed the imviz-coord-bugfix branch from 1a0d82a to ae706b6 Compare June 10, 2022 22:56
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #1392 (ae706b6) into main (6eea29d) will increase coverage by 0.07%.
The diff coverage is 95.45%.

@@            Coverage Diff             @@
##             main    #1392      +/-   ##
==========================================
+ Coverage   84.91%   84.99%   +0.07%     
==========================================
  Files          91       91              
  Lines        8288     8295       +7     
==========================================
+ Hits         7038     7050      +12     
+ Misses       1250     1245       -5     
Impacted Files Coverage Δ
jdaviz/configs/imviz/wcs_utils.py 67.96% <50.00%> (+1.29%) ⬆️
...s/imviz/plugins/line_profile_xy/line_profile_xy.py 99.04% <100.00%> (+0.07%) ⬆️
jdaviz/configs/imviz/plugins/viewers.py 82.35% <100.00%> (+1.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eea29d...ae706b6. Read the comment docs.

@pllim pllim marked this pull request as ready for review June 10, 2022 23:12
Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines +60 to +61
- Fixed a bug where coordinates display erroneously showing info from
the reference image even when it is not visible. [#1392]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to now account for layer.visible, but does it need to also account for layer.state.bitmap_visible and/or layer.state.contour_visible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm blink only sets .visible. I wasn't even aware of the other two attributes. What do they control?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether the image and contours are visible. So in order to see an image, both layer.visible and layer.state.bitmap_visible must be True (iirc).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never had to set .bitmap_visible for it to show. Is something not working for you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you leave the top layer's visibility on, but disable the bitmap_visible (either through the API or through the plot options), then the coordinates display will still use that layer, even though the user is not seeing it. You could argue that this is expected behavior since the layer as a whole is still enabled and that this will be "addressed" if/when we add an indication of the label of the "top/active" layer.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for now. I think we'll need to give more thought to the bitmap_visible=False case in determining the top-layer, but that is probably a broader decision than just the line profile case being edited here and likely needs a refactor to move the top-layer-detection logic to the viewer level so it can be implemented consistently across all plugins that need to access that information.

@kecnry kecnry merged commit d8aa2d2 into spacetelescope:main Jun 17, 2022
@pllim pllim deleted the imviz-coord-bugfix branch June 17, 2022 16:30
@pllim
Copy link
Contributor Author

pllim commented Jun 17, 2022

Thanks for the reviews and approvals!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imviz coordinates display shows wrong X and Y for dithered image on load
3 participants