<p>Signal to noise in imaging usually is defined as <span class="math-container">$$\mathrm{SNR} = \frac{\mu_\mathrm{sig}}{\sigma_\mathrm{sig}} $$</span> (see also <a href="https://en.wikipedia.org/wiki/Signal-to-noise_ratio_(imaging)" rel="nofollow noreferrer">here on Wikipedia</a> or here on <a href="https://stackoverflow.com/questions/25699903/calculate-snr-in-single-image-in-matlab">SO itself</a>) where <span class="math-container">$\mu$</span> denotes the average of the signal and <span class="math-container">$\sigma$</span> is the standard deviation of the signal. This same is also used in standard tools like <a href="https://docs.astropy.org/en/stable/api/astropy.stats.signal_to_noise_oir_ccd.html" rel="nofollow noreferrer">AstroPy</a> (though that takes three common noise sources in astronomy as argument: the dark current, the read noise and the sky background).</p>
<p>The correlation of noise usually is taken care of in the image post-processing, so that one does not need to consider it in the SNR. This post-processing accounts for the read-out bias <span class="math-container">$B$</span> (a short exposure which often features correlated noise), the dark current <span class="math-container">$D$</span> (which is a long exposure to capture the sensor's long-term behaviour without light falling onto it) and possibly the relative sensitivity of the sensor by means of a flat field image <span class="math-container">$F$</span>. So for an image <span class="math-container">$I$</span>, you can obtain a corrected image <span class="math-container">$C$</span> as
<span class="math-container">$$
C = \frac{(I - D)\cdot &lt;F - D&gt;}{F - D}
$$</span></p>
<p>(I described it <a href="https://astronomy.stackexchange.com/questions/48123/avoiding-noise-while-stacking-multiple-night-sky-photographs/48125#48125">in this answer</a> slightly longer)</p>

CC BY-SA 4.0
2022-08-01T10:42:00.717Z
Thank you. I sometimes hear about "averaged SNR" and "summed SNR" could yo expand on that? Does that mean that one can replace $\mu$ in your definition by the sum of all signal to get the summed SNR? It would make sense to me, for example when wanting to know if a signal is real or due to noise fluctuations, that the sum is used and not the average (because many nearby bright pixels are not likely to be just due to random fluctuations).
Jylu
CC BY-SA 4.0
2022-10-18T23:24:30.843Z
This ignores the possible contribution to the noise from the background, which can be considerable. (It’s why you can’t see stars in the daytime, for example.)
Peter Erwin
CC BY-SA 4.0
2022-07-18T16:28:14.897Z
2022-10-18T20:16:58.780Z
2022-10-18T20:16:58.780Z
planetmaker
<p>My question splits in two parts:</p>
<ol>
<li><p>If I have an image with N x N pixels, and an object in the center (star, galaxy what have you), spanning M x M, how do I compute its signal to noise ratio exactly?</p>
</li>
<li><p>Now what happens if some (noise) pixels are actually correlated? How does that change the SNR computation?</p>
</li>
</ol>

CC BY-SA 4.0
2022-10-15T17:46:04.373Z
You might also consider looking here in [photutils](https://photutils.readthedocs.io/en/stable/background.html) (which is an affiliated package of Astropy), look under "2D Background and Noise Estimation".
Hope that this helps.
PeterDz
CC BY-SA 4.0
2022-10-15T18:46:40.733Z
What sort of image, what sort of data?
ProfRob
CC BY-SA 4.0
2022-10-22T16:49:27.807Z
Try to clarify the question a bit.
Arcturus
<data-analysis><image-processing>
SNR computation + noise correlation
Jylu
# SNR computation + noise correlation

(Asked by: username_0 on 2022-07-18)

My question splits in two parts:

1. If I have an image with N x N pixels, and an object in the center (star, galaxy what have you), spanning M x M, how do I compute its signal to noise ratio exactly?
2. Now what happens if some (noise) pixels are actually correlated? How does that change the SNR computation?

**Tags:** data-analysis, image-processing
> **Comments:**
> **username_1**: You might also consider looking here in [photutils](https://photutils.readthedocs.io/en/stable/background.html) (which is an affiliated package of Astropy), look under "2D Background and Noise Estimation". Hope that this helps.  
> **username_2**: What sort of image, what sort of data?  
> **username_3**: Try to clarify the question a bit.  

---

## 1 answers

### Answer by username_4 on 2022-07-18. Score: 0

Signal to noise in imaging usually is defined as $$\mathrm{SNR} = \frac{\mu\_\mathrm{sig}}{\sigma\_\mathrm{sig}} $$ (see also [here on Wikipedia](https://en.wikipedia.org/wiki/Signal-to-noise_ratio_(imaging)) or here on [SO itself](https://stackoverflow.com/questions/25699903/calculate-snr-in-single-image-in-matlab)) where $\mu$ denotes the average of the signal and $\sigma$ is the standard deviation of the signal. This same is also used in standard tools like [AstroPy](https://docs.astropy.org/en/stable/api/astropy.stats.signal_to_noise_oir_ccd.html) (though that takes three common noise sources in astronomy as argument: the dark current, the read noise and the sky background).

The correlation of noise usually is taken care of in the image post-processing, so that one does not need to consider it in the SNR. This post-processing accounts for the read-out bias $B$ (a short exposure which often features correlated noise), the dark current $D$ (which is a long exposure to capture the sensor's long-term behaviour without light falling onto it) and possibly the relative sensitivity of the sensor by means of a flat field image $F$. So for an image $I$, you can obtain a corrected image $C$ as
$$
C = \frac{(I - D)\cdot }{F - D}
$$

(I described it [in this answer](https://astronomy.stackexchange.com/questions/48123/avoiding-noise-while-stacking-multiple-night-sky-photographs/48125#48125) slightly longer)

> **Comments:**
> **username_0**: Thank you. I sometimes hear about "averaged SNR" and "summed SNR" could yo expand on that? Does that mean that one can replace $\mu$ in your definition by the sum of all signal to get the summed SNR? It would make sense to me, for example when wanting to know if a signal is real or due to noise fluctuations, that the sum is used and not the average (because many nearby bright pixels are not likely to be just due to random fluctuations).  
> **username_5**: This ignores the possible contribution to the noise from the background, which can be considerable. (It’s why you can’t see stars in the daytime, for example.)  

---

