Closed aguinot closed 2 months ago
Noise is already added to the fft-drawn objects at this line: https://github.com/GalSim-developers/GalSim-Euclid-Like/blob/cce5f516a1926ef520fde13bf89a0606d76a6b3e/euclidlike_imsim/stamp.py#L285
So you should be able to always treat the image like the self.draw_method == "phot"
block quoted in your post.
I think your changes will work also.
Noise is already added to the fft-drawn objects at this line:
So you should be able to always treat the image like the
self.draw_method == "phot"
block quoted in your post.
Thank you for pointing that, I did not look carefully enough to the code. Thank you for having a look at the changes!
@rmandelb the conflicts have been solved. It is ready for review.
Note 1: Should be merged after #67 Note 2: This should fix issue #54
@matroxel if you have some time, I would be very happy to have your opinion on how I implemented the noise using custom features of
galsim.config
.Noise handling
I "fixed" the handling the handling of the noise in _euclidlikeimsim. Originally the noise was added through these lines:
The default drawing method is "auto" so it will do the
else
statement which is a problem because the majority of our objects are drawn using thephot
method so the poisson noise will be counted twice (this is the case on all the images I have done so far).With the new implementation, the noise is handled independently of the drawing method. That raise a new issue, the bright objects are drawn with the
fft
method so there will be no poisson noise on them. If we believe this is important I have some ideas how to fix that.New outputs
With the new implementation of the noise I was able to make new ouptuts:
sky_subtract==True
in that case it is also subtracted on the noise)numpy.var()
because it might not possible to get it analytically. (Is it possible to get it from GalSim?)The new outputs are done with custom
galsim.config.ExtraOutputBuilder
. I can easily add more or modify the existing one. I did not thought useful to output a noiseless image since you can get it from the noise image. If you think it could be useful to have one, I can add it.Tests
Here is a list of tests I have done:
All feedback is very welcome 🙂.