Is there an optimum ordering of 'corrections' for AIApy?

51 views
Skip to first unread message

Tom Bridgman

unread,
Feb 1, 2022, 1:11:56 PM2/1/22
to SunPy
A kind of followup question on my efforts to generate a (roughly) equivalent Level 1 to Level 1.5 data update for AIA data.

Is there an optimum ordering of these corrections?  For example, from the examples I've inferred that an appropriate ordering would be

from aiapy.calibrate import register, update_pointing, correct_degradation
from aiapy.calibrate.util import get_correction_table
import aiapy.psf

dv1 = update_pointing(dataview)
dv2 = register(dv1)
dv3 = correct_degradation(dv2, correction_table)
dv4 = aiapy.psf.deconvolve(dv3)

Should normalize_exposure go before or after correct_degradation?

Similarly for deconvolve, is there an optimal location for it in this process?

I'm thinking it doesn't, that these components are sufficiently linear that the ordering wouldn't make too much difference, but I can also think of a lot of potential gotchas in that assumption.

Thanks for your input,
Tom

will.t...@gmail.com

unread,
Feb 1, 2022, 11:45:16 PM2/1/22
to SunPy
Hi Tom,

For the steps you've listed above, the correct ordering is,

1. PSF deconvolution (aiapy.psf.deconvolve)
2. Pointing correction (aiapy.calibrate.update_pointing)
3. Registration (aiapy.calibrate.register)
4. Degradation correction (aiapy.calibrate.correct_degradation)

A few notes on this:

* The PSF functions are defined on the level 1 pixel grid so PSF deconvolution MUST be done on the level 1 data products (i.e. before image registration). This is described in the PSF gallery example.
* The pointing update should be done prior to image registration as the updated keywords, namely CRPIX1 and CRPIX2, are used in the image registration step. More details can be found in this gallery example.
* The exposure time normalization (normalize_exposure) and degradation correction (correct_degradation) operations are just scalar multiplication and are thus linear such that their ordering is inconsequential.
* Level 1.5, in its typical usage, only includes steps 2 and 3. My understanding is that the "aiaprep" function in SSW performs these two steps. Inclusion of Steps 1 and 4 (and the exposure time normalization) are not, as far as I'm aware, denoted through any standard level number designation.

Hope that helps!

Best,

Will

Tom Bridgman

unread,
Feb 2, 2022, 9:19:56 AM2/2/22
to SunPy
Ah!  Very useful answer.
I missed the deconvolution issue of applying to the Level 1 file.
Also these all expect Map objects as input (and output) so I had to cleanup cases where I was using Map vs checking/updating the FITS header and data array extracted in an earlier step of the process.

I want to generate a uniform sequence of images for aesthetic uses.  I'll try to do a write-up/example when I finally get the new security setup activated on my GitHub account.

Thanks again,
Tom
Reply all
Reply to author
Forward
0 new messages