ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
122 stars 77 forks source link

Query WCS directly to get the rotation and scale #834

Open ejeschke opened 4 years ago

ejeschke commented 4 years ago

looking at your implementation of ginga.util.mosaic.CanvasMosaicer, it seems like it uses FITS WCS. For this purpose, I think that is fine (or can be left as a future PR if GWCS is really necessary).

Unfortunately, it is simply looking at the FITS header. I think it would be better to query the WCS directly to get the rotation and scale. That should support GWCS. I think a new PR would be appropriate, basically moving the functions from ginga.util.wcs to the wrappers in ginga.util.wcsmod. There it could eventually be refactored to make the appropriate calls to the actual wcs objects.

Originally posted by @ejeschke in https://github.com/ejeschke/ginga/pull/812#issuecomment-580468069

ejeschke commented 4 years ago

If there are routines in astropy WCS to get rotation and scale from an image's FITS keywords, use that implementation rather than Ginga's.