Skip to content

Instantly share code, notes, and snippets.

@dstansby
Created March 31, 2021 11:39
Show Gist options
  • Save dstansby/fb5150e6a5a5a7a21ccad7907ab73e4b to your computer and use it in GitHub Desktop.
Save dstansby/fb5150e6a5a5a7a21ccad7907ab73e4b to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
from reproject import reproject_interp
import sunpy.data.sample
import sunpy.map
map_aia = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
map_hmi = sunpy.map.Map(sunpy.data.sample.HMI_LOS_IMAGE)
map_hmi.plot_settings['cmap'] = "hmimag"
map_hmi.plot_settings['norm'] = plt.Normalize(-1500, 1500)
fig = plt.figure(figsize=(12, 5))
ax1 = fig.add_subplot(1, 2, 1, projection=map_aia)
map_aia.plot(axes=ax1)
ax2 = fig.add_subplot(1, 2, 2, projection=map_aia)
ax2.pcolormesh(map_hmi.data,
transform=ax2.get_transform(map_hmi.wcs),
cmap=map_hmi.plot_settings['cmap'],
norm=map_hmi.plot_settings['norm'])
ax2.set_aspect('equal')
ax2.set_xlim(0, map_hmi.data.shape[0])
ax2.set_ylim(0, map_hmi.data.shape[1])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment