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

ra/dec in degree in cursor WCS value #100

Open
eriniocentric opened this issue Nov 15, 2019 · 7 comments
Open

ra/dec in degree in cursor WCS value #100

eriniocentric opened this issue Nov 15, 2019 · 7 comments
Labels
backend: ginga enhancement New feature or request

Comments

@eriniocentric
Copy link

Maybe I've missed it, but I don't think it's built into core.py. Can we have an option to switch the printed coordinate system info from hour angles to degrees. Thanks!

@pllim

This comment has been minimized.

@pllim

This comment has been minimized.

@pllim
Copy link
Member

pllim commented Nov 15, 2019

I am guessing you are using the Ginga backend? Are you using a released version of astrowidget or the dev version?

@eriniocentric
Copy link
Author

Hi! I'm probably using the released version. Just the one that automatically pip installed.

@pllim
Copy link
Member

pllim commented Nov 15, 2019

But regardless, yes, I don't think it is possible for user to customize the display format without tinkering with the code. What you can do for now is to subclass the widget and then overwrite this:

if image.wcs.wcs is not None:
ra, dec = image.pixtoradec(data_x, data_y)
val += ' (RA: {}, DEC: {})'.format(
raDegToString(ra), decDegToString(dec))

@pllim pllim added the enhancement New feature or request label Nov 15, 2019
@eriniocentric
Copy link
Author

Great.. that's what I was wondering..

Although I'm not quite sure how to subclass that through the ImageWidget I have. I'll try to dig a bit deeper. How do you call image = viewer.get_image() ? I see a _viewer attribute but it doesn't have a wcs attribute.

@pllim
Copy link
Member

pllim commented Nov 15, 2019

It is a callback method used internally, so it will automagically find the WCS if your image has a valid WCS. When you subclass, you can redefine that method basically by copy-pasting and only modifying the string formatting portion. I hope this makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: ginga enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants