Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bright sources artefacts from diff kernel error #215

Closed
herjy opened this issue Oct 21, 2020 · 12 comments
Closed

Bright sources artefacts from diff kernel error #215

herjy opened this issue Oct 21, 2020 · 12 comments
Assignees
Labels

Comments

@herjy
Copy link
Collaborator

herjy commented Oct 21, 2020

Tests on galsim simulations revealed ring-shaped artefacts in the residuals for bright sources.
The rings are not caused by monotonicity or any of the constraints, neither are they remnants from initialisation.
The suspected cause is an error introduced by the diff_kernel. The diff kernel indeed introduces very small errors to the PSF modeling ~10^-8%, which is small compared to the amplitude of the observed residuals:
Screen Shot 2020-10-21 at 6 09 31 PM

@herjy herjy self-assigned this Oct 21, 2020
@herjy
Copy link
Collaborator Author

herjy commented Oct 21, 2020

For reference, when comparing the data's psf and the psf constructed by convolving the model psf by the diff kernel, errors in log scale look like this:
Screen Shot 2020-10-21 at 6 33 51 PM

Renormalisation of the diff kernel to null the flux or amplitude difference between the data PSF and the reconstructed one did not work as the shape of the two do not match.

@herjy
Copy link
Collaborator Author

herjy commented Oct 22, 2020

Double precision or rescaling of the central region did not solve the problem. I am convinced the problem comes from a wrapping or a small contraction/dilation of the Fourier plane.

@pmelchior
Copy link
Owner

Where would these dilations come from?

@herjy
Copy link
Collaborator Author

herjy commented Oct 22, 2020

fft transform shapes/gridding. I haven't found anything yet playing with the fft code, so that might be wrong.

@pmelchior
Copy link
Owner

In the example above, the source is clearly truncated at the box. This can easily cause ringing as observed and would be independent of the correctness of the PSF diff kernel. Can you manually increase the box size to see if this has any effect?

There's one more test I like to make when everything becomes unclear. Initialize the source by hand with the correct deconvolved image as morphology. That means the solution is already at the maximum likelihood points. Check if the fitter computes non-zero gradients, i.e. it wants to walk away from it. If so, at least the backward path is biased.

@herjy
Copy link
Collaborator Author

herjy commented Oct 22, 2020

That's not it, I checked before.
Screen Shot 2020-10-22 at 6 51 18 PM
The residuals in the model look a lot like a sinc, but the difference between the psfs looks like a gaussian (all positive).

@pmelchior
Copy link
Owner

Is the original galaxy image from Galsim band-limited before it gets convolved?

@herjy
Copy link
Collaborator Author

herjy commented Oct 23, 2020

Yes, because I convolve it with a small gaussian kernel to make sure it is.

@herjy
Copy link
Collaborator Author

herjy commented Oct 23, 2020

I expanded this kernel from 1 pixel (which I thought was enough) to 1.5 pixels and it seems to do the trick-not*.

@herjy
Copy link
Collaborator Author

herjy commented Oct 23, 2020

I'm still suspicious though.

@pmelchior
Copy link
Owner

This seems to suggest that undersampling of the model is responsible. If so, we need to increase the width of the model PSF to ensure proper sampling, or (probably better) ensure that no gradient update forces the model to exceed the band-limit set by the model PSF.

@pmelchior
Copy link
Owner

closed in favor #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants