Last active
August 29, 2015 13:57
-
-
Save astrofrog/9507255 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyavm | |
from matplotlib import pyplot as plt | |
from wcsaxes import WCS | |
from PIL import Image | |
avm = pyavm.AVM.from_image('gcenter.jpg') | |
wcs = avm.to_wcs(target_image='gcenter.jpg') | |
fig = plt.figure() | |
ax = WCSAxes(fig, [0.075, 0.1, 0.8, 0.8], wcs=wcs) | |
fig.add_axes(ax) | |
img = Image.open('gcenter.jpg') | |
img = img.transpose(Image.FLIP_TOP_BOTTOM) | |
coords = ax.get_coords_overlay('galactic') | |
coords.grid(color='orange', alpha=0.2) | |
ax.imshow(img, origin='lower') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment