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: "White out" when center_on "off-screen, on-image" #704

Closed
pllim opened this issue Jun 25, 2021 · 9 comments · Fixed by #755
Closed

[BUG] Imviz: "White out" when center_on "off-screen, on-image" #704

pllim opened this issue Jun 25, 2021 · 9 comments · Fixed by #755
Labels
bug Something isn't working imviz

Comments

@pllim
Copy link
Contributor

pllim commented Jun 25, 2021

As reported by @ojustino while reviewing #687 .

To reproduce:

  1. Fire up Imviz.
  2. Load some image.
  3. Use imviz.center_on on a pixel location that is valid but far out from the displayed area.
  4. See nothing being displayed and no error. Viewer also becomes non-functional and has to be reloaded.

Example use case from Justin:

from astropy.coordinates import SkyCoord
from astropy.utils.data import download_file

from jdaviz.configs.imviz import Imviz

imviz = Imviz()

cygA1 = download_file('https://hla.stsci.edu/cgi-bin/getdata.cgi?dataset=hst_05368_01_wfpc2_f555w_pc_drz.fits', cache=True)
cygA2 = download_file('https://hla.stsci.edu/cgi-bin/getdata.cgi?dataset=hst_05368_01_wfpc2_f555w_wf_drz.fits', cache=True)

imviz.load_data(cygA1, data_label='cygA1')
imviz.load_data(cygA2, data_label='cygA2')

sky = SkyCoord('09h59m26.02s 40d44m17.92s')
imviz.center_on(sky)

🐱

@pllim pllim added bug Something isn't working imviz labels Jun 25, 2021
@pllim

This comment has been minimized.

@pllim
Copy link
Contributor Author

pllim commented Aug 3, 2021

Turns out, this is caused by WCS translation silently passing back (np.array(np.nan), np.array(np.nan))

@pllim
Copy link
Contributor Author

pllim commented Aug 3, 2021

With #755 , the original example will result in a warning due to invalid WCS -> pix conversion. So, there is no more problem of panning to nowhere.

@ojustino
Copy link
Contributor

ojustino commented Aug 4, 2021

I checked this again since I was the one who first reported it. Reading more closely, the white out was happening with invalid coordinates -- for example, the right ascension in the provided example is outside of the queried FITS images' fields of view, so it should trigger an out of bounds message.

Besides that, the white out still happens for me. I was previously using Edge, but I still see this behavior while using Firefox with the current main build of jdaviz that includes #755.

I'm also seeing a recurrence of the problem where I get the "(X, Y) is out of bounds" message for valid pixel or RA/Dec coordinates that are outside of the area currently displayed in the viewer. If I pan to a section of the image that does include those coordinates, then center_on works without issue.

@pllim
Copy link
Contributor Author

pllim commented Aug 4, 2021

@ojustino , your original example now emits a out of bounds warning, which I thought was the desired behavior. Could you please open a new issue and provide data and reproducible code snippets for the problems that still occur for you?

When I tested locally, besides your original example, I zoomed in a lot into a section of image, and then center_on the entirely different part that was out of display, and that worked for me. 🤔

@ojustino
Copy link
Contributor

ojustino commented Aug 4, 2021

@pllim I'm using the same snippet as above when I get the white out instead of the out of bounds warning. I was saying that number 3 in the above steps should be "Use imviz.center_on on a pixel location that is invalid" because the supplied coordinates are outside of the images' fields of view.

I believe everyone is getting the intended behavior but me, so I'm not sure that the issue is actually with jdaviz. That makes me hesitant to open another issue since the problem may just be my setup.

[Edit: It was indeed user error with the main branch. Everything with this fix works as expected for me now.]

@pllim
Copy link
Contributor Author

pllim commented Aug 5, 2021

To close this out: @ojustino has confirmed that this bug is now gone.

@stscijgbot-jwql
Copy link

This issue is tracked on JIRA as JDAT-1577.

@stscijgbot-jwql
Copy link

Comment by Pey-Lian Lim on JIRA:

Fix at #755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working imviz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants