LSSTDESC / imSim

GalSim based Rubin Observatory image simulation package
https://lsstdesc.org/imSim
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

bright galaxy stamp fix #395

Closed jchiang87 closed 1 year ago

jchiang87 commented 1 year ago

Here are three renderings of the galaxy that I mentioned in this slack thread at different stages of addressing this issue. The first image on the left uses the current code in main. Here the main issue is that the stamp size returned by .getGoodImageSize (here) is so large that the stamp has fewer than 10 photons per pixel on average, so that this line isn't executed and the somewhat brighter sb limit is used instead. After addressing that by testing the image_size vs self._Nmax, the middle image below is the outcome. So I lowered the nominal sb limit used by ._getGoodPhotImageSize from np.sqrt(noise_var)/3. to np.sqrt(noise_var)/8.. With that change, the image on the right is the result.

bug-fix_stages

Note that this fix also needs #394 to work properly for objects like this.