sweverett / Balrog-GalSim

Modules for GalSim that will be useful for DES images in conjunction with Balrog.
MIT License
5 stars 5 forks source link

Move `initial_image` addition to `addNoise()` #75

Closed sweverett closed 5 years ago

sweverett commented 5 years ago

The initial images are currently added in AddOnImageBuilder.buildImage(). This works normally, but won't work as intended if we turn on Poisson noise for injection stamps as it will add Poison noise across the full image. Here is a test run that shows the difference between a Balrog image and the injected nullwt image (Balrog - nullwt): image image Green pixels are where the difference is 0. This has two problems: (1) Poisson noise is being added to areas of the image between injection stamps, and (2) The green pixels have difference zero only because they have negative counts (and so are assigned 0 counts for the Poisson process) We should fix this by moving the initial_image addition to the end of an overloaded addNoise() rather than buildImage().

sweverett commented 5 years ago

Looks good after the switch to addNoise()! image image