Creating a Heliographic Map

In this example we use the reproject generate an image in heliographic coordinates from an AIA image.

You will need reproject v0.6 or higher installed.

import matplotlib.pyplot as plt

import astropy.units as u
from astropy.coordinates import SkyCoord

import sunpy.data.sample
import sunpy.map

We will start with using sunpy’s sample data for this example.

aia_map = sunpy.map.Map(sunpy.data.sample.AIA_193_IMAGE)

plt.figure()
aia_map.plot()
plt.show()
AIA $193 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:07

Reproject works by transforming an input image to a desired World Coordinate System (WCS) projection. Here we use sunpy.map.make_fitswcs_header() to create a FITS WCS header based on a Stonyhurst heliographic reference coordinate and the CAR (plate carrée) projection.

shape_out = (720, 1440)
frame_out = SkyCoord(0, 0, unit=u.deg,
                     frame="heliographic_stonyhurst",
                     obstime=aia_map.date,
                     rsun=aia_map.coordinate_frame.rsun)
header = sunpy.map.make_fitswcs_header(shape_out,
                                       frame_out,
                                       scale=(360 / shape_out[1],
                                              180 / shape_out[0]) * u.deg / u.pix,
                                       projection_code="CAR")

With the new header, re-project the data into the new coordinate system. The reproject_to() defaults to using the fast reproject.reproject_interp() algorithm, but a different algorithm can be specified (e.g., reproject.reproject_adaptive()).

outmap = aia_map.reproject_to(header)

Plot the result.

plt.figure()
outmap.plot()
outmap.draw_limb(color='blue')

plt.show()
2011-06-07 06:33:07

Total running time of the script: ( 0 minutes 2.264 seconds)

Gallery generated by Sphinx-Gallery