-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Coordinates in cursor display may not be RA/Dec #149
Comments
I think in Ginga, we always convert to ICRS anyway? Can't remember exactly now. For Imviz, that also appears to be the case, as @astrofrog coded it: https://github.com/spacetelescope/jdaviz/blob/c2cf8cb4160448628ec480ba98e05abb7f852490/jdaviz/configs/imviz/plugins/viewers.py#L86 |
For Ginga, it does default to ICRS too but there is an option to customize for standalone app: https://github.com/ejeschke/ginga/blob/61d9791fc2803869174243510a2fabe15b22af2e/ginga/examples/configs/channel_Image.cfg#L58 |
In the current ginga demo notebook, though, centering on a from astropy.coordinates import SkyCoord
# Change the values here if you are not using given
# example image.
ra_str = '01h13m23.193s'
dec_str = '+00d12m32.19s'
frame = 'icrs'
# Programmatically center to SkyCoord on viewer
w.center_on(SkyCoord(ra_str, dec_str, frame=frame)) This centers on one of the bright stars even though the RA/Dec is very different according to the FITS header:
|
So it sounds like the issue may really just be that ginga seems to assume that the initial WCS is galactic not ICRS.... |
I am not familiar with the content of that file. Just something I (or someone) grabbed from Astropy data server: http://data.astropy.org/photometry/spitzer_example_image.fits Have to ask Spitzer what those keywords really mean, I guess? |
But the initial WCS is Galactic... isn't it?
|
Yep -- I noticed it because in the bqplot viewer draft I was explicitly setting the display to |
I guess I don't understand your comment at #149 (comment) -- Are you saying there is a bug in the notebook, Ginga backend implementation here, or Ginga WCS handling? |
I think I'm saying it is a combination of notebook bug, Ginga backend implementation, and maybe the use of Ginga's world/pixel conversions instead of astropy's. When the Ginga WCS is created from this image it correctly recognizes that the WCS is in galactic coordinates. So far, so good.
I don't think there is anything to fix immediately -- I'm keeping track of the additional API questions I have as I work out the remaining bugs in the bqplot viewer. In any event, it is good this was the example image -- I wouldn't have thought to try an image in a non-ICRS frame! |
My head is spinning, LoL! Perhaps in the widget implementation of Ginga backend, there was an oversight. If you look at standalone app, there seems to be some system-specific handling at https://github.com/ejeschke/ginga/blob/61d9791fc2803869174243510a2fabe15b22af2e/ginga/AstroImage.py#L490 . |
Just gonna try my luck to ping @ejeschke here in case he has insight on Ginga behavior. |
@mwcraig, @pllim, this is simply the cursor display making the assumption about what the coordinates are (i.e. the format string here). The Ginga reference viewer has a more sophisticated processing of the WCS output. Wouldn't it make sense to process the cursor display using common astropy routines if you have different backends? Basically you pass the X/Y coords to common routines that can return coordinates and labels as strings. Then these strings can be displayed according to the specific backend's method. |
I noticed while working on #142 that although the cursor is always labeled as RA/Dec it is not necessary actually RA/Dec. In the ginga implementation the sample image has a WCS in galactic coordinates and that is what the cursor displays. I don't know that that is wrong, necessarily, but it is incorrect to label it as RA/Dec.
Seems like there are a couple of options:
@pllim -- you may want to check what the
imviz
viewer currently does. This question above is probably an API question rather than an implementation decision.The text was updated successfully, but these errors were encountered: