; RMSD ;---------------------------------------------------------------------- ;! Calculate rms for each pixel using data in a box around the pixel ;# TASK IMAGING ANALYSIS ;----------------------------------------------------------------------- ;; Copyright (C) 2002, 2005, 2007, 2008, 2016, 2020 ;; Associated Universities, Inc. Washington DC, USA. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 2 of ;; the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, ;; MA 02139, USA. ;; ;; Correspondence concerning AIPS should be addressed as follows: ;; Internet email: aipsmail@nrao.edu. ;; Postal address: AIPS Project Office ;; National Radio Astronomy Observatory ;; 520 Edgemont Road ;; Charlottesville, VA 22903-2475 USA ;------------------------------------------------------------------- RMSD LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC RMSD Creates an image of the local RMS around each pixel INNAME Input image name (name) INCLASS Input image name (class) INSEQ 0.0 9999.0 Input image name (seq. #) INDISK 0.0 9.0 Input image disk unit # OUTNAME Output image name (name) OUTCLASS Output image name (class) OUTSEQ -1.0 9999.0 Output image name (seq. #) OUTDISK 0.0 9.0 Output image disk unit #. BLC Bottom left corner of input TRC Top right corner of input IMSIZE Size of the box used to calculate rms, in pixels IMSIZE(2)=-1 => the circle of diameter=IMSIZE(1)is used OPCODE 'RMS ','MEAN','BLAN', 'MAD ','MEDI' (see help), ' ' => 'RMS' OPTYPE 'ROBS', 'HIST' (see help), ' ' => 'ROBS' SCALR1 Data0 => ABS(DATA) < SCALR2*RMS are replaced by blank (OPCODE='BLAN') <0 => ABS(DATA) > ABS(SCALR2)*RMS are replaced by blank (OPCODE='BLAN') 0 => no blanking SCALR3 Robust mean exclusion factor abs(data-mean)>SCALR3*rms are excluded. 0 -> 3. FLUX Data with RMS>FLUX are replaced by blank (OPCODE='BLAN') 0 => no blanking XINC Increment at X to calculate RMS, in pixels YINC Increment at Y to calculate RMS, in pixels The intermediate points are calculated by interpolation ---------------------------------------------------------------- RMSD Task: Creates an image of the local RMS around each pixel over all planes of an image cube. The rms is calculated for each pixel based on the data in a box surrounding the pixel. The size of the box is controlled by the user (adverb IMSIZE). RMS is calculated in a multi-iteration (30) "robust" basis. In the first iteration the RMS is calculated using all points in the box. After that, points which differ from the mean by more than SCALR3*RMS are excluded from the consideration for the next iteration. The iteration process is terminated if none point is excluded. The input image should have the standard sequence of axes with two celestial axes followed by a spectral axis. Adverbs: INNAME.....Input image name (name). Standard defaults. INCLASS....Input image name (class). Standard defaults. INSEQ......Input image name (seq. #). 0 => highest. INDISK.....Disk drive # of input image. 0 => any. OUTNAME....Output image name (name). Standard defaults. OUTCLASS...Output image name (class) Standard defaults. OUTSEQ.....Output image name (seq. #). 0 => highest unique. OUTDISK....Disk drive # of output image. 0 => highest BLC........Bottom left corner in input image of desired subimage. Default is entire image. TRC........Top right corner in input image of desired subimage. Default is entire image. IMSIZE.....Size of the box used to calculate rms, in pixels IMSIZE(2)=-1 => a circle of diameter = IMSIZE(1) is used, instead of a rectangle IMSIZE(1) x IMSIZE(2) OPCODE.....'RMS ' => creates map of RMSes calculated for each pixel using the data inside of the given box surrounding the pixel. 'MEAN' => creates map of MEANes calculated for each pixel using the data inside of the given box surrounding the pixel. 'BLAN' => the image value is replaced by BLANK under control of adverbs SCALR1 and SCALR2 and calculated RMS. This option prepares the image cube to be ready for other tasks (XMOM for example) that require cutoff the 'bad' points on the basis of rms calculated in the vicinity of each image point. 'MAD ' => creates image of the median absolute deviation or MAD = 1.4826 * median ( abs (x - median(x)) ) where the factor converts to an "rms equivalent" ignores OPTYPE and SCALRn 'MEDI' => creates image of the median in the box centered on the pixel; ignores OPTYPE and SCALRn ' ' => 'RMS ' OPTYPE.....Concept of RMS' calculation 'ROBS' => The far away points are rejected at the multi iteration process 'HIST' => The histogram concept is used. Data for histogram are at the range -+ 1.5sigma. The histogram is calculated at 16 intervals with center at the mean value SCALR1.....In OPCODE='BLAN' only, data values below SCALR1*RMS are replaced by BLANK. SCALR2.....In OPCODE='BLAN' only, when SCALR2 > 0.0, data values less in absolute value than RMS*SCALR2 are replaced by blank. When SCALR2 < 0.0, data values greater in absolute value than ABS(SCALR2) are replaced by blank. When SCALR2=0, no replacement by blank SCALR3.....In robust determination of the mean/rms, values differing from the current mean by more than SCALR3 * current rms are excluded from the computation of mean/rms in this iteration. 0 -> 3. FLUX.......Data with RMS>FLUX are replaced by blank (OPCODE='BLAN') FLUX is in Jy/beam 0 => no replacement by blank Replacement by blank is carried out (OPCODE='BLAN') if 'SCALR1' .OR. 'SCALR2' .OR. 'FLUX' XINC.......Increment at X to calculate RMS, in pixels YINC.......Increment at Y to calculate RMS, in pixels The task RMS requires a lot of computing time. XINC, YINC are invented to weaken the computing time problem. The RMS is calculated every XINC, YINC at the X,Y directions. The RMS of intermediate points are estimated by interpolation. The computing time should be reduced by the factor XINC*YINC Programmer Leonia Kogan ------------------------------------------------------------------