Finding contours of a map

This example shows how to find and plot contours on a map.

import matplotlib.pyplot as plt

import astropy.units as u

from import AIA_193_IMAGE

Start by loading the sample data.

aiamap =

In finding a set of contours, we have to provide the level to contour in the same units as the map data. To find out the units we can inspect


We can see that the units of this map are ct, or counts. We can now chose a contour level, and use the contour() method to extract the contours.

contours = aiamap.contour(50000 * u.ct)

Finally, we can plot the map, and add each of the contours in turn.

fig = plt.figure()
ax = fig.add_subplot(projection=aiamap)
for contour in contours:
AIA $193 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:07

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

Gallery generated by Sphinx-Gallery