CLEAN CLEAN is the program used for cleaning dirty maps produced by the program INVERT. It uses the normal iterative beam-subtraction procedure invented by Hogbom. Example $ CLEAN BEAM = 8.2,1.2,-10 LOOPGAIN = 0.40 NITER = 1050 SIZE = 128 MAPFILE = "[SCRATCH]MAP.SU1" BEAMFILE = "[SCRATCH]BEAM.SU1" PLOTFILE = "CLEAN.PLT/VERSATEC" LISTFILE = CLEAN.LIS CLEANMAP = "3C120SU1.CMP" MODEL = "3C120.MOD" NORESTORE PRINTRESIDUALS LRTB = -30,-20,11,-11, 20,30,11,-11 / PARAMETERS 1 FILES: 1. MAPFILE="filename" [default "MAP"] 2. BEAMFILE="filename" [default "BEAM"] 3. CLEANMAPFILE="filename" [no default] 4. MODEL="filename" [default "MODEL"] 5. PLOTFILE="device/type" [default "PLOTOUT"] 6. LISTFILE="filename" [default "clean.lis"] MAPFILE and BEAMFILE specify the input files containing the map and the beam respectively. These files are the output files from program INVERT. They must match each other in all important respects: eg size, source, u-v coverage, frequency, rotation, weighting and tapering. CLEANMAPFILE specifies a file to receive the final clean map, computed by convolving the delta-function model with the clean beam and adding back to the residuals. If it is not specified, no clean map file CLEAN Page 2 will be created. The clean map file is in FITS format with the clean components attached as a tables extension, and can be copied to tape for archiving or passing into AIPS; it can be displayed by programs FITSLIST, MAPDISP and MAPPLOT. MODEL specifies a name for the (new) output file to contain the list of subtracted delta-functions. This model file has the standard VLB format, and can be used by programs such as VISPLOT and MODPLOT. In hybrid mapping it will be used in the next iteration as the input for program AMPHI. PLOTFILE specifies a device and device type for the contour and gray-scale plots. Any of the standard devices may be used, eg "CLEAN.PLT/VPS" for a PostScript file, "IM1/IMA" for Imagraph, etc. LISTFILE specifies a name for the listing (report) file which receives a record of the program execution. 2 PARAMETERS CONTROLLING PROGRAM ACTION: 1. SIZE = n [ default 128 ] 2. NITER = n [ default 100 ] 3. TMIN = t [ default 0 ] 4. LOOPGAIN = g [ default 0.3 ] 5. BEAM = long,short,pa [ default: from INVERT] 6. LRTB = left,right,top,bottom,... [ default: full map ] 7. NORESTORE : if specified, do not do the RESTORE step 8. NOSQUASH : if specified, do not squash the output model 9. HYBRID : if specified, take special action for hybrid mapping 10. NCPRINT [ default=20 ] SIZE is the width in gridpoints of the map and beam arrays, and must be greater than or equal to the parameter MAPSIZE specified in INVERT. The default value is 128, so it need only be changed if the value of IDIM used in INVERT was greater than 256. The absolute value of NITER is the maximum number of iterations (maximum number of delta-functions to be subtracted). Usually NITER > 0, but if NITER < 0, iteration will stop just before the first negative component is subtracted. TMIN is a convergence limit: cleaning stops when either NITER iterations have been completed or the largest (absolute) value in the map is less than TMIN. TMIN is expressed in Janskys per beam area; ie it is the flux density of a point source that CLEAN Page 3 would give rise to the map value. LOOPGAIN is the loop gain of the CLEAN process: ie the fraction of the largest value that is removed in each iteration. Ideally, LOOPGAIN should be as small as possible, but then a large number of iterations is needed. It is probably best to use a large LOOPGAIN (eg 0.8) in the early stages of hybrid mapping, and to reduce it as convergence is obtained. For conventional mapping, the default is about right. BEAM ispecifies the size of the Gaussian clean beam. When the subtraction phase is completed, the clean map is made by convolving the subtracted delta-functions with this beam and adding them back on to the residuals. The clean beam is an elliptical Gaussian with FWHM = long by short, with the long axis in position angle pa. The two axes can be given in either order. Position angle is measured in degrees from North through East. If BEAM is given only one value instead of three (eg BEAM=0.25), the beam is circular with the given FWHM. If this parameter is not supplied (or if the diameter is set to zero), CLEAN will use the beam size estimated by INVERT. LRTB specifies the "windows" (search areas) for the subtraction phase. Up to 20 rectangular windows can be specified. The parameter LRTB has up to 80 values, which taken in groups of four define the 20 windows. Each window is defined by its left, right, top, bottom coordinates relative to the map center. Windows may overlap. If LRTB is not specified, a single window covering the whole map is used. [N.B. The "L" and "R" coordinates have the opposite sign to the values read off a contour map produced by CLEAN.] The units of BEAM and LRTB can be either ARCSEC or MILLIARCSEC; the default is milliarcsec. If NORESTORE is specified, the restoration phase of CLEAN is omitted; i.e., the "clean map" will contain only the residuals. If NOSQUASH is specified, the output model is not squashed. Otherwise, it is squashed: all delta functions removed from the same gridpoint are consolidated into one component in the output model. Squashing can save a substantial amount of cpu time in later programs like VISPLOT and AMPHI which have to recalculate the model in the (u,v)-plane. Note however that squashing is not always advisable: after squashing, the components are not in decreasing order of flux density, so using the option in AMPHI to use only the first n components will not do what you expect. An unsquashed model can be squashed with the separate program MODFIX. HYBRID requests a special action for hybrid mapping: Readhead and Wilkinson suggest that the convergence of hybrid mapping is improved if components more negative than one tenth of the strongest component are omitted from the output model; this is done if HYBRID is specified. Generally, if such large negative components are found, the starting model was very poor and one should try to improve it before proceeding. CLEAN Page 4 NCPRINT is used to reduce the quantity of printout. Only the first NCPRINT and the last NCPRINT components to be subtracted are listed. 3 PLOTTING: 1. PLOTMAP : if specified, contour the clean map 2. PLOTWINDOW : if specified, draw the windows on the plot 3. PRINTMAP : if specified, plot the clean map (gray-scale) 4. PLOTCOMP : if specified, produce a convergence plot 5. PRINTRESIDUALS : if specified, plot the residuals (gray-scale) 6. CONTOURS=v1,v2,v3,v4,...,v20 : contour levels as percent of peak 7. TITLE = "title" The default is no plotting. The plots are sent to the device specified by parameter PLOTFILE (see above). I do not recommend drawing gray-scale plots on Tektronix or VT125 terminals or on Versatec, because they consume a vast amount of cpu time. They are OK on PostScript and other devices. PRINTRESIDUALS is a useful option: it displays what is left of the map after the subtraction phase - this should be noise if CLEAN has converged. Each gray-scale plot is scaled so that zero appears white and the maximum value appears black; all negative values appear white. A convergence plot shows the amplitude of the clean components as a function of iteration number. Up to 20 contour levels for PLOTMAP can be specified with CONTOURS. The units for the contour levels are percent of the maximum of the clean map. The default contours are at -45, -35, ..., -5, -2, 2, 5, 15, ..., 95%. The title written above each plot can be specified with TITLE. The name of the source is appended to the given title. History Version 1.0: 1979 Jul 5 - new program (T.J. Pearson). Version 2.0: 1979 Sep 8 - Print cleaning window above clean map; change XYINT to floating-point, milliarcsec; change transfer-format for maps to binary (TJP). CLEAN Page 5 Version 3.0: 1980 Feb 18 - New format for contour maps; default contours 5,15...%; list contours; plot window if requested; variable map size; NORESTORE switch; specify window (LRTB) in milliarcsec (TJP). Version 4.0: 1980 May 30 - Revised for new INVERT; dynamic allocation (TJP). Version 5.0: 1981 Mar 5 - NORESTORE inhibits PRINTBEAM; Add comments in output model file; change to Fortran-77 syntax. Version 6.0: 1981 Jul 16 - Plot x-axis right to left; squash model (TJP). Version 7.0: 1981 Nov 27 - Add NOSQUASH parameter; change format of gray-scale plots; remove PRINTBEAM option (TJP). Version 7.1: 1982 Mar 4 - Correct bug in error message; more decimal places in flux output (TJP). Version 8.0: 1983 Mar 30 - Add COMPLOT option; add PLOTFILE parameter; change contour-level specification to percent; add CLEANMAP output file parameter (TJP). Version 9.0: 1984 Jan 22 - Change format of clean map to FITS; change all flux scales to Jy/beam (TJP). Version 9.1: 1984 Jun 11 - Add clean components as a Tables extension to the clean map; display max and min of clean map (TJP). Version 9.2: 1985 Jun 26 - Pick up array name and epoch from INVERT. Version 9.3: 1986 Apr 4 - Pick up map center from INVERT. Version 9.4: 1986 Sep 25 - Add ADDSOURCE parameter. Version 10.0: 1988 Apr 10 - eliminate command qualifiers; add LISTFILE; test on Convex (TJP). Version 10.1: 1988 Jul 7 - multiple windows (TJP). Version 10.2: 1988 Aug 9 - add epoch to header of clean map. Version 10.3: 1988 Oct 22 - add explicit 'D0' to real*8 parameters. Version 10.4: 1988 Nov 1 - if NORESTORE specified, still write out clean map (i.e. map of residuals). Version 10.5: 1988 Dec 16 - slight changes to plotting. Version 10.6: 1988 Dec 30 - correct error in window calculation; add PLOTDELTA option. Version 10.7: 1989 Mar 3 - changes to plotting; additional annotation. Version 10.8: 1989 Jun 6 - put FITS image the right way up. Version 10.9: 1989 Aug 23 - increase size of clean beam array. Version 11.0: 1991 Apr 17 - put rotation angle in header of cleanmap. version 11.1: 1991 Nov 7 - pick up default beam from INVERT.