Don't error if two photon_arrays being convolved both have allocated ancillary arrays. #1242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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