Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Feature: An easy way to make a wcsaxes.WCS from an astropy.wcs.WCS object #186

Merged
merged 3 commits into from
Feb 3, 2016

Conversation

astrofrog
Copy link
Owner

The best way I can come up with is

ax = fig.add_subplot(1, 1 ,1 , projection=wcsaxes.WCS(astropywcs.to_header()))

Maybe this issue will solve itself when this is merged into astropy by just adding the required methods to the astropy WCS.
Until then (unless that happens soon), it would be nice to accept an astropy.wcs.WCS to initialize a WCS like so: wcsaxes.WCS(astropywcsinstance).

It's not so much the extra typing, but the fast that it took me almost an hour to discover this (or maybe I'm just dumb).

@astrofrog
Copy link
Owner

@hamogu - you can just do:

ax = fig.add_subplot(1, 1 ,1 , projection=astropywcs)

since Astropy's WCS knows of the existence of WCSAxes.

@astrofrog
Copy link
Owner

The wcsaxes.WCS class should actually be removed now that Astropy's WCS class works correctly.

@hamogu
Copy link
Author

hamogu commented Jan 30, 2016

I just followed the examples in the docs...

@astrofrog
Copy link
Owner

@hamogu - ah, good catch, I wanted to leave some time after 1.0 was released then forgot about it :)

@astrofrog
Copy link
Owner

@hamogu - could you review this?

@hamogu
Copy link
Author

hamogu commented Feb 2, 2016

Looks good to me; all the doc changes are relatively straightforward.
My only question is: What's the minimum version of astropy where this works?
installation.rst says "Astropy 1.0 or later". I don't know when the astropy WCS was changed to be compatible, but you probably know that on top of your head.

@astrofrog
Copy link
Owner

Astropy 1.0 is indeed when we added this.

astrofrog added a commit that referenced this pull request Feb 3, 2016
Feature: An easy way to make a `wcsaxes.WCS` from an `astropy.wcs.WCS` object
@astrofrog astrofrog merged commit d6888b3 into master Feb 3, 2016
astrofrog added a commit that referenced this pull request Nov 28, 2016
Feature: An easy way to make a `wcsaxes.WCS` from an `astropy.wcs.WCS` object
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants