[daip] A bug in IMSTAT?
Eric Greisen
egreisen at nrao.edu
Wed Oct 14 10:27:53 EDT 2009
Enno Middelberg wrote:
> Hello,
>
>
> I discovered an inconsistency which looks like a bug in IMSTAT. When
> trying to measure the rms of large (8192^2 pix) images, the rms reported
> by IMSTAT is ~10% higher than that reported by IMEAN. The IMEAN rms is
> consistent with the rms calculated in a Python script which reads in the
> FITS file (produced by FITTP).
>
> Curiously, the discrepancy appears to be dependent on the number of
> pixels in the image. To test this I have looked at the rms of a 4^2 pix
> image, of a 2048^2 pix image and of the aforementioned 8192^2 pix image.
> Here are the results (Python script values are multiplied by 10^3):
>
>
> n_pix IMSTAT IMEAN Python script
> 4^2 1.6371E-05 1.6371E-05 0.016370692318377355
> 2048^2 5.7626E-05 5.7502E-05 0.057502067356446578
> 8192^2 6.3025E-05 5.7077E-05 0.057077074909518973
>
>
> At 4^2 pixels, there is no discernible difference (due to the limited
> number of digits reported by IMSTAT and IMEAN), at 2048^2 pixels, the
> difference is 0.2%, and at 8192^2 pixels, the difference is 10.4%.
>
> The values for maximum and minimum pixels, and for the total number of
> pixels considered in the calculation are consistent. Is this a bug in
> IMSTAT or is there something IMSTAT does (half-) secretly?
>
To which rms in IMEAN are you referring?
IMSTAT does a simple rms including all data - not a robust or other sort
of averaging. IMEAN does 2 kinds - it tries to fit the data by
constructing a histogram and then Gaussian fitting its peak which is a
form of robust averaging that ignores high points (the sources). It
also does the same average as IMEAN. In my tests IMEAN and IMSTAT
always agree on the (not smart) average and rms.
Eric Greisen
More information about the Daip
mailing list