7.3 Image statistics and flux integration

The task IMEAN is used to determine the statistics of the image inside, or outside a specified rectangular or circular area. It derives the minimum and maximum value and location, the rms, the average value and, if the image has been Cleaned, an approximate flux density within the area. A typical run might be:

> TASK IMEAN’ ; INP  C R

to list the input parameters.

> INDI n ; GETN ctn  C R

to select the image file from disk n catalog slot ctn.

> BLC n1, n2 ; TRC m1, m2  C R

to set the window from (n1,n2) to (m1,m2) — or use TVWIN with the cursor on the TV.

> DOHIST TRUE  C R

to make a plot file of the pixel histogram.

> PIXRANGE x1, x2  C R

to set the range of the histogram from x1 to x2.

> NBOXES n  C R

to set the number of boxes in the histogram.

> DOALL 1  C R

to include pure 0 pixels in the statistics, a 31DEC24 option. Otherwise they are ignored.

> GO  C R

to run the task.

A circular aperture may be specified with BLC = -1,radius ; TRC = Xc,Y c. IMEAN attempts to determine the true noise of the image by fitting the peak of the histogram and reports both that result and the one found by including all pixels within the window. IMEAN now gets the initial guess for the true noise from a robust computation over the input window and returns the adverbs PIXSTD and PIXAVG from the histogram fit to the AIPS program. IMEAN now fills an additional output adverb such that TRIANGLE(i) is the brightness level exceeded by only i per cent of the image.

The statistics will appear in the AIPS window. For a hard copy type:

> PRTASK IMEAN’ ; PRTMSG  C R

with PRIO5.

To see the histogram of the intensities, an example of which is shown in §6.3.2.3, type one of:

> GO TKPL  C R

to display the histogram in the Tektronix window.

> GO LWPLA  C R

to display the histogram on a PostScript printer.

The verbs TVSTAT and IMSTAT provide similar functions to IMEAN without the histogram and true rms options. Both return their results as AIPS parameters PIXAVG (mean), PIXSTD (rms), PIXVAL (maximum), PIXXY (pixel position of the maximum), PIX2VAL (minimum), PIX2XY (pixel position of the minimum). IMSTAT uses the same file name, BLC, and TRC parameters as IMEAN including the circular aperture convention. It is useful to prepare the initial rms guess for that task although the PIXSTD it returns will often be a factor of several too large. TVSTAT, however, works on the image plane currently displayed on the TV and is not limited to a single rectangular area. Instead, the TV cursor is used to mark one or more polygonal regions over which the function is to be performed. Type EXPLAIN TVSTAT  C R for a description of its operation.

The interactive task BLSUM employs a method similar to that of TVSTAT. The TV cursor is used to mark a region of interest in a “blotch” image. Then BLSUM finds the flux in that region not only in the blotch image but also in each plane (separately) of a second image. More than one region of interest may be done in any given execution of the task. In spectral-line problems, the blotch image is often the continuum or the line sum while the second image is the full “cube” in almost any transposition. The spectrum obtained may be saved as a SLice file for further analysis and display. The spectra may be saved as true plot files as well as printer plots and the flux summation may be weighted by the values (or their squares) found in the blotch image. Numerous continuum applications also exist (e.g., polarization, comparison across frequency). Type EXPLAIN BLSUM  C R for a description of the operation.

The verb IMDIST is used to measure the angular distance and position angle between two pixel positions in up to two images. The separation is returned as adverb DIST. Verb TVDIST allows you to select the two pixels interactively from the TV display.

The verb IMCENTER may be used to determine the intensity-weighted centroid of a rectangular or circular portion of an image. The verb returns adverbs PIXXY, COORDINA, and ERROR giving the pixel and physical coordinates of the centroid and an indicator of success or failure.