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

Imviz: Show coordinates in degrees too #971

Merged
merged 5 commits into from
Dec 1, 2021

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Nov 23, 2021

Description

This pull request is to address the first point mentioned in #598 .

🐱

@Jenneh, would be nice to have your input on this. Thanks!

Todo

Screenshots

Without this patch (HST/ACS):

Screenshot 2021-11-23 150703

With this patch:

Data source Screenshot
HST/ACS Screenshot 2021-11-24 012013
HST/ACS (out of bounds) Screenshot 2021-11-24 012714
JWST/NIRCam Screenshot 2021-11-24 011923
JWST/NIRCam (out of bounds) Screenshot 2021-11-24 012038
Numpy array Screenshot 2021-11-24 011948

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? Milestone is only currently required for PRs related to Imviz MVP.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@pllim pllim added this to the 2.1 milestone Nov 23, 2021
@github-actions github-actions bot added the imviz label Nov 23, 2021
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #971 (4120379) into main (cd826c5) will increase coverage by 0.53%.
The diff coverage is 24.32%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #971      +/-   ##
==========================================
+ Coverage   70.06%   70.59%   +0.53%     
==========================================
  Files          71       73       +2     
  Lines        5121     5391     +270     
==========================================
+ Hits         3588     3806     +218     
- Misses       1533     1585      +52     
Impacted Files Coverage Δ
jdaviz/configs/imviz/plugins/viewers.py 42.85% <0.00%> (ø)
...z/configs/imviz/plugins/coords_info/coords_info.py 45.00% <29.03%> (-55.00%) ⬇️
...igs/default/plugins/model_fitting/model_fitting.py 28.28% <0.00%> (-0.77%) ⬇️
jdaviz/models/__init__.py 100.00% <0.00%> (ø)
jdaviz/models/physical_models.py 91.66% <0.00%> (ø)
jdaviz/core/helpers.py 19.58% <0.00%> (+1.58%) ⬆️
...configs/default/plugins/data_tools/file_chooser.py 69.14% <0.00%> (+3.42%) ⬆️
jdaviz/configs/mosviz/helper.py 75.20% <0.00%> (+3.66%) ⬆️
...figs/default/plugins/model_fitting/initializers.py 42.35% <0.00%> (+6.53%) ⬆️

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 cd826c5...4120379. Read the comment docs.

@@ -2,5 +2,6 @@
<div v-if="pixel" style="white-space: nowrap;">
<b v-if="pixel">Pixel </b>{{ pixel }}&nbsp;&nbsp;<b v-if="value">Value </b>{{ value }}<br>
<b v-if="world">World </b>{{ world }}<br>
<b v-if="world">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>{{ world_deg }}<br>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe @kecnry knows a better way to do this... 😅

Kinda hard to get them align perfectly from image to image, but hopefully this is good enough without having to specify a special div for each sub-element.

Copy link
Collaborator

@rosteen rosteen Nov 23, 2021

Choose a reason for hiding this comment

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

You should be able to use <v-col> here I think, to make everything line up without this workaround.

Copy link
Member

Choose a reason for hiding this comment

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

I can think of many other ways to do this... but they all require nesting more elements or providing a fixed width for your empty <b> element. But I think unless we want to structure this further, this is probably fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should I try out the <v-col> stuff, or leave it as &nbsp; like it is 1999?

Copy link
Member

Choose a reason for hiding this comment

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

I guess using columns would be a little more font-safe (for non-fixed-width fonts where nbsp might not line up well) and would be more future proof to maintain down the road

@rosteen
Copy link
Collaborator

rosteen commented Nov 23, 2021

I was going to say that I dislike how tall the toolbar is getting to fit this and recommend a toggle to switch between the two types, but then I saw that the toolbar seems to be just as tall on main. So I guess it's fine!

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.

Seems straightforward enough to me and confirmed to work and display well on my end!

@PatrickOgle
Copy link
Contributor

The mouseover coordinates layout shown above looks good. Official review later...

@PatrickOgle
Copy link
Contributor

PatrickOgle commented Nov 23, 2021

Too many significant figures for the decimal degree coordinates. I think 10 decimal places will cover most needs (microarcsec).

@pllim

This comment has been minimized.

@pllim

This comment has been minimized.

<b v-if="world">World </b>{{ world }}<br>
</div>
<div v-if="pixel" style="white-space: nowrap;">
<table>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My vuejs-fu is too weak. I think this accomplishes what you asked for, but I don't know how robust it is across browser and monitor settings...

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me. At small widths, it overlaps the plugin menu button, but that button isn't clickable while mousing over the image anyways. We have another ticket to eventually deal with minimum widths and overflowing across the app, so I don't think you need to worry about that too much right now.

Copy link
Contributor

@PatrickOgle PatrickOgle 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.

kecnry and others added 3 commits November 30, 2021 09:34
* attempt to fix padding inconsistencies between browsers and jupyter notebook vs lab
Attempt to fix vertical padding on pixel coordinate div in imviz
@pllim
Copy link
Contributor Author

pllim commented Dec 1, 2021

Kyle has fixed the padding problem, so I am going to merge when CI passes. Thanks, everyone!

@pllim pllim merged commit d30bbeb into spacetelescope:main Dec 1, 2021
@pllim pllim deleted the show-me-the-degrees branch December 1, 2021 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants