nasa / giant

Goddard Image Analysis and Navigation Tool
Other
53 stars 11 forks source link

Noise calculation fix #9

Open jpelgrift opened 2 months ago

jpelgrift commented 2 months ago

First, line 1387 of image_processing.py is as follows:

            standard_deviation = np.nanstd(data[~outliers]) / 2

Should be changed to:

            standard_deviation = np.nanstd(data[~outliers]) / np.sqrt(2)

The rationale is that the difference between two independent normal random variables each with standard deviation σ also follows a normal distribution but with standard deviation sqrt(2)σ. Thus, the standard deviation of the differences is sqrt(2)σ. To estimate σ, you can divide the standard deviation of the differences by sqrt(2).

References: (ours is the case where σ_x = σ_y)

Second, line 1351 of image_processing.py is as follows:

            standard_deviation = np.nanstd(flat_dark) / 2

should be changed to:

            standard_deviation = np.nanstd(flat_dark)

In this case, we are taking the standard deviation of the (dark) image data itself, not the differences between points, so it seems like there should be no scale factor. The standard deviation of the data is already directly representative of the noise.

Note that this will effect star ID tuning (poi_threshold), since this is used to compute SNR for each pixel.