IMLIST doesn't report mean or rms correctly

Is MIRIAD being a pain? Let us know your experience.

Moderator: Mark.Wieringa

Post Reply
cAh
Posts: 5
Joined: Tue May 04, 2010 12:57 pm

IMLIST doesn't report mean or rms correctly

Post by cAh »

I notice that the task IMLIST does not correctly report the _mean_ and _rms_ of an image.

I have checked this in 3 ways:
* using the task HISTO;
* using kvis and pressing "s"; and
* dumping the pixel values using IMSTORE then taking their mean and rms manually.

Only IMLIST gets a different (incorrect) value for the mean and rms compared with the 3 other methods above.

IMLIST _does_ appear to get the min/max/totflux etc correct.

cheers,
Chris Hales
len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

Re: IMLIST doesn't report mean or rms correctly

Post by len067 »

Hi Chris,

Have you tried using the task IMSTAT? I'm just wondering if this gives a different result again.

I just tried using IMSTAT, IMLIST and the KVIS methods on a random image I had on my Mac and it seemed to produce reasonably consistent results:

KVIS:

Code: Select all

npoints  mean uJy/Beam     std dev      min          max          sum
16384    +725.598          +9412.05     -351.964     +330227      +1.18882e+07
Total flux: 1146.55 mJy
IMSTAT:

Code: Select all

  plane    Frequency    Sum      Mean      rms     Maximum   Minimum    Npoints
     1        4.5      11.9     7.256E-04 9.412E-03 0.330    -3.520E-04   16384
IMLIST:

Code: Select all

 plane   Frequency   Total Flux   Maximum     Minimum     Average       rms
    1   4.49150      1.1466E+00  3.3023E-01 -3.5196E-04  7.2560E-04  9.4120E-03
although I'm not sure what Sum means in IMSTAT - it's certainly not the same as Total Flux.

Could you post a similar summary of what you were getting in your test? What was the magnitude of the differences?

Cheers,

Emil.
cAh
Posts: 5
Joined: Tue May 04, 2010 12:57 pm

Re: IMLIST doesn't report mean or rms correctly

Post by cAh »

Hi Emil,

Sorry, I wasn't specific enough. It appears that the problem is only taking place with reasonably large images.

To test, simply take an image with say 5000 pixels on a side and calculate it's mean and rms using IMLIST (in=... options=statistics). A test image for this purpose can be created by simply using IMGEN with object=noise and imsize=5000.

Then determine the mean and rms using HISTO, or the completely manual approach of getting out all pixel values using IMSTORE and the calculating their mean and rms manually.

(Strangely, I note that kvis gets the mean and rms right, but for unknown reasons, because for large images it can't correctly count how many pixels there are! For example, make test images as above with IMGEN with 4998, 4999, 5000, 5001, and 5002 pixels per side, and open each in kvis, then press "s" and read off nchan - it will be correct for the 5000 case but not for the others...? Weird. But this is a completely separate issue...)

Anywho, IMLIST gives the wrong values, whereas the other methods I describe above (including kvis, despite the strange nchan reading) give a consistent mean and rms evaluation. I also note that IMSTAT cannot handle large images.

I haven't looked at the source code, but my guess is that there is something strange in the mean and rms calculation for IMLIST (which is not present in HISTO, for example).

Chris Hales
c.hales@physics.usyd.edu.au" onclick="window.open(this.href);return false;
len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

Re: IMLIST doesn't report mean or rms correctly

Post by len067 »

Hi Chris,

Thanks for the extra information ... I'll see if I can find a large image somewhere to test this out on my Mac.

Cheers,

Emil.
cAh
Posts: 5
Joined: Tue May 04, 2010 12:57 pm

Problem Solved

Post by cAh »

Mark Calabretta looked into this issue and found that instead of using double-precision arithmetic, IMLIST uses single-precision arithmetic. The problem has now been fixed.

Chris
Post Reply