pypher icon indicating copy to clipboard operation
pypher copied to clipboard

For the encircled energy curve, after psf-matching with pypher

Open markliuchina opened this issue 1 year ago • 3 comments

Hi! I am using pypher for psf-matching in multi-wavelength analysis. But I want to check the robustness of my psf-matching in order to use the matching kernels in my SED fitting. Recently, I read a paper of JWST spatially resolved analysis which talks about the psf matching. (Abdurro'uf et al. 2023) In the Appendix C of the paper mentioned above, they calculate the encircled energy of the convolved PSF image. (they first generate the convolution kernels to F444W, and convolve the PSF images of other bands to get convolved psf; Well, they calculate the encircled energy of the convolved psf and the psf of f444w) They find that, after convolution, the convolved psfs of all other bands fit well with the target band f444w. Consequently, they claim that the psf matching in their work is robust. image I also want to check the encircled engery distribution after & before the psf matching. I first download the empirical psf generated by Abdurro'uf (GitHub website here). And generate the matching kernel to z band on u, g, r, i bands with pypher. Convolve the psf images with the kernels, and I get these figures. original_ee (This is the original psf encircled energy curve of the 5 bands, without being convolved with matching kernels) matched_ee (This is for the convolved psfs) Note: by the way, I convolve images with functions in PHOTUTILS. (convolve_fft) We can see that the shape of the EE curve really have changed after psf-matching. But there still exist manifest differences between the matched images. When it comes to the PSF-matching of the JWST filters, the results are given below: original_ee (This figure is about the input psfs) matched_ee (Well, this is for the psfs after psf-matching) The generation of the matching kernels are all with PyPHER. Could you please tell me whether this method can check the the robustness of a PSF matching? Whether my results indicate a bad PSF-matching? I really want to do well in the processing of PSF. Anything from you will be appreciated! Last, thanks for your making this wonderful code available!

Best.

Mingfeng Liu Postgraduate Student, 1st year Nanjing Normal University

markliuchina avatar Apr 18 '23 05:04 markliuchina

Hi @markliuchina, thanks for posting. It's been a while since I last worked with this code. I just spent some time trying to reproduce the figure you obtained with the SDSS empirical PSFs, just to make sure I could still use my own code :)

When I compute the kernels, do the matching and then compute the azimuthal profile (same as encircled energy) I obtained this, very similar to yours image

But if you look at the shape of the homogenized psfs they are all different, thus we are not really comparing the same thing since PSFs have long wings and there is still energy left far away from the center (at a higher distance that the size of the array itself). To make things more fair, we need to trim the homogenized PSFs to the same size (the smallest of all). After that, the results look much better image As you can see the matching works well. The reason is that you now compare what is comparable. I figure this process should be the same for your JWST data.

Happy to exchange more on this.

aboucaud avatar Apr 28 '23 17:04 aboucaud

Hi, Alexandre @aboucaud ! I feel very happy to get your reply and see that you spent time in elucidating it for me. I have read your message carefully once upon receiving the notifications from GitHub. First, sorry for the huge delay. I was busy with preparing some presentations for the courses of this semester. You are right. From your words, I find the problem. Following your instructions (trim the homogenized PSFs to the size of the smallest one), I get the same results as you described above. We indeed have to make them "comparable" before plotting the 'Encircled Energy' The empirical PSFs of SDSS are built with different images. When building the PSFs, the images for stacking the bright stars are of different pixel sizes and maybe the imaging pixel scales are also different between filters. When it comes to the JWST data, it also works and the curves are consistent with each other. (These PSFs are generated by someone else from other institute and I don't know how he built it and I just do the resampling) To verify further, I determine to build my own empirical PSFs for JWST data and convolve them with kernels constructed by PyPHER. I construct the variance maps, weight maps and of the CEERS JWST-HST imaging data and stack the bright stars to build PSFs for each filters. In building the PSFs, for all filters, I fix the image sizes of bright stars to be the same. (also the output PSF images sizes, in order to make them comparable) Then, I check the encircled energy plot: (imaging of the HST_F105W seems to be bad and did not contain any manifest resolved stars and the PSFs of this filter is terrible. I don't know the reasons but just have to abandon this filter for further analysis) original_ee This figure is about the ePSFs I extract from the imaging directly, without being convolved with PyPHER kernels.

matched_ee This figure is about the convolved PSFs with PyPHER

Very glad to see this figure! Thanks for your enormous help and offering us such wonderful code! Je vous remercie vivement de votre soutien! :+1: :100: Best regards.

Mingfeng Liu

Nanjing Normal University

2023.5.3

markliuchina avatar May 03 '23 09:05 markliuchina

Glad to see your final results ! 🥳

As for the F105W band, something is definitely weird. If you trust the encircled energy curve it means there is a negative response at a given radius of the PSF. While theoretically possible, this is weird for a PSF obtained empirically from the data. Otherwise there is something to dig in the way you compute the encircled energy..but I doubt it since it works well the rest of the time. So if not important maybe you should leave this file out.

aboucaud avatar May 09 '23 17:05 aboucaud