LM-SAL / aiapy

Python library for AIA data analysis
https://aiapy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Artifacts from entrance filter mesh visible in the 335 channel after pdf deconvolution #120

Open nabobalis opened 1 year ago

nabobalis commented 1 year ago

In GitLab by @kreevescfa on Jan 25, 2023, 14:08

There are noticeable artifacts in the 335 image after deconvolution with the PSF. Attached are images of deconvolution on the same file done with IDL and aiapy. In the aiapy version, there are artifacts in a grid pattern, probably from incorrect removal of the entrance filter mesh pattern. Also attached is the original fits file. The aiapy deconvolution was done with the following code:

 m = sunpy.map.Map(file)   
 psf = aiapy.psf.psf(m.wavelength)
 map_deconvolved = aiapy.psf.deconvolve(m, psf=psf)

The IDL deconvolution was done with the following code:

read_sdo, file, index, data
psf=aia_calc_psf('335')
data_deconvolved=aia_deconvolve_richardsonlucy(double(data),psf)

In both cases, the PSF deconvolution was done before image registration, pointing update, and normalization (aia_prep), as recommended.

idl_psf_decomp

python_psf_decomp aia_lev1_335a_2017_09_10t16_25_24_64z_image_lev1.fits

nabobalis commented 1 year ago

In GitLab by @wtbarnes on Jan 25, 2023, 14:25

Thanks very much for reporting this. Just for clarification, the PSF deconvolution, in both the IDL and Python cases is done on the full-disk image and not the cutout that is shown in these images, correct?

nabobalis commented 1 year ago

In GitLab by @kreevescfa on Jan 25, 2023, 14:29

Yes, correct. I just plotted a submap of the portion of the FOV I was interested in, but the deconvolution was done on the full image (anyway, it won't work on a submap unless you fiddle around with the PSF).

nabobalis commented 1 year ago

In GitLab by @wtbarnes on Sep 4, 2023, 12:23

Hi @kreevescfa. Sorry for the very long delay in following up on this.

Unfortunately, I am not able to reproduce the entrance filter pattern you're seeing in the Python deconvolution case. I took the image you attached here, calculated the PSF in IDL and in Python with aiapy and then ran the deconvolution in aiapy with both PSFs. The figure below shows the two cases:

image

As you can see, I don't find the same entrance filter pattern you've shown above in either case. Furthermore, when doing a percent difference between the two, I find the differences all lie along the PSF arms and that all are under 0.5%,

image

I've attached the notebook I used to generate these results here: aia-psf-testing.ipynb

A few more follow up questions:

  1. What versions of sunpy and aiapy were you using to get the result you showed above? You can get the version info by typing sunpy.__version__ and aiapy.__version__
  2. Were you using a GPU to calculate the PSF and/or perform the deconvolution in the Python case?
nabobalis commented 1 year ago

In GitLab by @wtbarnes on Sep 6, 2023, 11:26

This is also related to #75 as the PSF images using both cupy and numpy show the same sorts of artifacts.