Correcting for instrument degradation#

This example demonstrates the degradation of the filters on AIA and how to correct it.

import matplotlib.pyplot as plt

import astropy.time
import astropy.units as u
from astropy.visualization import time_support

from sunpy.net import Fido
from sunpy.net import attrs as a

from aiapy.calibrate import degradation
from aiapy.calibrate.util import get_correction_table

# This lets you pass `astropy.time.Time` objects directly to matplotlib
time_support(format="jyear")
<astropy.visualization.time.time_support.<locals>.MplTimeConverter object at 0x795e0fbf9790>

First, let’s fetch the metadata for the 335 Å channel of AIA between 2021 and 2023 at a cadence of 7 days. We choose the 335 Å channel because it has experienced significant degradation compared to the other EUV channels.

results = Fido.search(
    a.Time("2021-01-01T00:00:00", "2023-01-01T00:00:00"),
    a.Sample(7 * u.day),
    a.jsoc.Series.aia_lev1_euv_12s,
    a.jsoc.Wavelength(335 * u.angstrom),
)

We only need the date and mean intensity columns from the metadata that was returned. We select those and nothing else.

table = results["jsoc"].show("DATE__OBS", "DATAMEAN")
table["DATAMEAN"].unit = u.DN
table["DATE_OBS"] = astropy.time.Time(table["DATE__OBS"], scale="utc")
del table["DATE__OBS"]

print(table)
DATAMEAN         DATE_OBS
   DN
-------- -----------------------
  0.8555 2021-01-01T00:00:00.620
  0.6709 2021-01-08T00:00:00.620
  0.6219 2021-01-15T00:00:00.630
  0.7758 2021-01-22T00:00:00.630
  0.7389 2021-01-29T00:00:00.630
  0.6407 2021-02-05T00:00:00.630
  0.6212 2021-02-12T00:00:00.630
  0.9368 2021-02-19T00:00:00.620
  0.9861 2021-02-26T00:00:00.630
  0.9331 2021-03-05T00:00:00.640
  0.9662 2021-03-12T00:00:00.630
  0.9458 2021-03-19T00:00:00.630
  0.9806 2021-03-26T00:00:00.620
  0.8847 2021-04-02T00:00:00.630
  0.8187 2021-04-09T00:00:00.620
   0.971 2021-04-16T00:00:00.630
   1.042 2021-04-23T00:00:00.620
  0.9431 2021-04-30T00:00:00.620
  0.8648 2021-05-07T00:00:00.620
  0.9597 2021-05-14T00:00:00.620
  1.0089 2021-05-21T00:00:00.640
  1.1433 2021-05-28T00:00:00.630
  0.9932 2021-06-04T00:00:00.620
   1.119 2021-06-11T00:00:00.630
  0.9946 2021-06-18T00:00:00.630
  1.2402 2021-06-25T00:00:00.630
  1.3072 2021-07-02T00:00:00.630
  1.0882 2021-07-09T00:00:00.630
  1.0227 2021-07-16T00:00:00.630
   1.471 2021-07-23T00:00:00.630
  1.1849 2021-07-30T00:00:00.640
  1.1148 2021-08-06T00:00:00.620
  1.0403 2021-08-13T00:00:00.630
  1.1766 2021-08-20T00:00:00.630
  1.3043 2021-08-27T00:00:00.630
  1.3269 2021-09-03T00:00:00.620
  1.4085 2021-09-10T00:00:00.630
  1.0879 2021-09-17T00:00:00.630
   1.407 2021-09-24T00:00:00.630
    1.52 2021-10-01T00:00:00.630
  1.3033 2021-10-08T00:00:00.630
   1.257 2021-10-15T00:00:00.620
  1.2772 2021-10-22T00:00:00.620
  1.7614 2021-10-29T00:00:00.620
  1.5854 2021-11-05T00:00:00.610
  1.2733 2021-11-12T00:00:00.630
  1.1739 2021-11-19T00:00:00.620
  1.3369 2021-11-26T00:00:00.630
  1.3525 2021-12-03T00:00:00.620
  1.0294 2021-12-10T00:00:00.630
  1.7803 2021-12-17T00:00:00.630
  2.1924 2021-12-24T00:00:00.630
  1.7081 2021-12-31T00:00:00.620
  1.4153 2022-01-07T00:00:00.630
  1.8976 2022-01-14T00:00:00.620
  1.8489 2022-01-21T00:00:00.620
  1.8103 2022-01-28T00:00:00.630
  2.1548 2022-02-04T00:00:00.640
  2.0729 2022-02-11T00:00:00.620
  1.6891 2022-02-18T00:00:00.630
  1.6526 2022-02-25T00:00:00.620
  1.9156 2022-03-04T00:00:00.620
  2.2359 2022-03-11T00:00:00.630
  1.7823 2022-03-18T00:00:00.620
  1.8083 2022-03-25T00:00:00.630
  2.5153 2022-04-01T00:00:00.630
  2.1536 2022-04-08T00:00:00.620
  1.9163 2022-04-15T00:00:00.620
  2.4592 2022-04-22T00:00:00.630
  2.6317 2022-04-29T00:00:00.620
   2.123 2022-05-06T00:00:00.630
  2.4946 2022-05-13T00:00:00.620
  3.2291 2022-05-20T00:00:00.630
  2.4641 2022-05-27T00:00:00.630
  1.7527 2022-06-03T00:00:00.620
  2.2422 2022-06-10T00:00:00.630
  2.6808 2022-06-17T00:00:00.620
  2.1154 2022-06-24T00:00:00.630
  1.6938 2022-07-01T00:00:00.630
   2.211 2022-07-08T00:00:00.630
  2.8639 2022-07-15T00:00:00.620
  2.3783 2022-07-22T00:00:00.630
  1.5925 2022-07-29T00:00:00.630
  2.0197 2022-08-05T00:00:00.630
  2.1332 2022-08-12T00:00:00.630
  2.1391 2022-08-19T00:00:00.630
  1.8351 2022-08-26T00:00:00.630
  2.0944 2022-09-02T00:00:00.630
  2.4144 2022-09-09T00:00:00.630
  2.6269 2022-09-16T00:00:00.620
  2.4151 2022-09-23T00:00:00.630
  2.8349 2022-09-30T00:00:00.630
  2.9527 2022-10-07T00:00:00.630
  2.6489 2022-10-14T00:00:00.630
  2.2674 2022-10-21T00:00:00.620
  2.5536 2022-10-28T00:00:00.620
   2.682 2022-11-04T00:00:00.630
  2.5522 2022-11-11T00:00:00.630
  2.4727 2022-11-18T00:00:00.630
  2.1289 2022-11-25T00:00:00.630
  2.2118 2022-12-02T00:00:00.620
  2.6068 2022-12-09T00:00:00.620
  3.2372 2022-12-16T00:00:00.630
  2.5094 2022-12-23T00:00:00.630
  3.2047 2022-12-30T00:00:00.630

Next, we pass the date column to the aiapy.calibrate.correct_degradation function. This function calculates the time-dependent correction factor based on the time and wavelength of the observation. We then divide the mean intensity by the correction factor to get the corrected intensity. For more details on how the correction factor is calculated, see the documentation for the aiapy.calibrate.degradation function.

correction_factor = degradation(335 * u.angstrom, table["DATE_OBS"], correction_table=get_correction_table("jsoc"))
table["DATAMEAN_DEG"] = table["DATAMEAN"] / correction_factor

To understand the effect of the degradation and the correction factor, we plot the corrected and uncorrected mean intensity as a function of time. Note that the uncorrected intensity decreases monotonically over time while the corrected intensity recovers to pre-2011 values in 2020.

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(table["DATE_OBS"], table["DATAMEAN"], label="mean", marker="o")
ax.plot(table["DATE_OBS"], table["DATAMEAN_DEG"], label="corrected mean", marker="+")
ax.set_title(f"{(335 * u.angstrom).to_string(format='latex')} Channel Degradation")
ax.legend(frameon=False)

plt.show()
$335 \; \mathrm{\mathring{A}}$ Channel Degradation

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

Gallery generated by Sphinx-Gallery