Skip to content

change AstropyWCS2 to correctly expose coordsys as a string - #254

Closed
eteq wants to merge 1 commit into
ejeschke:masterfrom
eteq:fix-113
Closed

eteq wants to merge 1 commit into
ejeschke:masterfrom
eteq:fix-113

Conversation

@eteq

@eteq eteq commented Dec 16, 2015

Copy link
Copy Markdown
Contributor

This contains the fix discussed in #113 that should hopefully make AstropyWCS2 work as intended.

@pllim - can you check if this fixes the initially reported issue from #113?

I thought about adding a test for this, but realized I'd need some test files and am not sure where/if I should include those in the ginga repo. Or if anyone has a small WCS header that they think should work, feel free to include it here and I can just try to include it in a test as an in-code build fits header or something.

@pllim

pllim commented Dec 16, 2015

Copy link
Copy Markdown
Collaborator

@eteq , my test case was just a header without any WCS info.

@pllim

pllim commented Dec 16, 2015

Copy link
Copy Markdown
Collaborator

I am getting this now for 'astropy2'. With 'astropy', I do not get any traceback. Both versions give me "no WCS" on the display, which is expected.

 File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/misc/plugins/Pan.py", line 249, in set_image
    image.add_offset_xy(x, y, 1.0, 1.0)
  File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/AstroImage.py", line 362, in add_offset_xy
    ra_deg, dec_deg = self.pixtoradec(x, y)
  File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/AstroImage.py", line 310, in pixtoradec
    ra_deg, dec_deg = self.wcs.pixtoradec(args, coords=coords)
  File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/util/wcsmod.py", line 326, in pixtoradec
    return self._frametofloats(self.pixtonative(idxs, coords=coords))
  File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/util/wcsmod.py", line 348, in pixtonative
    self.realize_frame_inplace(sky)
  File ".../ginga-2.5.20151215192336-py2.7.egg/ginga/util/wcsmod.py", line 286, in realize_frame_inplace
    if (issubclass(self.coordframe.representation,

@pllim

pllim commented Dec 16, 2015

Copy link
Copy Markdown
Collaborator

Let me put that file in Box, so you can go grab it and see for yourself.

@ejeschke

Copy link
Copy Markdown
Owner

@eteq, it would be great to have a unit test for this. I've just checked in a wcs unit test file that I've had sitting around for a while. That would be a great place to add a test. You might need to rebase the PR because it has some small changes to wcsmod. The test file is in ginga.tests called test_wcs.py

Comment thread ginga/util/wcsmod.py

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks like this is executed twice? Once before at line 245?

@eteq

eteq commented Dec 16, 2015

Copy link
Copy Markdown
Contributor Author

aha, I think I see the problem, and can fix it in a proximate sense, but before I do, just so I don't induce more problems... @ejeschke, can you clarify for me what the "outside" interface is to the WCS? Is http://ginga.readthedocs.org/en/latest/manual/internals.html#i-want-to-use-my-own-world-coordinate-system still accurate, or is there more since that was made? (coordsys isn't on there, for example.)

And what is the difference between pixtoradec and pixtosystem?

@ejeschke

Copy link
Copy Markdown
Owner

@eteq, I've updated the documentation in the base class for WCS wrappers. Let me know if you need more information.

@pllim

pllim commented Dec 17, 2015

Copy link
Copy Markdown
Collaborator

@ejeschke , can you confirm if updating the documentation triggers automatic RTD build? (for #219)

@ejeschke

Copy link
Copy Markdown
Owner

@pllim, doc builds are now triggered correctly.

@pllim

pllim commented Dec 27, 2015

Copy link
Copy Markdown
Collaborator

Yay! Thanks for checking, @ejeschke ! 👍

@pllim

pllim commented Jan 27, 2017

Copy link
Copy Markdown
Collaborator

I see that there has been some work to optimize AstropyWCS in the Astropy repo. Is AstropyWCS2 still necessary in Ginga?

@Cadair

Cadair commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

Yes, and it infact needs a re-write to make use of the new optimisations in 1.3. It's on my todo list, but can't say it's very near the top!

@ejeschke

Copy link
Copy Markdown
Owner

Is the correct WCS handling for your solar frames merged into astropy.wcs, @Cadair ? I think that was another one of the original reasons for this version.

It would be useful to have this version fixed up if it can make use of the new optimizations. The problem caused by the speed of coordinate conversion was fixed with a workaround in ginga, but making use of the optimization would speed up rendering of graphics that are plotted in WCS coords.

@Cadair

Cadair commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

@ejeschke astropy.wcs does not do a good job with solar stuff, it get's the base maths right but it doesn't follow convention etc. astropy.coordinates in combination with sunpy.coordinates does all that on top of astropy.wcs though.

I will try and bump this up my todo list.

@eteq

eteq commented Jan 30, 2017

Copy link
Copy Markdown
Contributor Author

@Cadaur - do you want to do this in a separate PR (i.e., I should close this), or as an add-on to this or something? At this point it's probably stale enough that maybe starting afresh is going to be needed anyway?

@Cadair

Cadair commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

@eteq I will take this and start again probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants