-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add quantization noise + remove sky_image quantization #100
Conversation
Quantization noise
Question: |
euclidlike_imsim/noise.py
Outdated
quantization_noise.fill(0) | ||
quantization_noise.addNoise(galsim.DeviateNoise(galsim.UniformDeviate(rng))) | ||
noise_img += quantization_noise | ||
noise_img -= 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this subtraction by 0.5 come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With quantization we assume that if you have a value of 100.5 ADUs it has the same chance to round to 100 or 101 which lead to +/-0.5. The Uniform distribution from GalSim return value in the range [0, 1], the -0.5 is just to rescale the range to [-0.5, 0.5].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed during the meeting:
- put in documentation
- include in end to end demo
Co-authored-by: Rachel Mandelbaum <[email protected]>
|
@rmandelb Ready to for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All my comments/suggestions are trivial, so I'm approving to avoid the need for another review. I think you should be able to just accept the suggestions and merge.
if cfg_noise["quantization_noise"]: | ||
quantization_noise = noise_img.copy() | ||
quantization_noise.fill(0) | ||
quantization_noise.addNoise(galsim.DeviateNoise(galsim.UniformDeviate(rng))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the github interface something funny is happening with indentation? Is this a tabs vs. spaces thing or just a fluke?
# Note that the image type after this step is still a float. If we want to actually | ||
# get integer values, we can do new_img = galsim.Image(full_image, dtype=int) | ||
|
||
# Here we add quantization noise to the image. This prevent to have problems due |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Here we add quantization noise to the image. This prevent to have problems due | |
# Here we add quantization noise to the image. This prevents problems due |
Co-authored-by: Rachel Mandelbaum <[email protected]>
Co-authored-by: Rachel Mandelbaum <[email protected]>
Co-authored-by: Rachel Mandelbaum <[email protected]>
Co-authored-by: Rachel Mandelbaum <[email protected]>
Co-authored-by: Rachel Mandelbaum <[email protected]>
Co-authored-by: Rachel Mandelbaum <[email protected]>
Add quantization noise to the image. This allow to improve background estimation, see #85.
Below are the results with the quantization noise on. It looks like the original signal is not impacted.