Registering and aligning level 1 data#

This example demonstrates how to convert AIA images to a common pointing, rescale them to a common plate scale, and remove the roll angle. This process is often referred to as “aia_prep” and the resulting data are typically referred to as level 1.5 data. In this example, we will demonstrate how to do this with aiapy. This corresponds to the procedure as described in the SDO Analysis Guide.


import as sample_data
from aiapy.calibrate import normalize_exposure, register, update_pointing
Files Downloaded:   0%|          | 0/3 [00:00<?, ?file/s]

aia_lev1_94a_2019_01_01t00_00_11_12z_image_lev1.fits:   0%|          | 0.00/10.5M [00:00<?, ?B/s]

aia_lev1_171a_2019_01_01t00_00_09_35z_image_lev1.fits:   0%|          | 0.00/11.6M [00:00<?, ?B/s]

aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits:   0%|          | 0.00/12.5M [00:00<?, ?B/s]

aia_lev1_94a_2019_01_01t00_00_11_12z_image_lev1.fits:  33%|███▎      | 3.44M/10.5M [00:00<00:00, 34.4MB/s]

aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits:   0%|          | 1.02k/12.5M [00:00<20:34, 10.1kB/s]

aia_lev1_171a_2019_01_01t00_00_09_35z_image_lev1.fits:   0%|          | 1.02k/11.6M [00:00<25:29, 7.61kB/s]

aia_lev1_94a_2019_01_01t00_00_11_12z_image_lev1.fits:  67%|██████▋   | 6.99M/10.5M [00:00<00:00, 33.3MB/s]

aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits:  15%|█▌        | 1.87M/12.5M [00:00<00:00, 10.6MB/s]

aia_lev1_171a_2019_01_01t00_00_09_35z_image_lev1.fits:  16%|█▌        | 1.83M/11.6M [00:00<00:01, 9.32MB/s]

aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits:  37%|███▋      | 4.61M/12.5M [00:00<00:00, 18.0MB/s]

aia_lev1_171a_2019_01_01t00_00_09_35z_image_lev1.fits:  54%|█████▍    | 6.31M/11.6M [00:00<00:00, 24.3MB/s]

aia_lev1_94a_2019_01_01t00_00_11_12z_image_lev1.fits:  99%|█████████▉| 10.3M/10.5M [00:00<00:00, 22.4MB/s]

Files Downloaded:  33%|███▎      | 1/3 [00:00<00:01,  1.97file/s]

aia_lev1_171a_2019_01_01t00_00_09_35z_image_lev1.fits:  90%|████████▉ | 10.4M/11.6M [00:00<00:00, 30.6MB/s]

aia_lev1_193a_2013_03_15t12_01_06_84z_image_lev1.fits:  74%|███████▎  | 9.15M/12.5M [00:00<00:00, 27.4MB/s]

Files Downloaded: 100%|██████████| 3/3 [00:00<00:00,  5.41file/s]

Performing multi-wavelength analysis on level 1 data can be problematic as each of the AIA channels have slightly different spatial scales and roll angles. Furthermore, the estimates of the pointing keywords (CDELT1, CDELT2, CRPIX1, CRPIX2, CROTA2) may have been improved due to limb fitting procedures. The Joint Science Operations Center (JSOC) stores AIA image data and metadata separately; when users download AIA data, these two data types are combined to produce a FITS file. While metadata are continuously updated at JSOC, previously downloaded FITS files will not contain the most recent information.

Thus, before performing any multi-wavelength analyses, level 1 data should be updated to the most recent and accurate pointing and interpolated to a common grid in which the y-axis of the image is aligned with solar North.

First, let’s read a level 1 94 Å AIA image from the aiapy sample data into a Map object.

The first step in this process is to update the metadata of the map to the most recent pointing using the aiapy.calibrate.update_pointing function. This function queries the JSOC for the most recent pointing information, updates the metadata, and returns a with updated metadata.

m_updated_pointing = update_pointing(m)

If we take a look at the plate scale and rotation matrix of the map, we find that the scale is slightly off from the expected value of \(0.6''\) per pixel and that the rotation matrix has off-diagonal entries.

SpatialPair(axis1=<Quantity 0.600109 arcsec / pix>, axis2=<Quantity 0.600109 arcsec / pix>)
[[ 0.99999712  0.0024018 ]
 [-0.0024018   0.99999712]]

We can use the aiapy.calibrate.register function to scale the image to the \(0.6''\) per pixel and derotate the image such that the y-axis is aligned with solar North.

If we look again at the plate scale and rotation matrix, we should find that the plate scale in each direction is \(0.6''\) per pixel and that the rotation matrix is diagonalized. The image in m_registered is now a level 1.5 data product.

SpatialPair(axis1=<Quantity 0.6 arcsec / pix>, axis2=<Quantity 0.6 arcsec / pix>)
[[ 1.00000000e+00 -2.84766725e-20]
 [-4.62157541e-19  1.00000000e+00]]

Though it is not typically part of the level 1.5 “prep” data pipeline, it is also common to normalize the image to the exposure time such that the units of the image are DN / pixel / s.

m_normalized = normalize_exposure(m_registered)

Finally, we can plot the exposure-normalized map. Note that small negative pixel values are possible because CCD images were taken with a pedestal set at ~100 DN. This pedestal is then subtracted when the JSOC pipeline performs dark (+pedestal) subtraction and flatfielding to generate level 1 files.

AIA $94 \; \mathrm{\mathring{A}}$ 2019-01-01 00:00:11

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

Gallery generated by Sphinx-Gallery