import astropy
import astropy.units as u
from astropy.coordinates import SkyCoord
import astropy.time
from astropy.visualization import time_support, ImageNormalize, LogStretch
import numpy as np
import matplotlib.pyplot as plt
import sunpy
import sunpy.map
from sunpy.net import Fido, attrs as a
from sunpy.time import parse_time
import aiapy
from aiapy.psf import psf, deconvolve
from aiapy.calibrate import (register,update_pointing,correct_degradation, estimate_error,
degradation,normalize_exposure, respike, fetch_spikes)
from aiapy.calibrate.util import get_correction_table
from aiapy.response import Channel
import matplotlib as mpl
# Increases the figure size in this notebook.
mpl.rcParams["savefig.dpi"] = 150
mpl.rcParams["figure.dpi"] = 150
The Atmospheric Imaging Assembly (AIA) instrument onboard the NASA Solar Dynamics Observatory (SDO) spacecraft has observed the full- disk of the Sun, nearly continuously, for the last ten years. It is one of three instruments on SDO, along with the Helioseismic and Magnetic Imager (HMI) and the Extreme Ultraviolet Variability Experiment (EVE). AIA is a narrowband imaging instrument comprised of four separate telescopes that collectively observe the full-disk of the Sun at ten different wavelengths: seven extreme ultraviolet (EUV) wavelengths, two far UV wavelengths, and one visible wavelength.
aiapy
is a SunPy-affiliated Python package for analyzing calibrated (level 1) imaging data from AIA.
It includes capabilities for aligning images between channels, deconvolving images with the instrument point-spread function (PSF), computing channel sensitivity as a function of wavelength, and correcting images for telescope degradation, among others.
These capabilities are divided between the three subpackages of aiapy
:
aiapy.calibrate
aiapy.psf
aiapy.response
In this blog post, we will demonstrate the functions in each of these subpackages on a set of example level 1 AIA images.
Before we begin, we make a note of what versions of astropy
, sunpy
, and aiapy
were used in the writing of this blog post.
print(f'astropy v{astropy.__version__}')
print(f'sunpy v{sunpy.__version__}')
print(f'aiapy v{aiapy.__version__}')
astropy v4.2.1 sunpy v3.1.2 aiapy v0.6.3
First, we will use the Fido
client to fetch two AIA images from the VSO: one from the 171 Å channel and one from the 335 Å channel.
t_start = parse_time('2017-09-10T20:00:00')
search_results = Fido.search(
a.Time(t_start, t_start+11*u.s),
a.Instrument.aia,
a.Wavelength(171*u.angstrom) | a.Wavelength(335*u.angstrom),
)
search_results
Start Time | End Time | Source | Instrument | Wavelength [2] | Provider | Physobs | Wavetype | Extent Width | Extent Length | Extent Type | Size | Info |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Angstrom | Mibyte | |||||||||||
object | object | str3 | str3 | float64 | str4 | str9 | str6 | str4 | str4 | str8 | float64 | str57 |
2017-09-10 20:00:09.000 | 2017-09-10 20:00:10.000 | SDO | AIA | 171.0 .. 171.0 | JSOC | intensity | NARROW | 4096 | 4096 | FULLDISK | 64.64844 | AIA level 1, 4096x4096 [2.000 exposure] [100.00 percentd] |
Start Time | End Time | Source | Instrument | Wavelength [2] | Provider | Physobs | Wavetype | Extent Width | Extent Length | Extent Type | Size | Info |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Angstrom | Mibyte | |||||||||||
object | object | str3 | str3 | float64 | str4 | str9 | str6 | str4 | str4 | str8 | float64 | str57 |
2017-09-10 20:00:00.000 | 2017-09-10 20:00:01.000 | SDO | AIA | 335.0 .. 335.0 | JSOC | intensity | NARROW | 4096 | 4096 | FULLDISK | 64.64844 | AIA level 1, 4096x4096 [2.901 exposure] [100.00 percentd] |
files = Fido.fetch(search_results, max_conn=1)
Files Downloaded: 100%|██████████| 2/2 [00:01<00:00, 1.15file/s]
We can then create sunpy.map.Map
objects from the downloaded files.
m_171, m_335 = sunpy.map.Map(sorted(files))
m_171.peek(vmin=0)
m_335.peek(vmin=0)