Created
July 13, 2021 17:23
-
-
Save dstansby/7d69ac35df87adbb97ff49042e7b28bb 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
from astropy.coordinates import SkyCoord | |
import astropy.units as u | |
from matplotlib.colors import LogNorm | |
import matplotlib.pyplot as plt | |
import sunpy.data.sample | |
import sunpy.map | |
from skimage.transform import warp_polar | |
map_aia = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) | |
center_coord = SkyCoord(0*u.deg, 0*u.deg, frame=map_aia.coordinate_frame) | |
cpix = map_aia.world_to_pixel(center_coord) | |
center_pixel = (cpix.x.to_value(u.pix), cpix.y.to_value(u.pix)) | |
new_data = warp_polar(map_aia.data, center=center_pixel) | |
plt.imshow(new_data.T, | |
origin='lower', | |
norm=map_aia.plot_settings['norm'], | |
cmap=map_aia.plot_settings['cmap']) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment