Requesting cutouts of AIA images from the JSOC¶
This example shows how to request a cutout of a series of AIA images from the JSOC and animate the resulting sequence.
First, query a full frame AIA image.
Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/sunpy/checkouts/stable/examples/acquiring_data/downloading_cutouts.py", line 33, in <module> m = sunpy.map.Map(Fido.fetch(q)) File "/home/docs/checkouts/readthedocs.org/user_builds/sunpy/envs/stable/lib/python3.9/site-packages/sunpy/map/map_factory.py", line 340, in __call__ raise RuntimeError('No maps loaded') RuntimeError: No maps loaded
Next, we will create a submap from this image. We will crop the field of view to active region NOAA 11575.
We want to watch the evolution of this active region in time, but we do not want to download the full frame image at each timestep. Instead, we will use our submap to create a cutout request from the JSOC.
First, construct the cutout from the submap
above using the
cutout = a.jsoc.Cutout( m_cutout.bottom_left_coord, top_right=m_cutout.top_right_coord, tracking=True )
Exporting data from the JSOC requires registering your email first. Please replace this with your email address once you have registered. See this page for more details.
jsoc_email = os.environ["JSOC_EMAIL"]
Now we are ready to construct the query. Note that all of this is the same for a full-frame image except for the cutout component. We will download images from a 12 hour interval centered on the time of the above cutout. We request one image every 2 hours.
Submit the export request and download the data.
files = Fido.fetch(q) files.sort()
Now that we’ve downloaded the files, we can create
MapSequence from them.
m_seq = sunpy.map.Map(files, sequence=True)
Finally, we can construct an animation in time from our stack of cutouts and interactively flip through each image in our sequence. We first adjust the plot settings on each image to ensure the colorbar is the same at each time step.
Total running time of the script: ( 0 minutes 14.484 seconds)