Note
Go to the end to download the full example code.
Tracking an Active Region Across the Solar Disk#
This example demonstrates how to track an active region as it rotates across the solar disk and make cutouts around that active region at each time step to build a tracked datacube.
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.visualization import ImageNormalize, SqrtStretch
import sunpy.map
from sunpy.coordinates import propagate_with_solar_surface
from sunpy.net import Fido
from sunpy.net import attrs as a
First, let’s download a series of images in time using Fido
.
In this example, we will download a series of AIA 171 Å images observed over the course
of half of a day at a cadence of 1 image every 1 hour.
query = Fido.search(a.Time('2018-05-30 00:00:00', '2018-05-30 12:00:00'),
a.Instrument.aia,
a.Wavelength(171*u.angstrom),
a.Sample(1*u.h))
print(query)
files = Fido.fetch(query)
Results from 1 Provider:
12 Results from the VSOClient:
Source: https://sdac.virtualsolar.org/cgi/search
Data retrieval status: https://docs.virtualsolar.org/wiki/VSOHealthReport
Total estimated size: 813.466 Mbyte
Start Time End Time Source Instrument Wavelength Provider Physobs Wavetype Extent Width Extent Length Extent Type Size
Angstrom Mibyte
----------------------- ----------------------- ------ ---------- -------------- -------- --------- -------- ------------ ------------- ----------- --------
2018-05-30 00:00:09.000 2018-05-30 00:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 01:00:09.000 2018-05-30 01:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 02:00:09.000 2018-05-30 02:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 03:00:09.000 2018-05-30 03:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 04:00:09.000 2018-05-30 04:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 05:00:09.000 2018-05-30 05:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 06:00:09.000 2018-05-30 06:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 07:00:09.000 2018-05-30 07:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 08:00:09.000 2018-05-30 08:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 09:00:09.000 2018-05-30 09:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 10:00:09.000 2018-05-30 10:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
2018-05-30 11:00:09.000 2018-05-30 11:00:10.000 SDO AIA 171.0 .. 171.0 JSOC intensity NARROW 4096 4096 FULLDISK 64.64844
Now that we have a set of images in time, we can create a MapSequence
to hold all of them
and animate that sequence in time.
aia_sequence = sunpy.map.Map(files, sequence=True)
fig = plt.figure()
ax = fig.add_subplot(projection=aia_sequence[0])
norm = norm=ImageNormalize(vmin=0, vmax=3e3, stretch=SqrtStretch())
ani = aia_sequence.plot(axes=ax, norm=norm)