-
Notifications
You must be signed in to change notification settings - Fork 3
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
photon shooting? #50
Comments
I have nothing against photon shooting :-) I'm not too worried about the stochastic aspect of it. We have to replace GalSim's internal RNG system by a jax-based one anyway (which I think we can do while keeping the same API). But yeah to make it differentiable we might want to use some relaxation tricks (essentially making the pixel assignment continuous and not discrete, so blurring a bit the pixel edges). Also, I have NOT looked at the photon shooting implementation in GalSim, I'm not sure how it works in practice. Like do you draw from a base profile, then apply jacobian transformations for each photons, and somehow also apply the deviations caused by the PSF? |
The psf is added as a random perturbation to the photon locations. I agree the relaxation tricks would be good. We should add those as an option. |
Interesting... Then yeah sounds very doable :-)
…On Sun, Aug 6, 2023, 8:55 AM Matthew R. Becker ***@***.***> wrote:
The psf is added as a random perturbation to the photon locations. I agree
the relaxation tricks would be good. We should add those as an option.
—
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGSLF6T7GOZRTWVECRSQHDXT6O55ANCNFSM6AAAAAA3FF6AGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Ah... one more serious complication. We need to know the number of photons we are going to draw at JIt time... And because that will depend on the magnitude of the object (which we certainly want to keep as a dynamically traced parameter) we can't know it. |
Yup good point. I'm skeptical that making photon shooting differentiable is going to be worth the time and trouble in the end. I'd be tempted to just give up on the first pass and use while loops which can have variable sized lengths. |
We might be able to do this in a clever way, like drawing by batches with a |
@rmjarvis Can explain in detail why galsim has a flux per photon? It seems logical, but I feel like I am missing some details in how this is used internally. |
Normally it's 1 e- per photon (which is 1 ADU per photon with the default gain=1). The primary exception is InterpolatedImage, which can have negative flux parts. This implies that some of the photons need to have negative flux to implement this properly. To get the right Poisson statistics, the positive (and negative) flux photons can't have flux=1. There is a detailed discussion of this in section 6.3.6 of Rowe et all. Also in the code comment here. |
Sorry for this very noob question, but can I ask what are the advantages of photon shooting? |
It depends on how bright the object is. Shooting ~10 photons is MUCH faster than doing FFTs. In realistic sims, we render lots of objects with flux<100. |
Also, if you care about wavelength-dependent effects, photon shooting is significantly more efficient at almost any flux level. |
Closed by #82 |
How do we feel about photon shooting?
some initial thoughts:
BTW, I am very impressed by the work here everyone!
The text was updated successfully, but these errors were encountered: