LutherAstrophysics / m23

Astronomical Raw Data Processing
0 stars 0 forks source link

Coma correction - how it works and doesn't #38

Open sumanchapai opened 1 year ago

sumanchapai commented 1 year ago

Professor, @wilkerje

We have now integrated coma correction code as part of our data processing. But I think that we need more theoretical understanding of the paper that's the basis for the software we're using: https://arxiv.org/pdf/2212.02594.pdf to be able to interpret the results we are getting.

Our coma correction now works like this:

  1. We perform calibration, alignment, combination, extraction without coma correction.
  2. We divide each of the aligned combined images into four squares and find the median x, y FWHM of stars in that section and select the FWHM from the best section.
  3. We select the target FWHM for the night as the FWHM from the best section of the best image in that night. We have separate values for X-FWHM and Y-FWHM
  4. We group the aligned combined images by hour. This is so that we can generate a correction model for every hour of the night. We generate this correction model using the raw images that were used to generate the aligned combined image that is in the middle of the hour.
  5. We now perform our calibration, alignment, combination, extraction again. But this time, before calibrating our raw image, we apply the correction model from the appropriate hour.

The kind of problems we are running into are:

  1. How to best determine the parameters to provide to the code. We have devised a formulaic and automatic approach for finding FWHM using the algorithm aforementioned. We don't know its efficacy yet though. Furthermore, you mentioned that it's surprising that we even have to define a target FWHM. Other parameters that the paper refers to as psf_size, epsilon, alpha, we've left as constants. This is what the authors of the software suggested as well, but for higher confidence, we probably need to understand the paper.

  2. More pressing problem is related to direct interpretation of the corrected image. Precisely, we're getting negative values in some pixels and some "nan" (not a number) values after applying correction. I don't know how we should interpret these values. Should we just zero these? Maybe. Maybe not. I have presented this query to the official repo for regularizepsf as well: https://github.com/punch-mission/regularizepsf/issues/93

The theory of coma correction seems hard. Do you have any suggestion on how we go forward to understanding it? Thanks.

jmbhughes commented 1 year ago

I saw you linked this from the issue you opened on regularizepsf. (For context, I'm the primary developer of regularizepsf and first author on the associated paper.) I'm happy to answer questions always. Your confusion indicates we likely need a simpler and more conceptual explanation in our documentation than just the paper.

I wanted to comment that you need a target PSF because the code not only corrects the PSF but homogenize to a standard PSF by applying a target model. This is necessary because your correction in different regions of the image could be different, e.g. you might correct the center of the image much better than the edges because the center was more well behaved to begin with. For our purposes on the PUNCH mission (the reason we wrote the software), we need the resulting PSF to be the same everywhere.

I would recommend probably not setting the target to a derived value of the PSF from the images. You might use that as a starting point, but you need the PSF to be different than your observed distorted PSF. In our private correspondence, I used a symmetric Gaussian with a target PSF FWHM of 4.3 pixels. If I set it significantly smaller, I was seeing artifacts created on the brightest stars because their PSFs were larger than that originally.

sumanchapai commented 1 year ago

@jmbhughes, thank you for your comment. Deciding a target psf model has been a difficult matter for us. Here was our rationale for choosing a different FWHM for each night as target and why we used the method described above. It would be really helpful if you could review and suggest:

  1. We are taking images from Decorah, Iowa, from an elevation of around 268 meters. This means that there is atmospheric influence. Humidity changes night to night (even hour to hour perhaps) which means that the FWHM of stars that we observe may be different night to night, hour to hour.

  2. The focus in our image is sometimes better in one side than the other. The focus has to be adjusted every night thus this is another cause for nightly FWHM variation.

  3. Our images have coma effect and, generally speaking, it seems to have better correlation with X than Y. But we cannot tell which side (either left or right) has more coma effect because this seems to change sometimes within year, sometimes every 2 years, etc even when there was no equipment was changed.

My thinking was this: that the target psf is the psf for a star had there been no coma effect. So what we are trying to set as target is the psf in the region of the image where there was the least coma effect. We have to calculate this value for each night because the atmospheric conditions and focus change every night. In turn this means that the target for every night, and perhaps ideally every hour, is different?