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

Don't error if two photon_arrays being convolved both have allocated ancillary arrays. #1242

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

rmjarvis
Copy link
Member

When convolving two PhotonArrays, we had a feature where GalSim would check if both of them had various ancillary arrays set (and not identical), and if they were both set, it would raise an exception. The thought was that this probably indicated an error. But in practice it meant that when two PhaseScreenPSFs were convolved, they couldn't be drawn with photon shooting, since each of them would have set the pupil coordinates and the time independently.

If you want to be really careful about these ancillary arrays, then you can put the PSFs in photon_ops, in which case they will be processed sequentially and PhaseScreenPSF won't overwrite e.g. pupil coordinates that are already there. But if you don't much care about these ancillary arrays, it should be allowed to just convolve two PSF objects and draw them any old way. So now you can.

This bug showed up in imSim when doOpt=True. The workaround was to put the psfs in photon_ops, as I mentioned above. cf. LSSTDESC/imSim#410

@rmjarvis rmjarvis added bug report Bug report optics/atm Related to realistic PSFs from optics, atmosphere, etc. labels Aug 22, 2023
@rmjarvis rmjarvis added this to the v2.5 milestone Aug 22, 2023
@rmjarvis rmjarvis added the desc Of possible interest to LSST DESC members looking for a project label Aug 26, 2023
Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One minor comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a change for this PR, but I'm noticing that the comment on line 351 mentions dxdz, dydz, wavelength, pupil_u, pupil_v but the code doesn't actually look at dydz or pupil_v. Should probably make this consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added dydz and pupil_v to the list.

@rmjarvis rmjarvis merged commit a71c71d into main Aug 31, 2023
9 checks passed
@rmjarvis rmjarvis deleted the allow_phasepsf_convolve branch August 31, 2023 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report desc Of possible interest to LSST DESC members looking for a project optics/atm Related to realistic PSFs from optics, atmosphere, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants