.ec _
.ll 76
.ad b
.in 4
.ti -4
1 Language
.nf
ALMA          : Joint deconvolution of ALMA and ACA dirty images
BUFFERS       : List and Display the known buffer status
CLEAN         : Deconvolve a dirty image using the current METHOD
COLOR         : Control the color LUT to highlight the Zero level
DUMP          : Dump the control parameters of the deconvolution algorithms
FIT           : Fit the dirty beam
INSPECT__3D    : Visualize datacube by cuts along 3 main directions
MAP__RESAMPLE  :  Resample a Map on a different Velocity/Frequency scale
MAP__INTEGRATE :  Compute a Moment 0 Map
MAP__COMPRESS  :  Average a Map by several channels 
MOSAIC        : Toggle the mosaic mode
MX            : Iteratively image and deconvolve a dirty image
PRIMARY       : Apply primary beam correction
READ          : Read the input files in internal buffers
SHOW          : Display (in a plot) some internal buffer result
SPECIFY       : Change the Frequency / Velocity scale or the Telescope
STATISTIC     : Compute statistics on image
SUPPORT       : Define the support used to search clean components
UV__BASELINE   : Subtract a continuum baseline from a Line UV data
UV__CHECK      : Check UV data for null visibilities or per channel flags.
UV__COMPRESS   : Compress a Line UV data into another Line UV data
UV__CONTINUUM  : Compress a Line UV data into a Continuum UV data
UV__EXTRACT    : Extract a range from
UV__FILTER     : Filter out (line) channels
UV__FLAG       : Interactively flag UV data
UV__MAP        : Build the dirty image and beam from a UV table
UV__RESAMPLE   : Resample (in Velocity) the UV data
UV__RESIDUAL   : Subtract Clean Component from the UV Data
UV__RESTORE    : Restore a Clean image from UV data and Clean Components
UV__SHIFT      : Shift a UV table to common phase center
UV__SORT       : Sort and Transpose UV data for plotting
UV__SPLIT      : Split a UV table into Line and Continuum
UV__STAT       : Gives beam sizes and noise properties as a function of
                 tapering or robust weighting parameter
UV__TIME       : Time average the current UV data
UV__TRUNCATE   : Truncate the baseline range of the UV data
VIEW          : Show (in a GO VIEW-like plot) some internal buffer result
WRITE         : Save internal buffers or Image variables onto output files
.fi

.ti -4
1 ALMA
.ti +4
[CLEAN_\]ALMA [FirstPlane [LastPlane]] [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY] [/NOISE] [/METHOD]

Joint deconvolution methods specific to ALMA+ACA observations.

The ALMA simulator can be accessed either by typing "@ alma" at the prompt
or from the MAPPING main menu.

.ti -4
1 BUFFERS
.ti +4
[CLEAN_\]BUFFERS

List the status (sizes) of known buffers.
.ti -4
2 AGAINS 
.ti +4

  AGAINS is a buffer containing the results of a self-calibration
with command SELFCAL. It is a special table in the following format.
Each line contains a different time stamp. Column 1 is the Time
(in seconds), Col 2 the Date (in Days, with an arbitrary origin),
Col 3 the number of antennas, Col 4 the antenna reference number,
and then, for each antennas i, Cols (2+3*i:2+3*i) contains the
Amplitude correction factor, the Phase correction (in degree), and
the Signal-to-noise of the correction.

.ti -4
2 BEAM
.ti +4
  BEAM is a 2,3 or 4-D image buffer containing the synthesized beam
computed by UV__MAP (or by READ BEAM).
        
.ti -4 
2 CCT
. ti +4
  CCT is a special 3-D array containing the Clean Component Table.
The first dimension contains (x,y,f), the flux (in Jy) at offset
x,y (in radians). The second dimension handles the number of channels.
The last dimension handles the Clean iteration number. 

.ti -4
2 CGAINS
.ti +4
 
 CGAINS is a pseudo-UV table containing the complex gain correction
 resulting from a SELFCAL command (or read by READ CGAINS). It is
 analogous to a single-channel UV table, but interpreted by IMAGER
 as gain corrections to apply to the UV data by command APPLY.

.ti -4
2 CLEAN
.ti +4
  CLEAN is the deconvolved 2 or 3-D image produced by UV__MAP
(or read by READ CLEAN).  It is not corrected for primary 
beam attenuation.
  
  For Mosaics, command CLEAN produces a SKY brightness map, corrected
 from primary beam attenuations.

.ti -4
2 CLIPPED
.ti +4
  CLIPPED is a 2-D table containing the Clipped spectra produced
by command UV__PREVIEW. Col 1 contains the Velocity, Cols 2:N+1
the spectra for the N tapers used in UV__PREVIEW, Col N+2 
the natural weights.

.ti -4
2 CONTINUUM
.ti +4
  CONTINUUM contains the pseudo-UV table used (and created) by 
command UV__MAP /CONT to construct the continuum image. See
command UV__CONTINUUM for details.

.ti -4  
2 DIRTY
.ti +4
  DIRTY contains the dirty image produced by UV__MAP. Its interpretation
is different for a Single field than for a Mosaic.

.ti -4
2 EXTRACTED
.ti +4
  EXTRACTED   contains the 3-D data cube produced by command EXTRACT

.ti -4
2 FIELDS
.ti +4
  FIELDS is an intermediate buffer created by SHOW PRIMARY. It
is a transposed version of the PRIMARY buffer, in order (l,m,f) where
f is the field number.
  
  Note: there is a confusion with the FIELDS structure created
by READ UV on Mosaic UV tables.

.ti -4
2 MASK 
.ti +4
  MASK contains the Mask computed by command MASK (or read by READ MASK).
It may be used (or not) for CLEAN, depending on the selected type
of Support (see SUPPORT /MASK and MASK USE commands).        

.ti -4
M_AREA   
.ti +4
    M_AREA is a 2-D image containing the integrated area
computed by command MOMENTS   (CASA 0-th moment)
    
.ti -4
M_PEAK   
.ti +4
    M_PEAK is a 2-D image containing the peak flux 
computed by command MOMENTS   (CASA 8-th moment)
    
.ti -4
M_VELO   
.ti +4
    M_VELO is a 2-D image containing the mean velocity 
computed by command MOMENTS. Its value depends on the method
used in command MOMENTS: it can be the 1-st moment, or a fit
of the peak velocity.    
    
.ti -4
M_WIDTH   
.ti +4
    M_WIDTH is a 2-D image containing the velocity dispersion
computed by command MOMENTS. It is equivalent to the Full Width
at Half Maximum is the line shape is Gaussian.
    
.ti -4
2 PRIMARY
.ti +4
  PRIMARY is the primary beam, computed by command PRIMARY or
read by command READ PRIMARY. It may be 2-D (for single fields)
or 3-D (for Mosaics). It the later case, it is in the order
(f,l,m) where f is the field number. 

.ti -4
2 RESIDUAL
.ti +4
  RESIDUAL is the image of the residuals from the Clean deconvolution.

.ti -4
2 SHORT
.ti +4
  SHORT is the Short-Spacing image, computed by command UV__SHORT,
or read by command READ SINGLE.

.ti -4 
2 SINGLE
.ti +4
  SINGLE is the Single-Dish data read by command READ SINGLE.
It may be a Class-table or a 3-D data cube.

.ti -4
2 SKY
.ti +4
  SKY is a 3-D image buffer containing the current estimate of the 
Sky brightness distribution. It is provided by command PRIMARY from 
the CLEAN and PRIMARY buffers for single-field data, but by command 
CLEAN for Mosaics.  Noise is not uniform in SKY image.

.ti -4
SLICE
.ti +4
  SLICE is 2-D buffer produced by the SLICE command.

.ti -4
SPECTRUM 
.ti +4
  SPECTRUM is a 2-D table containing the  spectra produced
by command UV__PREVIEW. Col 1 contains the Velocity, Cols 2:N+1
the spectra for the N tapers used in UV__PREVIEW, Col N+2 

.ti -4
2 UV
.ti +4
  UV is the current UV data. It is initially set by command READ UV,
but modified by many UV__like commands (resampling, calibration, etc...)

.ti -4
2 UV__FIT
.ti +4
  UV__FIT handles the results of the UV__FIT command. It is a
special format 2-D table. See HELP UV__FIT for details.

.ti -4
2 UVCONT
.ti +4
  UVCONT handles the intermediate (pseudo-)UV table created and used
by command UV__MAP /CONT for Multi-Frequency-Synthesis. It is a valid
2-D UV table, but which have more than 1 visibility for the same time
and baseline pair, with different (frequency-scaled) (u,v) coordinates.
Such UV tables can be properly imaged, but not properly self-calibrated.

.ti -4
2 UVRADIAL
.ti +4
  UVRADIAL  handles an azimutally averaged version of the UV data. It
is produced by command UV__RADIAL.

.ti -4
2 WEIGHT
.ti +4
  WEIGHT is the equivalent of PRIMARY for Mosaics. It is a 2 or 3-D 
image buffer containing the relative response given by all pointings 
of the Mosaic coverage.


.ti -4
1 CLEAN
.ti +4
[CLEAN_\]CLEAN [FirstPlane [LastPlane]] [/PLOT Clean|Residu] 
  [/FLUX Fmin Fmax] [/QUERY] [/NITER NiterList] [/ARES AresList]

Deconvolve a Mosaic or Single-field using the current METHOD (in SIC variable METHOD).
See INPUT CLEAN for the other SIC variables controlling the deconvolution process.
Supported methods are CLARK, HOGBOM, MRC, MULTISCALE and SDI. Use
HELP CLEAN Method and/or HELP CLEAN METHODNAME for further details 
on each algorithm. 

Clean the specified plane interval (default: planes between variables FIRST
and LAST). If only FirstPlane is specified, Clean only that plane.
This command allows a per-plane definition of the convergence criteria 
CLEAN__NITER and CLEAN__ARES.

.so imager-help-clean-input.nroff

.ti -4
2 /FLUX
.ti +4
[CLEAN_\]CLEAN [FirstPlane[LastPlane]] /FLUX Fmin Fmax [/PLOT Clean|Residu] [/QUERY] [/NITER NiterList] [/ARES AresList]

Display the cumulative Clean flux as Clean progresses. This option is
inactive in Parallel mode.

.ti -4
2 /PLOT
.ti +4
[CLEAN_\]CLEAN [FirstPlane [LastPlane]] /PLOT Clean|Residu [/FLUX Fmin Fmax] [/QUERY] [/NITER NiterList] [/ARES AresList]

Display the iterated Clean or Residual image for Cleaning methods which have
major cycles (CLARK or SDI). This option is inactive in Parallel mode.

.ti -4
2 /QUERY
.ti +4
[CLEAN_\]CLEAN [FirstPlane [LastPlane]] /PLOT Clean|Residu /QUERY [/FLUX Fmin Fmax] [/NITER NiterList] [/ARES AresList]

*** Obsolescent ***

Prompt for continuation when a Major cycle is complete. This option is
inactive in Parallel mode.

.ti -4
2 /NITER
.ti +4

[CLEAN_\]CLEAN [FirstPlane [LastPlane]] /NITER NiterList [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY] [/ARES AresList]

Use a per-plane value for the number of iterations, instead of the
global NITER variable.  NiterList should be a 1-D integer array
of dimension the number of channels.

This option is only available through the CLEAN command, not through
the specific command of each method.

.ti -4
2 /ARES
.ti +4

[CLEAN_\]CLEAN [FirstPlane [LastPlane]] /ARES AresList [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY] [/NITER NiterList] 

Use a per-plane value for the absolute residual used to stop
cleaning,  instead of the
global ARES variable.  AresList should be a 1-D real  array
of dimension the number of channels.



.ti -4
2 Methods:
.nf
  CLARK       A minor/major cycle cleaning using FFTs for speed
              Fast, but less stable than others.
  HOGBOM      The basic deconvolution method, working component per 
              component. Slow but robust
  MRC         A (2-scales) multi-resolution-Clean working on a smooth
              and a difference map. Fast, but with no notions of Clean
              components
  MULTISCALE  A 3-scales multi-resolution-Clean working on 3 smoothed
              versions of the map. Slow, but very stable and adapted to
              sources with extended structures.
  SDI         A major-cycle only method. Good for extended structures
              but not very performant overall.
.fi
.ti -4
2 CLARK
.ti +4
  CLEAN [FirstPlane [LastPlane]] [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY]

with METHOD = CLARK

A Major-Minor cycles CLEAN method, originally developed by B.Clark, in
which clean components are selected using a limited beam patch, and
deconvolved through Fourier transform at each major cycle. In mosaic mode
(See command MOSAIC), a mosaic clean is performed. Rings and/or stripes may
appear on extended sources.  Faster than the HOGBOM method for single
fields but maybe slower for mosaics. The strategy to search for CLEAN
components in CLARK method does not work properly when the secondary side lobes
are too large (e.g. larger than 0.3), or in case of high phase noise.

.ti -4
2 HOGBOM
.ti +4
  CLEAN [FirstPlane [LastPlane]] [/FLUX Fmin Fmax]

with METHOD = CLEAN

The simplest CLEAN algorithm, originally developed by Hogbom. In mosaic
mode (See command MOSAIC), a mosaic clean is performed.  Rings and or
stripes may appear on extended sources. It is slower than CLARK for a single
field but maybe faster for a mosaic. It is extremely robust.  Cleaning can
be interrupted by pressing _^C at any time.

.ti -4
2 MRC
.ti +4
CLEAN [FirstPlane [LastPlane]] [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY]

with Method = MRC

Perform a Multi-Resolution CLEAN on the current dirty image.  MRC does not
support mosaics for theoretical reasons.

If option /PLOT is given, a display of the CLEAN or RESIDUAL map
will be shown at each major cycle, depending on the argument (default:
Residual). The user will be prompted for continuation when the /QUERY
option is present. The cumulative, already cleaned flux is displayed in
real time in an additional window while cleaning goes on when the /FLUX
option is present. Parameters of the /FLUX option are then used to give the
flux limits for this display. A summary plot with the Difference, Smooth,
and total CLEANed maps is also displayed.


.ti -4
2 MULTI
.ti +4
CLEAN [FirstPlane [LastPlane]] [/FLUX Fmin Fmax]

with METHOD = MULTI

Perform a 3-scales Hogbom-like deconvolution. A each minor cycle, the
the scale with the highest signal to noise is used to define the
Clean Components to retain. The algorithm is thus very stable. 
The cumulative, already  cleaned flux is displayed in real time
in an additional window while cleaning goes on when the /FLUX option is
present. Parameters of the /FLUX option are then used to give the flux
limits for this display.

MULTI does not yet work on mosaics.

.ti -4
2 SDI
.ti +4
CLEAN [FirstPlane [LastPlane]] [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY]

with METHOD = SDI

Perform a Steer-Dewdney-Ito CLEAN. This clean method selects an ensemble of
clean components and remove them at once using FFTs.  It works best for
extended sources and UV coverages with short spacings. In such a case, it
may avoid the "ringing" features which appear using the CLARK or HOGBOM
techniques. In mosaic mode (see command MOSAIC), a mosaic clean is
performed.

.ti -4
2 Variables:
.ti +4
.so imager-help-clean-clean-list.nroff

.so imager-help-clean-clean-desc.nroff

.ti -4
1 COLOR
.ti +4

  COLOR Range [MinHue MaxHue]
  
Select a color Look-up-Table ranging between MinHue and MaxHue (in the
[0,360] domain). Range (in the same units) indicate a part of the LUT
which  becomes progressively whiter (less saturation, Range < 0) or 
darker (less intensity, Range > 0) around the colour defining the 
Zero level of the image.

Such LUTs allow to outline the Signal-containing regions compared
to the noise level, either in bright (Range < 0) or dark (Range > 0)
modes.

.ti -4
1 DUMP
.ti +4
[CLEAN_\]DUMP [U]

Dump on screen the control parameters of the different CLEAN deconvolution
algorithms, mainly for debugging purpose. "DUMP U" dumps the parameters as
input by the user while "DUMP" dumps the parameters really used and/or
modified by the deconvolution algorithm.

.ti -4
1 FIT
.ti +4
[CLEAN_\]FIT [Field]

Fit the dirty beam to obtain the clean beam parameters.  This is done
automatically by all CLEAN algorithm when needed. 
In mosaic mode, you can specify on which field the fit has to be made,
using the first argument.

Fixed values: Clean beam parameters can
also be specified by the users, by setting the variables MAJOR,
MINOR and ANGLE to values other than their default values (0,0,0). In
this case, no automatic fit will be performed. We strongly discourage the
use of those variables, which may result in a very improper flux
scaling if the beam size is inappropriate. This mode should be reserved
to special cases where the beam cannot be properly fitted, or to
have a circular beam by taking as beam size the geometrical mean
of the fitted major and minor sizes.

.ti -4 
2 CLEAN__SIDELOBE 

Minimal relative intensity to consider for fitting the syntheized
beam to obtain the Clean beam parameters (MAJOR, MINOR and ANGLE) when
0.  The default is 0.30.

In case of poor UV coverage, CLEAN__SIDELOBE should be higher than the
maximum sidelobe level to perform a good Gaussian fit. Some particularly
bad UV coverage may not allow any good fit at all, however.

.ti -4
1 INSPECT__3D
.ti +4
[CLEAN_\]INSPECT__3D Argument [FirstPlane [LastPlane]]

where
.br Argument
.ti +4 
is the the name of a 3-D internal buffer to be plotted (BEAM, CCT, CLEAN, DIRTY,
FIELDS, MASK, etc.. ), or any Sic Image variable, or a file name.

Simultaneously display cuts along each of main cube directions, as
well as the current spectrum. Coordinates are controlled by the cursor
position in the plots.

.ti -4
2 History

INSPECT__3D is a command equivalent of GO 3VIEW, just with a simpler
syntax and the ability to display program buffers as well as files.


.ti -4
1 MAP__COMPRESS
.ti +4
[CLEAN_\]MAP__COMPRESS WhichOne Nc

Resample (in frequency/velocity) the images (computed by UV__MAP or 
CLEAN, or loaded by READ WhichOne) by averaging NC adjacent channels. 

WhichOne indicates which image must be compressed (DIRTY, CLEAN, SKY).
WHichOne = * can be used to treat all the possible images.

.ti -4
1 MAP__INTEGRATE
.ti +4
[CLEAN_\]MAP__INTEGRATE WhichOne Min Max Type

Compute the integrated intensity map(s) over the specified
range from the current image()s (computed by UV__MAP or 
CLEAN, or loaded by READ WhichOne). Type can be VELOCITY
FREQUENCY or CHANNELS. 

WhichOne indicates which image must be compressed (DIRTY, CLEAN, SKY).
WhichOne = * can be used to treat all the possible images.

.ti -4
1 MAP__RESAMPLE
.ti +4
[CLEAN_\]MAP__RESAMPLE WhichOne Nc Ref Val Inc

Resample the images (computed by UV__MAP or 
CLEAN, or loaded by READ WichOne) on a different velocity scale.  
.nf
     Nc   new number of channels
     Ref  New reference pixel
     Val  New velocity at reference pixel
     Inc  Velocity increment
.fi
WhichOne indicates which image must be compressed (DIRTY, CLEAN, SKY)
WHichOne = * can be used to treat all the possible images.

.ti -4
1 SPECIFY
.ti +4
[CLEAN_\]SPECIFY FREQUENCY|VELOCITY|TELESCOPE Value

.ti +4
SPECIFY FREQUENCY Value
.br
Modify the rest frequency and recompute the velocity scale accordingly.
Value is the new rest frequency in MHz

.ti +4
SPECIFY VELOCITY Value
.br
Modify the source velocity and recompute the rest frequency scale accordingly
Value is the new velocity in km/s.

.ti +4
SPECIFY TELESCOPE Name

Add or Replace the telescope section with the parameters (name,
size, position) for the specified telescope name, essentially to 
get the most appropriate beam parameter.

A Telescope section is required for MOSAIC. The beamsize will
depend on telescope diameter and frequency, with a telescope
dependent factor. The default beam size is 1.13 Lambda/D.

.ti -4
1 MOSAIC
.ti +4
[CLEAN_\]MOSAIC On|Off

Turn on or off the mosaic mode for deconvolution. Note that a READ PRIMARY
command, or a UV__MAP command working on a Mosaic UV Table, automatically switches
on the mosaic mode. The program prompt changes to inform the user of the
current operating mode for deconvolution.


.ti -4
1 MX
.ti +4
[CLEAN_\]MX [FirstPlane [LastPlane]] [/PLOT Clean|Residu] [/FLUX Fmin Fmax] [/QUERY]

Make and deconvolve maps starting from a UV table. It combines UV__MAP and
CLEAN in a single step.

The mapping process is identical to UV__MAP.  It makes a map from UV data
by griding the UV data using a convolving function, and then Fast Fourier
Transforming the individual channels.  However, MX always produces a single
beam for all channels, thus neglecting frequency change between channels.
MX enables to shift the map center and rotate the image, by shifting the
phase tracking center and rotating the UV coordinates of the input UV
table.

The CLEAN algorithm is similar to the CLARK method, but with major cycles
operating directly on the ungridded UV table rather than in the image
plane. Accordingly, aliasing affects only of the residuals, not the clean
components. It is thus more accurate but also slower than CLARK as it asks
for the gridding step at each major cycle.  MX also shares the same
limitation as CLARK on large sidelobes.

.so imager-help-clean-input.nroff

.ti +4
        [CLEAN\MX ?
.br
    Will list all MAP__* and CLEAN__ * variables controlling the MX parameters.

.ti -4 
2 Variables:
.ti +4
.so imager-help-clean-uvmap-list.nroff

.so imager-help-clean-clean-list.nroff

.ti -4
1 PRIMARY
.ti  +4
[CLEAN_\]PRIMARY [BeamSize] [/TRUNCATE Percent]

Apply approximate primary beam correction to a single field deconvolved
(CLEAN) image, in order to create the sky brightness image (named SKY).
The truncation level is given by default by variable CLEAN__TRUNCATE,
and can be overriden by the /TRUNCATE option.

The primary beam model is a simple Gaussian.
If BeamSize (in radian) is specified, uses the corresponding
half-power beam size to determine the Gaussian beam.
If not, the parameters are taken from the telescope parameters, as
found in the telescope section of the CLEAN image and the observing 
frequency from the CLEAN image (e.g. for ALMA it uses 1.13 Lambda/D).

The SKY image is written with extension .lmv-sky by command WRITE.


.ti -4
2 /TRUNCATE
.ti  +4
[CLEAN_\]PRIMARY [BeamSize] /TRUNCATE Percent

Specify the truncation level. Default (in % of peak beam response)
is given by the CLEAN__TRUNCATE variable. Values are blanked beyond this.

.ti -4
1 READ
.ti +4
[CLEAN_\]READ Buffer File [/COMPACT] [/FREQUENCY RestFreq]
  [/RANGE Min Max Type] [/NOTRAIL]

Read the specified internal buffer (BEAM, CCT, CGAINS, CLEAN, DIRTY,  
MASK, MODEL, PRIMARY, RESIDUAL, SKY, SUPPORT, SINGLEDISH, UV) from input File. 
Default extension is .uvt for UV, CGAINS and MODEL, and for the others, 
in order, .beam, .cct, .lmv-clean, .lmv, .msk, .lobe, .lmv-res, 
.lmv-sky, .pol and .tab respectively. A subset of all available channels can 
be indicated through the /RANGE option, even for UV tables.

The corresponding buffer is available as a SIC image-like variable
of the same name, so that one can use e.g. HEADER DIRTY command.

READ * Name   will attempt to read all existing files of
same Name with the standard file types corresponding to the
respective buffers.

The MODEL UV table is for use in conjunction with commands 
in the CALIBRATE\ language.

The /COMPACT option is used to load the ACA-specific internal buffer used
in the ALMA joint deconvolution method.

The /NOTRAIL allows to ignore trailing columns (normally not
recommended. Used for debug only).

.ti -4
2 Buffers
.ti +4
[CLEAN_\]READ Buffer File [/COMPACT]
  
  The recognized Buffer names for READ are:
.nf
  BEAM        Synthesized Dirty beam
  CCT         Clean Component list
  CGAINS      Complex gains for APPLY command
  CLEAN       Deconvolved Clean image
  DIRTY       Dirty image
  PRIMARY     Primary beam
  RESIDUAL    Residual image
  MASK        Spatial mask 
  MODEL       UV table for Clean components
  SINGLEDISH  Single-Dish table or data cube
  SKY         Primary beam-corrected deconvolved sky brightness
  SUPPORT     Polygon enclosing the Support for Cleaning
  UV__DATA     UV data table
  UV__FIT      UV__FIT results table (for SHOW UV_FIT)
.fi

The following ones are allowed with the /COMPACT option
.nf
  BEAM        Synthesized Dirty beam
  DIRTY       Dirty image
  PRIMARY     Primary beam
  RESIDUAL    Residual image
  UV__DATA     UV data table
.fi

.ti -4
2 Optimisation
.ti +4

Reading can be lengthy, especially for ALMA data.
Mapping attempts to minimize read operations by checking
if anything has changed since the last command.  This
capability is enable if the SIC variable MAPPING__OPTIMIZE
is non zero, disabled otherwise.
  Currently, the READ command always display a message
about what reading may have been skipped, and whether this
possible optimization has been overridden by user choice.

.ti -4
2 /COMPACT
.ti +4
[CLEAN_\]READ Buffer File /COMPACT [/RANGE Min Max Type]

Read the specified internal buffer (UV, MODEL,
BEAM, PRIMARY, DIRTY, CLEAN, MASK, CCT) from input File to the
"compact array" data area.

.ti -4
2 /FREQUENCY
.ti +4
[CLEAN_\]READ Buffer File /FREQUENCY RestFreq [/RANGE Min Max Type]

Read the specified internal buffer and reset the velocity
scale to the corresponding rest frequencies. Velocities specified
in the /RANGE Min Max VELOCITY option would then refer to this
new frequency.

.ti -4
2 /NOTRAIL
.ti +4
[CLEAN_\]READ Buffer File /NOTRAIL [/FREQUENCY Freq] [/RANGE Min Max Type]

When reading UV Tables, ignores any trailing column. Trailing
columns normally appear for mosaics. However, ALMA sometimes uses
known proper motions to shift (by small amounts) phase centers
between two observing periods, yielding pseudo-mosaics with tiny
(in general insignificant) displacements.  The /NOTRAIL option
allows to ignore these details.

.ti -4
2 /PLANES
.ti +4
[CLEAN_\]READ Buffer File /PLANES First Last

  ** OBSOLESCENT **
Use /RANGE for a simpler interface.

Read only "channels" between First and Last.
For UV tables with more than 1 Stokes parameter,
which are **NOT** fully supported by IMAGER, the
meaning of "channel" is ambiguous.

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]READ Buffer File /RANGE Min Max Type

Load only the channels between the First and Last
defined by Min Max and Type.  Type can be
CHANNEL, VELOCITY or FREQUENCY.

For type CHANNEL, Min and Max indicate offsets from
Channel 1 and Channel Nchan (the number of channels
in the data set). Thus Max can be negative: it then
indicates Last = Nchan-Max. Also Min=0 and Max=0 implies
loading all the channels.

.ti -4
2 SINGLE
.ti +4
[CLEAN_\]READ SINGLE File[.ext] [/RANGE Min Max Type]

Read the "Single Dish" data set. It can be a Class table (.tab),
or a 3-D data cube (.lmv order).  The data set is available
as the SINGLE image variable.

If it is a 3-D data cube, the SHORT image variable is also defined
(the data area is shared with that of the SINGLE imager variable,
but the Headers are separate).  If it is a Class table, the
SHORT image becomes undefined. It will be computed by command
UV__SHORT (see HELP UV__SHORT Step__1). 

.ti -4
1 SHOW
.ti +4
[CLEAN_\]SHOW Argument [Arg1 [Arg2]]

where
.br 
Argument
.ti +4 
is a Keyword (e.g. COVERAGE, NOISE, UV__FIT or MOMENTS), the
name of an internal buffer to be plotted (BEAM, CCT, CLEAN, 
DIRTY, etc.. ), a 2-D or 3-D SIC image variable or datacube
filename (in Gildas or simple FITS image format).

.ti +4
[CLEAN_\]SHOW ?
.br
will list the names of recognized keywords and buffers. 

.ti +4
Except for UV data where they have a different meaning,
.br 
Arg1 and Arg2
.ti +4
are optional arguments to restrict the range of
channels to be plotted. They default to  FIRST and LAST variable values
respectively, and Arg2 defaults to Arg1 if only Arg1 is specified.

The UV data in the internal buffer is the one loaded by command
READ UV File and optionally resampled by UV__RESAMPLE, UV__COMPRESS or
transformed by UV__CONT. Flagged UV data  will appear in a different color.

Command VIEW offers a different style of display for cubes, NOISE and CCT.

.ti -4
2 History
.ti +4 
SHOW derives from the GO PLOT script available in GreG and Mapping.
GO PLOT (or its variants GO BIT, GO NICE and GO MAP) and GO UVSHOW 
offer similar features to those of SHOW, but take data from files 
or SIC image variables, depending on variables NAME and TYPE.

.ti -4 
2 Keywords:

SHOW recognizes the following keywords
.nf
  CCT         Clean Cumulative Flux
  COMPOSITE   Moments + Flux
  COVERAGE    UV Coverage
  FLUX        Integrated spectra over defined regions
  MOMENTS     0th,1st,2nd moments + peak value
  NOISE       per channel noise 
  SELFCAL     Self-Calibration corrections
  SPECTRA     Spectra on a 2-D map-like grid
  SOURCES     Clean component positions
  UV          UV data
  UV__FIT     Results of the UV__FIT command
.fi

SHOW calls the appropriate procedures for each action
.nf
  p__show__map       for data cubes
  p__show__cct       for CCT (Clean Component Tables)
  p__show__composite for Composite display (Moments + Flux)
  p__show__flux      for FLUX
  p__show__moments   for MOMENTS 
  p__show__noise     for NOISE
  p__show__selfcal   for SELFCAL
  p__show__tcc       for SOURCES (Clean Component Positions)
  p__spectra        for SPECTRA
  p__uvshow__sub     for UV__DATA data
  p__plotfit        for UV__FIT data (UV__FIT results)
.fi

.ti -4
2 CCT
.ti +4
SHOW CCT 

Display the Cumulative Clean Flux as function of component
number. Pretty useful to see if CLEAN has reasonably converged.

.ti -4
2 COMPOSITE
.ti +4
SHOW COMPOSITE
  
Display the 3 "moments" images derived from a datacube by command MOMENTS,
and the integrated line flux computed by command FLUX.
The contour spacing for each image is controlled by its own variable:
.nf
AREA__SPACING   for the integrated area  M__AREA
VELO__SPACING   for the Velocity field M__VELO (in km/s)
WIDTH__SPACING  for the Width field M__WIDTH (in km/s)
.fi

As for other image displays, CENTER and SIZE control the center
and size of the image (in arcsec). Limits for the Flux spectrum
are computed automatically.

.ti -4
2 COVERAGE
.ti +4
SHOW COVERAGE [Ant [Date]]

Displays the UV coverage.
Ant and Date are optional arguments indicating which Antenna
is to be highlighted, and for which date. Date is a sequential
number from 1 to the number of observing dates.

For spectral line UV data, SHOW COVERAGE will only show one
UV coverage if FIRST and LAST are set to zero. It will show one
per channel otherwise.

.ti -4
2 FLUX
.ti +4
SHOW FLUX

Displays the integrated spectra in all regions used by  
command FLUX. 

.ti -4
2 MOMENTS
.ti +4
SHOW MOMENTS
  
Display the 4 "moments" images derived from a datacube by command MOMENTS.
The contour spacing for each image is controlled by its own variable:
.nf
AREA__SPACING   for the integrated area  M__AREA
PEAK__SPACING   for the peak brightness value M__PEAK (in K)
VELO__SPACING   for the Velocity field M__VELO (in km/s)
WIDTH__SPACING  for the Width field M__WIDTH (in km/s)
.fi

As for other image displays, CENTER and SIZE control the center
and size of the image (in arcsec). 
  
.ti -4
2 NOISE
.ti +4
SHOW NOISE [CLEAN|DIRTY]

Compute and display the noise statistic of the specified data
cube, using a Gaussian fit to the histogram of pixel intensities
for each channel.

.ti -4
2 SOURCES
.ti +4
SHOW SOURCES [First [Last]]

Display the "point sources" found by CLEAN at their positions,
using a marker with area proportional to their flux. Positive
sources are in black, negative ones are in red.

The displayed zone is controlled by variables SIZE and CENTER, as
for in SHOW CLEAN  or SHOW DIRTY. However, when SIZE is 0, the
displayed zone is set to  the minimum required to display all point 
sources detected by CLEAN. It may thus differ from the CLEAN map size.

.ti -4
2 SPECTRA
.ti +4
SHOW SPECTRA Clean|Dirty|Sky|ImageVar

Display individual spectra in a Map-like display (one per box, placed
at their respective positions) from a 3-D SIC variable, assumed
to be in the LMV order.

Note: the second argument may be omitted to re-display the same
dataset with different control parameters. SHOW SPECTRA is however not
fully protected against changes in the data set between two invocations,
so this should only be used for consecutive commands.

.ti -4
2 UV__DATA
.ti +4
SHOW UV__DATA [Ant [Date]]
.ti +4
SHOW UV [Ant [Date]]

Displays the UV data.  Items to be displayed are controlled
by XTYPE and YTYPE variables.
Ant and Date are optional arguments indicating which Antenna
is to be highlighted, and for which date. Date is a sequential
number from 1 to the number of observing dates.

Structure uvshow% controls some additional options, such
as coloring of various dates, of data flagging, etc...

.ti -4
2 UV__FIT
.ti +4
SHOW UV__FIT [?]

Display the UV__FIT results. The display is controlled by the
UVFIT% structure. SHOW UV__FIT ? will list the current values
of these control parameters.

The number and order of the fitted functions to be plotted are
controlled by UVFIT%NF and UVFIT%ORDER

The number of parameters to be plotted as X and Y axes are controlled
by UVFIT%NX, UVFIT%NY. The kinds and ranges of those parameters are 
coded in the UVFIT%XTYPE and UVFIT%YTYPE strings (e.g. kind min max).
Possible kind are: CHANNEL VELO FREQ RMS RA DEC FLUX  WIDTH MAJOR MINOR
and ANGLE. A * instead of min and/or max implies the use of the default
minimum and maximum values of the plotted parameter.

Displayed channels are controlled by variables FIRST and LAST

.ti -4
2 Variables:
.ti +4
    SHOW Image  control variables

The following variables control the SHOW display. 
.nf 
  Display the header     DO__HEADER   [ YES ]   
  Display a color wedge  DO__WEDGE    [ YES ]     
  Plot bitmaps           DO__BIT      [ YES ]         
  Add the clean beam     DO__NICE     [ NO ]     
  Add the UV coverage    DO__COVERAGE [ NO ]  
  Add the dirty beam     DO__DIRTY    [ NO ]     
  Display the labels     DO__LABEL    [ YES ]     
  Use offset coordinates DO__RCOORD   [ NO ]   
  Display contour levels DO__CONTOUR  [ YES ] 
  grey-scale contours    DO__GREY     [ NO ] 
  Better marks           DO__MASK     [ NO ]           (Hide image behind channel marks)
 
  Channel range          RANGE       [ 0 0 ]         in 3rd axis unit, (0,0) ==> all
  Channel label          MARK        [ velocity ]    [VELOCITY, FREQUENCY or CHANNEL]
  Displayed field size   SIZE        [ 0 0 ]         in arcsec
  Field center           CENTER      [ 0 0 ]         offset in arcsec
  Cross size at center   CROSS       [ 2 ]           in arcsec, 0 ==> none 
  Fields layout          DO__FIELDS   [ NO ]          (for Mosaics)
 
  Colour Scale range     SCALE       [ 0 0 ]         (0,0) ==> all dynamic
  Contour levels         SPACING     [ 0] 
  Spacing type           SPACE_TYPE  [ AUTO]  [NATIVE, NONE, NOISE, AUTO, or USER]
.fi

.ti -4
2 DO__CONTOUR
.ti +4
  LOGICAL DO__CONTOUR

Draw (YES) or do not (NO) draw the contour level, which are controlled
by SPACING and SPACE__TYPE. This is provided for compatibility
with Mapping and Greg.

.ti -4
2 DO__COVERAGE
.ti +4
  LOGICAL DO__COVERAGE
  
For SHOW DIRTY or SHOW CLEAN, DO__COVERAGE indicates if in addition
to the channel maps, the UV coverage should be displayed in another
panel.

.ti -4
2 DO__DIRTY
.ti +4
  LOGICAL DO__DIRTY
  
For SHOW DIRTY or SHOW CLEAN, DO__DIRTY indicates if in addition
to the channel maps, the dirty beam should be displayed in another
panel.

.ti -4
2 DO__FIELDS
.ti +4
  LOGICAL DO__FIELDS

  Plot the 50 % contour levels of the individual pointings in a Mosaic
on top of the maps.

.ti -4
2 DO__GREY
.ti +4
  LOGICAL DO__GREY 

Do (YES) or do not (NO) use grey-scale contouring. Note that this
is independent of DO__CONTOUR.

.ti -4
2 DO__HEADER
.ti +4
  LOGICAL DO__HEADER
  
DO__HEADER indicates whether a panel displaying a summary information
about the displayed data is drawn or not.

.ti -4
2 DO__LABEL
.ti +4
  LOGICAL DO__LABEL
  
DO__LABEL indicates if the axes should be labelled.

.ti -4
2 DO__MASK
.ti +4
  LOGICAL DO__MASK
  
Hide part of the plot (contour or bitmaps, and even axis ticks) that lie
in the upper left corner of each panel to have a clean display of the
value specified by MARK.

.ti -4
2 DO__NICE
.ti +4
  LOGICAL DO__NICE
  
DO__NICE indicates if the angular resolution of the data ("beam") should
be displayed in the lower left corner of each panel.

.ti -4
2 DO__RCOORD
.ti +4
  LOGICAL DO__RCOORD
  
DO__RCOORD indicates if the axes should be in relative coordinates
(YES) or in Absolute coordinates (NO).

Note: Ultimately, IMAGER will react to the SET ANGLE_UNIT command
of GreG, by-passing the need to use this rather awkward control variable.

.ti -4
2 DO__WEDGE
.ti +4
  LOGICAL DO__WEDGE
  
DO__WEDGE indicates whether a color wedge of the bitmaps is drawn or not. 
It appears in the Header panel, so DO__WEDGE is active only if DO__HEADER
and DO__BIT are set.

.ti -4
2 CENTER
.ti +4
  REAL CENTER[2]

Specify the relative coordinates of the center of the displayed
region, in arcsec. 

Note: Ultimately, this should be in the ANGLE__UNIT defined
by Greg SET ANGLE__UNIT command.

.ti -4
2 CROSS
.ti +4
  REAL CROSS

Indicate the size (in arcsec) of a cross to be drawn at the map projection
center, as a reference marker for relative positions.

.ti -4
2 MARK
.ti +4
  CHARACTER*12 MARK
  
Specify the type of labelling for each panel. It can be 
VELOCITY, FREQUENCY or CHANNEL. Case is not significant.

.ti -4
2 RANGE
.ti +4
  REAL RANGE[2]
  
Specify the range (in 3rd axis unit) of displayed channels. This
provides a facility similar to FIRST and LAST variables, but in a
more user-oriented unit.

.ti -4
2 SCALE
.ti +4
  REAL SCALE[2]
  
SCALE indicates the Colour Scale Range, range of image units which are 
displayed in the color bitmap. SCALE = 0 implies an automatic evaluation 
of this range, based on the Min and Max of the data cube.

.ti -4
2 SIZE
.ti +4
  REAL SIZE[2]

Specify the displayed are size, in arcsec. 

Note: Ultimately, this should be in the ANGLE__UNIT defined
by Greg SET ANGLE__UNIT command.

.ti -4
2 SPACING
.ti +4
  REAL SPACING
  
SPACING indicates the step (and implicitely the contour levels) for
contouring and/or greyscale. The unit of the contour spacing is
controlled by  variable SPACE__TYPE.  SPACE__TYPE = NATIVE means
SPACING is in data cube units, while SPACE__TYPE = NOISE means 
the spacing is in number of sigmas.

A spacing of 0, or SPACE__TYPE = AUTO, implies an automatic guess 
of the contours from the Min and Max of the data cube. SPACE__TYPE = USER
indicates to keep the contour levels defined by the user by command 
[GREG2_\]LEVELS.

As a backward compatibility, a negative spacing is a convention to use 
the current contour levels, although using SPACE__TYPE = USER should be preferred.
 
.ti +4
2 SPACE__TYPE
.ti +4
  CHARACTER_*8 SPACE__TYPE

Define the type of spacing for the contour levels
.nf
  AUTO      Automatic guess of levels based on Min Max of data
  EXPO      Exponential spacing of contours (in data cube units).
  NATIVE    Variable SPACING indicate the contour spacing in data cube
              natural units.
  NOISE     Variable SPACING indicate the contour spacing in sigmas.
  USER      Keep the contour levels specified by command LEVELS 
.fi

.ti -4
1 STATISTIC
.ti +4
[CLEAN_\]STATISTIC [Clean|Dirty|Residu] [Plane] [/NOISE VarNoise] [/WHOLE]

Compute some basic statistics (min, max, mean, rms,...) on the specified
buffer (default: Clean) and plane (default: variable FIRST). The current
polygon or mask (see commands SUPPORT and MASK) is used to define the 
area on which the pixels are to be taken into account, except when 
option /WHOLE is present: the whole image is then considered.

Caution: Statistics on primary-beam corrected images (SKY) cannot be 
computed in this way, because the noise is non uniform.

.ti -4
2 /NOISE
.ti +4
[CLEAN_\]STATISTIC [Clean|Dirty|Residu] [Plane] /NOISE VarNoise [/WHOLE]

Return the rms noise in the specified VarNoise SIC real scalar variable.
The rms noise is also available in variable STAT__NOISE, and if the
image is the CLEAN image, in CLEAN_%NOISE as well for further convenience
and use in scripts.

.ti -4
2 /WHOLE
.ti +4
[CLEAN_\]STATISTIC [Clean|Dirty|Residu] [Plane] /WHOLE [/NOISE VarNoise] 

Compute the statistic on the whole image field.


.ti -4
1 SUPPORT
.ti +4
[CLEAN_\]SUPPORT [Polygon] [/CURSOR] [/MASK] [/PLOT] [/RESET] [/VARIABLE] 

Define and/or plot the support inside which to search for CLEAN 
components. The support can be defined through a mask (see /MASK option)
or a polygon, depending on the selected options.
The /PLOT option can then be used to plot it.

A polygon stored in a file, or in a Sic variable (/VARIABLE option),
can be loaded as the polygon support. 

See also the [ADVANCED_\]MASK command for a complementary way of 
defining supports, in particular 3-D supports.

.ti -4
2 /CURSOR
.ti +4
[CLEAN_\]SUPPORT /CURSOR

With option /CURSOR, SUPPORT calls the interactive cursor to define the polygon
summits.  Type any key to go to next summit, D to correct the last one and
type E to end the polygon definition. The last polygon side will then
appear. The polygon definition may be aborted by typing Q. For graphical
displays, you may use the mouse buttons for the commands.  The left mouse
button draws a vertex, the middle mouse button deletes the last vertex, and
the right mouse button ends the polygon definition.

The resulting support is available in the Sic structure SUPPORT:
.nf
  - SUPPORT%NXY  [Integer]  Number of summits
  - SUPPORT%X    [Double]   X coordinates
  - SUPPORT%Y    [Double]   Y coordinates
.fi

.ti -4
2 /MASK
.ti +4
[CLEAN_\]SUPPORT /MASK    or  [ADVANCED_\]MASK USE

Use the mask defined by READ MASK or by the MASK command as the clean 
support. This does not suppress the current polygon: it can be 
re-instated by a simple SUPPORT command with no argument.

The Mask can be a 3-D array: CLEAN will find out which mask 
plane must be used for each spectral channel. 

Caution: [CLEAN_\]READ MASK and [ADVANCED_\]MASK command do not perform an 
implicit SUPPORT /MASK command. Only the ADVANCED_\MASK USE command
does it explicitely.


.ti -4
2 /PLOT
.ti +4
[CLEAN_\]SUPPORT [Name] /PLOT

Plot the current (or specified) polygon, or plot the current mask
(if it is 2-D only).

For 3-D masks, use the VIEW MASK command instead.

.ti -4
2 /RESET
.ti +4
[CLEAN_\]SUPPORT /RESET

Reset any support to default. This deletes the current polygon support.
This does not unload any mask defined  by READ MASK. Such a mask can be 
re-instated by SUPPORT /MASK.

.ti -4
2 /THRESHOLD
.ti +4
[CLEAN_\]SUPPORT /THRESHOLD [Raw Smooth [Length [Guard]]

*** Obsolete - see  [ADVANCED_\]MASK THRESHOLD instead ***
 
.ti -4
2 /VARIABLE
.ti +4
[CLEAN_\]SUPPORT VarName /VARIABLE

Load the support from the Sic variable VarName. VarName can be an 
array of the form:
.br
         VarName[NXY,2]  Real or Double

or a structure of the form (i.e. same as output):
.br
         VarName%NXY             Integer or Long
         VarName%X[VarName%NXY]  Real or Double
         VarName%Y[VarName%NXY]  Real or Double


.ti -4
1 UV__BASELINE
.ti +4
[CLEAN_\]UV__BASELINE [Degree] [/CHANNELS Channel__List]
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]
  [/FILE FileIn [FileOut]]

Subtract a continuum from a line UV data set, by fitting  a baseline
for each visibility.  The channels to be ignored in this process
(i.e. the ones including the line emission) can be specified 
either by the /FREQUENCY or /VELOCITY options
in combination with the /WIDTH option, or by a channel list with
/CHANNELS or a range (of channels, frequencies or velocities) with
/RANGE.

By default, the command works on the current UV data, unless the
option /FILE is specified.

With no options (except possibly /FILE), the command behaves as
UV__BASELINE /CHANNELS Preview_%Channels. See UV__PREVIEW for details.

.ti -4
2 /CHANNELS
.ti +4
[CLEAN_\]UV__BASELINE /CHANNELS Channel__List

Channel__List must be a 1-D SIC variable containing the list of channels
to filter out.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__BASELINE [Degree] [/CHANNELS Channel__List]
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]
  /FILE FileIn [FileOut]
  
Use the UV data in the file FileIn, and write the continuum-free
visibilities in the file FileOut.  If FileOut is not specified,
"-line" is appended to the name indicated by FileIn.  

.ti -4
2 /FREQUENCY
.ti +4
[CLEAN_\]UV__BASELINE /FREQUENCY F1 [... [Fn]] [/WIDTH Width [TYPE]]

Specify around which frequencies the line emission should be filtered.
Frequencies F1 to Fn must be in MHz. The full width of the filtering
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

Tip: it can be convenient to have a list of SIC variables containing
the frequencies of the most intense spectral lines, e.g.
.ti +8
HCO10 = 89188.52
.br to be used as argument to the /FREQUENCY option.

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__BASELINE /FREQUENCY F1 [... [Fn]] /RANGE Min Max [TYPE]

Indicate that channels between the First and Last
defined by Min Max and Type contain line emission and should
be ignored in the baseline fitting.  Type can be
CHANNEL, VELOCITY or FREQUENCY.

For type CHANNEL, Min and Max indicate offsets from
Channel 1 and Channel Nchan (the number of channels
in the data set). Thus Max can be negative: it then
indicates Last = Nchan-Max. Also Min=0 and Max=0 implies
loading all the channels.

.ti -4
2 /VELOCITY
.ti +4
[CLEAN_\]UV__BASELINE /VELOCITY V1 [... [Vn]] [/WIDTH Width [TYPE]]

Specify around which velocities the line emission should be filtered.
Velocities V1 to Vn must be in km/s. The full width of the filtering
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

.ti -4
2 /WIDTH
.ti +4
[CLEAN_\]UV__BASELINE /FREQUENCY F1 [... [Fn]] /WIDTH Width [TYPE]

Specify the full width of the
window around every frequency given in the /FREQUENCY option.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.
The default width is the current channel width.

.ti -4
1 UV__CHECK
.ti +4
[CLEAN_\]UV__CHECK  Beams|Nulls

  Check UV data for weight consistency.

  BEAMS
.br
  List which channel range can be processed with the same synthesized beam.

  NULLS
.br
  Check if there are null visibilities with non-zero weights, and flag
  them if found.


.ti -4
1 UV__COMPRESS
.ti +4
[CLEAN_\]UV__COMPRESS Nc  [/FILE FileIn FileOut]

Resample the UV data by averaging NC adjacent channels. 

With no option, the current UV table obtained by READ UV is resampled.
All other UV commands except UV__RESAMPLE work on the "Resampled" UV table.
The "Resampled" UV table is a simple copy of the original one after a READ UV
command, or after a UV__RESAMPLE or UV__COMPRESS commands without arguments.

With the /FILE option, the UV data is read from file FileIn and the resampled
output is written in file FileOut.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__COMPRESS Nc  /FILE FileIn FileOut
  
Use the UV data in the file FileIn, and write the data after
averaging by NC adjacent channels in the file FileOut.  


.ti -4
1 UV__CONTINUUM
.ti +4
[CLEAN_\]UV__CONTINUUM Naver [First Last] [/INDEX Value [Frequency]]

Transform the (presumably spectral line) UV data set loaded by READ UV
into a "continuum" data set.

The transformation selects line channels
from First to Last, average them by groups of Naver contiguous channels,
and concatenate the resulting visibilities into a "continuum" UV table.

For each of the (First-Last+1)/Naver channels, and for all visibilities,
the U and V coordinates are rescaled to the mean observing frequency,
and the resulting (single-channel) visibilities are concatenated into
the "continuum" UV data set. The continuum dataset becomes the current
UV data. Flagged channels are ignored: this allows to mask channels
containing spectral lines (see UV__FILTER).

Default for First and Last is 0 0, meaning all channels are selected.
Negative value for Last indicate an offset from end channel (i.e. -20 means
ignore the last 20 channels).

.ti -4 
2 /INDEX
.ti +4
[CLEAN_\]UV__CONTINUUM Naver [First Last] /INDEX Value [Frequency]

Specify which spectral index to be used when scaling the visibilities
as a function of frequency. 

TO BE IMPLEMENTED:  Frequency, if specified, will be used
as a reference frequency instead of the mean observing frequency.

.ti -4
1 UV__EXTRACT 
.ti +4
[CLEAN_\]UV__EXTRACT /RANGE Min Max [TYPE]  [/FILE FileIn [FileOut]]

  Extract a subset of all available channels. The command
works on the current UV buffer, unless the /FILE option is
specified

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__EXTRACT /RANGE Min Max [TYPE] /FILE FileIn [FileOut]
  
Extract the specified range from the UV data in the file FileIn, and 
write the resulting visibilities in the file FileOut. If FileOut is not 
specified, "-ext" is appended to the name indicated by FileIn.  

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__EXTRACT /RANGE Min Max [TYPE]  [/FILE FileIn [FileOut]]

Indicate that channels between the First and Last
defined by Min Max and Type contain line emission and should
be filtered out.  Type can be
CHANNEL, VELOCITY or FREQUENCY.

For type CHANNEL, Min and Max indicate offsets from
Channel 1 and Channel Nchan (the number of channels
in the data set). Thus Max can be negative: it then
indicates Last = Nchan-Max. Also Min=0 and Max=0 implies
all the channels.

.ti -4
1 UV__FIELDS
.ti +4
[CLEAN_\]UV__FIELDS UV_FIELDS RaVar DecVar [Unit] 
    [/CENTER Ra Dec] [/FILE File]

    Replace fields ID by Fields offsets in a Mosaic UV Table.
This can only work for a Mosaic UV table with Fields offsets,
or Phase center offsets. It cannot operate on a UV table with
Pointing center offsets.

For files imported from UVFITS, the Fields offsets are found in 
the AIPS SU Table which is not decoded by the FITS command, 
but only through the DEFINE FITS command.

The UV__FIELDS command allows to convert the Field IDs column of the UV table
into Phase Offsets columns, and insert the proper coordinates.
Unit specifies the unit of the RaVar and DecVar variables. It
can be DEGREE, MINUTE, SECONDS, RADIAN or ABSOLUTE. 

If ABSOLUTE, RaVar and DecVar are assumed to character variable
arrays handling the Right Ascension
and Declinations of the fields expressed in sexagesimal format.

The typical use is after a DEFINE FITS A File.uvfits command, which gives
the (Ra,Dec) positions of the field centers in Degrees
in A%aips__su%col%raepo and A%aips__su%col%decepo variables:
.nf

    fits File.uvfits to File.uvt
    define fits A File.uvfits
    define double ra dec
    define char*16 cra cdec
    let cra ra /sexag d H
    let cdec dec /sexag d d
    compute ra mean a%aips__su%col%raepo
    compute dec mean a%aips__su%col%decepo
    !
    uv__fields a%aips__su%col%raepo a%aips__su%col%decepo DEGREE -
      /FILE File.uvt /CENTER 'CRa' 'CDec'
    !
.fi
This command is used in the fits__to__uvt.ima script. Note that
a proper use also requires to set the reference coordinate
to Ra and Dec consistently in the UV Table.

.ti -4
2 /CENTER
.ti +4
[CLEAN_\]UV__FIELDS UV_FIELDS RaVar DecVar [Unit] 
    /CENTER Ra Dec [/FILE File]

Specify the reference center (Pointing and Phase) of the Mosaic
UV table with Fields ID.  In this case, RaVar and DecVar are
true Ra and Dec (angles in the specified Unit), not Offsets.
The Offsets are computed from the projection information in
the UV table. 

Ra and Dec should be in usual sexagesimal notation.

Without /CENTER, RaVar and DecVar are Offsets from the Phase and
Pointing center of the Mosaic, as given in the UV data header, unless
Unit is ABSOLUTE. 

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__FIELDS UV_FIELDS RaVar DecVar [Unit] 
    [/CENTER Ra Dec] /FILE File

  Modify the specified File.uvt handling the UV table, instead
of the current UV data in IMAGER.

.ti -4
1 UV__FILTER
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] [/CHANNELS Channel__List] 
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]
  [/FILE FileIn [FileOut]]

"Filter" line emission, by flagging the corresponding channels. The channels
can be specified either by the /FREQUENCY or /VELOCITY options
in combination with the /WIDTH option, or by a channel list with
/CHANNELS or a range (of channels, frequencies or velocities) with
/RANGE.

By default, channels to be filtered are flagged (weights becoming negative).
Option /ZERO can be used to erase them: weights and visibilities are
set to zero, see HELP UV__FILTER /ZERO.

The command works on the current UV data, unless the option /FILE is specified.

With no options (except possibly /FILE and /ZERO), the command behaves as
UV__FILTER /CHANNELS Preview_%Channels. See UV__PREVIEW for details.

.ti -4
2 /CHANNELS
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] /CHANNELS Channel__List

Channel__List must be a 1-D SIC variable containing the list of channels
to filter out.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] [/CHANNELS Channel__List]
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]
  /FILE FileIn [FileOut]
  
Use the UV data in the file FileIn, and write the line-free
visibilities in the file FileOut.  If FileOut is not specified,
"-cont" is appended to the name indicated by FileIn.  

.ti -4
2 /FREQUENCY
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] /FREQUENCY F1 [... [Fn]] [/WIDTH Width]

Specify around which frequencies the line emission should be filtered.
Frequencies F1 to Fn must be in MHz. The full width of the filtering
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

Tip: it can be convenient to have a list of SIC variables containing
the frequencies of the most intense spectral lines, e.g.
.ti +8
HCO10 = 89188.52
.br to be used as argument to the /FREQUENCY option.

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] /RANGE Min Max [TYPE]

Indicate that channels between the First and Last
defined by Min Max and Type contain line emission and should
be filtered out.  Type can be
CHANNEL, VELOCITY or FREQUENCY.

For type CHANNEL, Min and Max indicate offsets from
Channel 1 and Channel Nchan (the number of channels
in the data set). Thus Max can be negative: it then
indicates Last = Nchan-Max. Also Min=0 and Max=0 implies
loading all the channels.

.ti -4
2 /VELOCITY
.ti +4
[CLEAN_\]UV__FILTER /VELOCITY V1 [... [Vn]] [/WIDTH Width [TYPE]]

Specify around which velocities the line emission should be filtered.
Velocities V1 to Vn must be in km/s. The full width of the filtering
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

.ti -4
2 /WIDTH
.ti +4
[CLEAN_\]UV__FILTER [/ZERO] /FREQUENCY F1 [... [Fn]] /WIDTH Width [TYPE]

.ti +4
[CLEAN_\]UV__FILTER [/ZERO] /VELOCITY V1 [... [Vn]] /WIDTH Width [TYPE]

Specify the full width of the filtering
window around every frequency given in the /FREQUENCY option or
any velocity given in the /VELOCITY option.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

.ti -4
2 /ZERO
.ti +4
[CLEAN_\]UV__FILTER /ZERO [/CHANNELS Channel__List]
  [/FREQUENCY F1 [... [Fn]] [/VELOCITY V1 [... [Vn]]
  [/RANGE Min Max [TYPE]] [/WIDTH Width [TYPE]]

Erase filtered channels (set weight and visibilities to zero) rather than
simply flagging them (weight set to negative value). This can be more
convenient for further display, but is not reversible.

By default, channels to be filtered are flagged (weights becoming 
negative, and data can be unflagged by UV__FLAG).  Flagged channels are 
ignored in the averaging process, such as UV__RESAMPLE or UV__CONT. 
However, as UV__MAP (in general) uses only one channel to define the 
weights for all others, these flagged channels will nevertheless appear 
in the imaged data cube.

See UV__CHECK for information about handling flagged channels and
different beams in a single UV table.


.ti -4
1 UV__FLAG
.ti +4
[CLEAN_\]UV__FLAG [/RESET]

Display UV data and calls the cursor to interactively select a region where
UV data will be flagged (sign of weight is reversed). The /RESET option is
used to unflag the data. UV data flagged using command UV__FLAG can be saved on file
with command WRITE UV File. Detailed information about the display control
of the UV data may be found in the UV__SHOW help.

The user can control the algorithm through variables. Values of those
variables can be checked using "EXAMINE VARIABLE". New values can be given
using "LET VARIABLE value".

.nf
DATE__START  [    ] The date of the first data to be flagged
UT__START    [    ] The UT time of the first data to be flagged
DATE__END    [    ] The date of the last data to be flagged
UT__END      [    ] The time of the last data to be flagged
BASELINE    [    ] Baseline to flagged
CHANNEL     [    ] Channel range to be flagged/unflagged
FLAG        [    ] Flag or unflag the specified time range
.fi

Subsequent mapping with UV__MAP will ignore flagged data. However, for
multi-channel imaging, the weight column is (by default) taken from
one channel, so that channel-based flagging will not be recognized in the
default mode, but only in the "One Beam per Channel" mode.

.ti -4
2 DATE__START

The date (DD-MMM-YYYY) of the first data to be flagged.

.ti -4
2 UT__START

The UT time (hh:mm:ss.ss) of the first data to be flagged.

.ti -4
2 DATE__END

The date (DD-MMM-YYYY) of the last data to be flagged.

.ti -4
2 UT__END

The time (hh:mm:ss.ss) of the last data to be flagged.

.ti -4
2 BASELINE

Baseline (ALL, 12, 13, 23, ...) to flagged.

.ti -4
2 FLAG

Flag (T) or unflag (F) the specified time range.

.ti -4
2 CHANNEL

Channel range to be flagged/unflagged.

.ti -4
1 UV__MAP
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue] 
[/FIELDS FieldList] [/TRUNCATE Percent] [/RANGE Min Max Type]
[/CONT [Naver]] [/INDEX Alpha]

Compute a dirty map and beam from a UV data. UV data must have been loaded
from a UV table by command "READ UV File". UV__MAP processes
single fields as well as Mosaics.

The user can control the algorithm through SIC variables. New values 
can be given using "LET VARIABLE value". For ease of use, and whenever 
it is possible, a sensible value of each parameter will automatically 
be computed from the context if the value of the corresponding variable 
is set to its default value, i.e. zero value and empty string. A few 
variables are initialized to "reasonable" values.

The arguments define the Map center and orientation (Projection system).
Unit can be any of DEGREE, MINUTE, SECOND and RADIAN, or ABSOLUTE.
In the latter case, CenterX should be the Right Ascension and CenterY
the Declination in sexagesimal notation. Otherwise, they are offsets
from the current projection center in the specified Unit. AngleValue
is the rotation of the projection (counted East from North as usual).

If no argument is given, UV__MAP uses the variable MAP__CENTER to
derive the projection system. If it is empty, it does not change it.

.ti +4
[CLEAN_\]UV__MAP ?
.br 
Will list all MAP__* variables controlling the UV__MAP parameters

.ti -4 
2 Mosaics
.ti +4
[CLEAN_\]UV__MAP [[CenterX CenterY Unit] [ANGLE AngleValue]
  /FIELDS FieldList [/TRUNCATE Percent]

The UV data can be a Mosaic UV table. In this case, UV__MAP will image
the Mosaic, using appropriate primary beam size and truncation level.

By default, the primary beam size is taken from the telescope parameters, either as
found in the telescope section of the UV table and the observing frequency
(e.g. for ALMA it uses 1.13 Lambda/D). If absent, the telescope section
information can be added by command SPECIFY TELESCOPE.  

The truncation level for individual pointings is taken from variable 
MAP__TRUNCATE or from the /TRUNCATE option argument. It should be 0 for 
high dynamic range. Non zero values may be used with caution in case of 
large pointing errors.

.ti -4
2 /CONT
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue]
/CONT [Naver] [/INDEX Alpha] [/RANGE Min Max Type]

Produce a Continuum image (from all channels, or those
selected  by the specified Velocity, Frequency or Channel range (depending
on Type) between Min Max when the option /RANGE is present), using
a Multi-Frequency Synthesis, where (u,v) coordinates are scaled
with Frequencies to produce an optimal beam. Naver is the number
of initial channels that will share the same (u,v) coordinates. If
not present, it is computed from MAP__FIELD and MAP__CELL to
limit bandwidth smearing.

In essence, UV__MAP /CONT behaves as the combination of
UV__CONTINUUM  followed by UV__MAP, but the pseudo-continuum
UV Table created by UV__CONTINUUM is not kept by UV__MAP /CONT.

A spectral index can be specified using option /INDEX.

.ti -4
2 /FIELDS
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue]
  /FIELDS FieldList [/TRUNCATE Percent]

For a Mosaic, only image the fields specified in a 1-D Integer variable
FieldList, or in the explicit list given as argument to the /FIELDS
option.  SHOW FIELDS will highlight the list of fields selected
by this command.

.ti -4
2 /INDEX
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue]
/CONT [Naver] /INDEX Alpha [/RANGE Min Max Type]

Specify the spectral index to be used for Continuum imaging
using a Multi-Frequency Synthesis method. This option is only
valid with the /CONT option.

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue]
  /RANGE Min Max Type [/FIELDS FieldList] [/TRUNCATE Percent] 
  [/CONT [Naver]] [/INDEX Alpha]

Only image the specified Velocity, Frequency or Channel range (depending
on Type) between Min Max. This is a more convenient replacement of the
deprecated MCOL variable.

.ti -4 
2 /TRUNCATE
.ti +4
[CLEAN_\]UV__MAP [CenterX CenterY Unit] [ANGLE AngleValue] 
  /FIELDS FieldList /TRUNCATE Percent

For a Mosaic, truncate the individual pointings to the specified level
(in percent). The default is to use MAP__TRUNCATE.

.ti -4 
2 Variables:
.ti +4
        [CLEAN\]UV__MAP ?
.br
    Will list all MAP__* variables controlling the UV__MAP parameters.
.br
.so imager-help-clean-uvmap-list.nroff

See HELP UV__MAP Old__names:  for deprecated variable names.

.so imager-help-clean-uvmap-desc.nroff

.ti -4
1 UV__RESAMPLE
.ti +4
[CLEAN_\]UV__RESAMPLE [Nc Ref Val Inc] [/FILE FileIn FileOut]

With no option, resample the UV data loaded by READ UV on a different 
velocity scale.  All other UV commands except UV__COMPRESS work on the 
"Resampled" UV table. The output spectral sampling is defined by
.nf
     Nc   new number of channels
     Ref  New reference pixel
     Val  New velocity at reference pixel
     Inc  Velocity increment
.fi
Any argument can be set to * for an automatic determination based on
the values of the other arguments. The automatic determination of
NC preserves the velocity coverage.

The "Resampled" UV table is a simple copy of the original one after a READ UV
command, or after a UV__RESAMPLE or UV__COMPRESS command without arguments.

With the /FILE option, the internal buffers are not used: the UV data 
is read from file FileIn and the resampled output is written in file 
FileOut.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__RESAMPLE Nc Ref Val Inc /FILE FileIn FileOut
  
Use the UV data in the file FileIn, and write the spectrally resampled
UV data in the file FileOut.  

.ti -4
1 UV__RESIDUAL
.ti +4
[CLEAN_\]UV__RESIDUAL [Arg1 ... ArgN]

  This command subtract Clean components OR fit results from the last UV__FIT
command, depending whether CLEAN (or its specialized versions HOGBOM, CLARK,
etc...) or UV__FIT was done last.
The residual UV data can be written by WRITE UV, and imaged by UV__MAP.

For the Clean component the syntax is
.ti +4
[CLEAN_\]UV__RESIDUAL [Niter]
.br
which subtracts the Niter first (default all) Clean Components from the UV data.

For the UV__FIT results, Clean component the syntax is
.ti +4
[CLEAN_\]UV__RESIDUAL [F1 .. Fn]
.br
which subtracts the F1 to Fn fitted functions (default all) from the UV data.

.ti -4
1 UV__RESTORE
.ti +4
[CLEAN_\]UV__RESTORE [/COPY] [/SELF] [/SLOw]

Create a Clean image from the current UV data set and the Clean Component list.
The Clean Components are subtracted from the UV data set, and these residuals
are gridded and Fourier transformed to compute the Residual image. This
Residual image is added to the Gaussian beam convolved image of the sum of
Clean components. The results are similar to those of MX, since only the
residual are aliased.

This command can be used after HOGBOM, CLARK, MULTI, SDI or MX (although
it is pointless after MX), but not MRC which has no notion of Clean
Components.

.ti -4
1 UV__REWEIGHT
.ti +4
[CLEAN_\]UV__REWEIGHT MODE [Args...] [/RANGE Min Max Type] 
  [/FLAG Threshold]

Compute and/or Apply a scale factor to the weights of the current
UV data. Can be used to patch e.g. JVLA data files which may
have only relative weights, not absolute values indicating the
noise.

MODE can be APPLY, DO or ESTIMATE.

.ti -4
2 APPLY
.ti +4
[CLEAN_\]UV__REWEIGHT APPLY Factor

Apply the specified scale Factor to the weights. Factor can be *
to used the last derived scale factor from command UV__REWEIGHT ESTIMATE.
This factor is set to 1.0 by command UV__REWEIGHT APPLY, so that
repetitive usage of the APPLY * mode no longer affect the data.

.ti -4
2 DO
.ti +4
[CLEAN_\]UV__REWEIGHT DO [Tolerance [Printout]] [/RANGE Min Max Type] 
  [/FLAG Threshold]

Derive the scale factor from the noise statistics over the channels,
and use it to rescale the weights.
The noise statistic is derived from the real and imaginary parts 
separately, taking mean value,  or the minimum of the twos when the
mean/min ratio is smaller than specified Tolerance (default is 1.2).

The /FLAG option indicates whether data with highly deviating weights
should be flagged. UV__REWEIGHT DO combines the two actions of 
UV__REWEIGHT ESTIMATE and UV__REWEIGHT APPLY, but with a 
control over these outliers (that are not identified by APPLY).

Printout is a number indicating to print some correction factors
every Printout visibility (no print if 0, the default).

.ti -4
2 ESTIMATE
.ti +4
[CLEAN_\]UV__REWEIGHT ESTIMATE [Tolerance [Printout]] [/RANGE Min Max Type] 

Derive the scale factor from the noise statistics over the channels.
The noise statistic is derived from the real and imaginary parts 
separately, taking mean value,  or the minimum of the twos when the
mean/min ratio is smaller than specified Tolerance (default is 1.2).

Printout is a number indicating to print some correction factors
every Printout visibility (no print if 0, the default).

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__REWEIGHT DO|ESTIMATE [Tolerance [Printout]] /RANGE Min Max Type
  [/FLAG Threshold]
  
Specify the spectral range defining the channels to use in the
noise estimates.

/RANGE can not be used with keyword APPLY.

.ti -4
2 /FLAG
.ti +4
[CLEAN_\]UV__REWEIGHT DO [Tolerance [Printout]] /FLAG Threshold
  [/RANGE Min Max Type] 
  
The /FLAG option indicates whether data with highly deviating weights
should be flagged. UV__REWEIGHT DO combines the two actions of 
UV__REWEIGHT ESTIMATE and UV__REWEIGHT APPLY, but with a 
control over these outliers (that are not identified by APPLY).

Default Threshold is 3, i.e. data are considered as outliers
if their re-scale factor is more than 3 times above (or below)
the median value.  This is adequate to spot bad data.

/FLAG is only valid for keyword DO.

.ti -4
1 UV__SHIFT
.ti +4
[CLEAN_\]UV__SHIFT  [CenterX CenterY UNIT [Angle]]

Shift the current UV table (single field or mosaic) to a common phase 
center. If no argument is specified, the string contained in 
MAP__CENTER is used instead.

Although UV__MAP also provides a direct possibility to re-center the 
image on a specified projection (phase) center, the modified 
visibilities cannot be saved on file. It is sometimes required to do 
this for specific use. UV__SHIFT provides this possibility, and the 
shifted UV table can be written using command WRITE UV.

UV__DEPROJECT includes the UV__SHIFT capabilities, but
also has additional functions.

.ti -4
1 UV__SORT
.ti +4
[CLEAN_\]UV__SORT Key   [/FILE FileIn FileOut]

Sort and transpose the UV data set. The command has two different
behaviours, depending on the /FILE option.

Without /FILE, the command works on the current UV data, loaded by 
command READ UV File, and creates a transposed, ordered copy of the UV 
data. The Key can be TIME for Time-Baseline ordering, BASE for 
Baseline-Time ordering. The sorted UV data is then available in 
variable UVS for further plotting. This is only done in an internal 
buffer. WRITE UV will **NOT** write this sorted, transposed, buffer.

With the /FILE option, the command creates in FileOut a sorted 
(but not transposed) copy of the UV data file specified in FileIn.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__SORT Key /FILE FileIn FileOut

Creates in Fileout a sorted copy of the UV data found in FileIn.
Key can be The Key can be TIME for Time-Baseline ordering, BASE for 
Baseline-Time ordering, or FIELDS for Mosaics. TIME ordering
is required for efficient operation of the time averaging 
command UV__TIME.

The command compares the file size to the available RAM memory
(more specifically the size indicated by the logical name SPACE__GILDAS) 
to decide whether the operation can be done in Memory only or needs 
intermediate files to perform the sorting.

.ti -4
1 UV__SPLIT
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  [/CHANNELS Channel__List] 
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]

"Split" the UV table found in file FileIn into a Continuum-free one 
(FileLine) and a Line-free continuum one (FileCont), using the ranges
specified by one of the other options to indicate where the line
emission is (see UV__BASELINE and UV__FILTER for details). 
The channels can be specified either by the /FREQUENCY or /VELOCITY 
options in combination with the /WIDTH option, or by a channel list 
with /CHANNELS or a range (of channels, frequencies or velocities) with 
/RANGE.

Degree is the baseline fit degree (0 or at most 1).
Compress is the number of line channels averaged together while producing
the pure continuum (Line-free) visibilities. 

The command only works with files: option /FILE is mandatory.

With only /FILE as option, the command behaves as
UV__SPLIT /FILE FileIn [FileLine [FileCont]] /CHANNELS Preview_%Channels. 
See UV__PREVIEW for details about Preview%Channels.

.ti -4
2 /CHANNELS
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  /CHANNELS Channel__List

Channel__List must be a 1-D SIC variable containing the list of channels
where line emission is assumed to be.

.ti -4
2 /FILE
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  [/FREQUENCY List Of Frequencies] [/RANGE Min Max [TYPE]]
  [/VELOCITY List of Velocities] [/WIDTH Width [TYPE]]
  /FILE FileIn [FileOut]
  
Use the UV data in the file FileIn, and write the continuum-free
visibilities in the file FileLine, and the line-free visibilities in
FileCont. If not specified, FileLine (resp FileCont) is derived
from FileIn by appending "-line" (resp "-cont") to the filename.

.ti -4
2 /FREQUENCY
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
    /FREQUENCY F1 [... [Fn]] [/WIDTH Width]

Specify around which frequencies the line emission should be found.
Frequencies F1 to Fn must be in MHz. The full width of the 
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

Tip: it can be convenient to have a list of SIC variables containing
the frequencies of the most intense spectral lines, e.g.
.ti +8
HCO10 = 89188.52
.br to be used as argument to the /FREQUENCY option.

.ti -4
2 /RANGE
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
    /RANGE Min Max [TYPE]

Indicate that channels between the First and Last
defined by Min Max and Type contain line emission.
Type can be
CHANNEL, VELOCITY or FREQUENCY.

For type CHANNEL, Min and Max indicate offsets from
Channel 1 and Channel Nchan (the number of channels
in the data set). Thus Max can be negative: it then
indicates Last = Nchan-Max. Also Min=0 and Max=0 implies
loading all the channels.

.ti -4
2 /VELOCITY
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  /VELOCITY V1 [... [Vn]] [/WIDTH Width [TYPE]]

Specify around which velocities the line emission should be found. 
Velocities V1 to Vn must be in km/s. The full width of the 
window around every frequency can be set by option /WIDTH.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.

.ti -4
2 /WIDTH
.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  /FREQUENCY F1 [... [Fn]] /WIDTH Width [TYPE]

.ti +4
[CLEAN_\]UV__SPLIT [Degree [Compress]] /FILE FileIn [FileLine [FileCont]]
  /VELOCITY V1 [... [Vn]] /WIDTH Width [TYPE]

Specify the full width of the window around every frequency given in 
the /FREQUENCY option or any velocity given in the /VELOCITY option.
The optional argument TYPE indicates the type of width: FREQUENCY
(in MHz), VELOCITY (in km/s) or CHANNEL (no unit), the default
being FREQUENCY.  The default width is the current channel width.


.ti -4
1 UV__STAT
.ti +4
[CLEAN_\]UV__STAT Mode [Step Start]

UV__STAT allows the astronomer to select the best weighting
and imaging parameters according to its personal trade off between
angular resolution, sensitivity and field of view.

Argument Mode describes the action. Default is ALL, equivalent to 
HEADER+ADVISE. See HELP UV__STAT Argument for details.

.ti -4
2 Casa
.ti +4

CASA and GILDAS handle the weighting scheme slightly differently and
with different conventions for the Robust parameter values.

CASA uses only Briggs weighting, while IMAGER offers the Briggs
weighting scheme (obtained for MAP__ROBUST < 0) and a different,
more progressive, weighting (obtained for MAP__ROBUST > 0).

For MAP__ROBUST < 0, the corresponding CASA Briggs value can be obtained
by adding 2. 

In addition, CASA apparently uses a default value for the size of
the UV cell in Briggs weighting which is about the dish diameter(*).
If MAP__UVCELL is 0, IMAGER will use the same default value.
Otherwise, IMAGER will use the specified user input.

(*) This default value quoted before is valid for a single field. 
However, the documentation is unclear in this respect and suggests that
the UV cell size depends on the imaged field size. This would 
be strange, though. What happens for mosaics is even less clear.


.ti -4 
2 Arguments:
.ti +4
[CLEAN_\]UV__STAT Mode [Step Start]

Argument Mode describes the action. Possible values are 
.nf
ADVISE     Suggest values for Map size, Map field and Pixel size
ALL        As HEADER + ADVISE
BEAM       Evaluate (and optionally display) the synthesized beam
BRIGGS     Estimate beam size as function of Briggs robust parameter
CELL       Estimate beam size as function of UV cell size
DEFAULT    Reset UV__MAP parameters to Default values
HEADER     Display detailed UV header
RESET      Reset UV__MAP parameters to previous Values
SETUP      Take suggested values for Map size, Map field and Pixel size
TAPER      Estimate beam size as function of UV Taper 
WEIGHT     Estimate beam size as function of Gildas robust parameter
.fi

The default value is ALL, which makes the same action as HEADER + ADVISE
combined.

.ti -4
2 ADVISE
.ti +4

[CLEAN_\]UV__STAT ADVISE

  Display the recommended image and pixel sizes, independently of the 
current values of MAP__FIELD, MAP__SIZE and MAP__CELL. 

.ti -4
2 ALL
.ti +4

[CLEAN_\]UV__STAT ALL

  Display the UV header and a few more associated values, like the
recommended image and pixel sizes. Equivalent to HEADER + ADVISE 

.ti -4
2 BEAM
.ti +4

[CLEAN_\]UV__STAT BEAM [Show]

  Evaluate the expected synthesized beam size and orientation, based
on current imaging parameters MAP__UVCELL, MAP__ROBUST, MAP__UVTAPER.

  If argument Show is present, the synthesized beam is also displayed.
A fast gridding is used for this command to minimize computing time, 
so the actual synthesized beam produced by UV__MAP will be (very 
slightly) different. This does not significantly affect the beam size.

.ti -4
2 BRIGGS
.ti +4

[CLEAN_\]UV__STAT BRIGGS  [Step Start]


Beam sizes and noise level (in flux and brightness) will be
computed for 9 different "robust" weighting parameters using
the Briggs method.  The Briggs parameters range from
-4 (nearly uniform weighting) to 0 (natural weighting) (values
are shifted by -2 compared to the Briggs parameters in CASA).
The taper is taken from variable UV__TAPER.
The UV cell size is specified by MAP__UVCELL in m.

See HELP UV__STAT Casa for details about Briggs parameter vs Robust
parameter.

.ti -4
2 CELL
.ti +4
[CLEAN_\]UV__STAT CELL [Step Start]

Predict the synthesized beam, expected noise level, and recommended pixel
size for different values of  the uv cell size for current robust
weighting and taper parameters. 

.ti -4
2 DEFAULT
.ti +4
[CLEAN_\]UV__STAT DEFAULT

Reset MAP__SIZE, MAP__CELL, MAP__FIELD and MAP__UVCELL to their Default 
values (all 0). Robust parameter and Tapers are not changed. Command
UV__STAT RESET does a slightly different job.

.ti -4
2 HEADER
.ti +4
[CLEAN_\]UV__STAT HEADER

Display a brief summary of the UV data: number of antennas,
observing dates, baseline ranges,  spectroscopic information.

.ti -4
2 RESET
.ti +4
[CLEAN_\]UV__STAT RESET 

  Reset MAP__SIZE, MAP__FIELD and MAP__CELL to their previous values
after a UV__STAT SETUP. This is different from the UV__STAT DEFAULT
command.

.ti -4
2 SETUP
.ti +4
[CLEAN_\]UV__STAT SETUP

Compute the recommended values for the imaging: image size,
pixel size, field of view, largest angular scale, etc...,
and set the corresponding MAP__variables (MAP__SIZE, MAP__FIELD
and MAP__CELL) to these values if they were not previously
specified.

.ti -4
2 TAPER
.ti +4
[CLEAN_\]UV__STAT TAPER [Step Start]

For TAPER, beam sizes and noise level (in flux and brightness) will be
computed for 9 different tapers (from Start to Start*Step^9).
Default value for Step is sqrt(2), Default value for Start
is 50 m. Weighting mode, UV cell size and "robust" parameter
are taken from variable MAP__UVCELL and MAP__ROBUST (i.e. one can combine
Robust weighting and Tapering).

.ti -4
2 WEIGHT
.ti +4
[CLEAN_\]UV__STAT WEIGHT [Step Start]

For WEIGHT, beam sizes and noise level (in flux and brightness) will be
computed for 9 different "robust" weighting parameters (from Start to
Start*Step^9). Default value for Step is sqrt(10), and default value
for Start is derived to center the "robust" parameter values around 1.
UV cell size is taken from variable MAP__UVCELL, and Taper is taken
from variable UV__TAPER.

.ti -4
1 UV__TIME
.ti +4
[CLEAN]UV__TIME [Time] [/Weight Wcol]

Average in time the current UV data set to reduce the number of visibilities.
Time must be in seconds. If not specified, an automatic guess
is performed based on antenna size and baseline lengths.

.ti -4
2 /WEIGHT
.ti +4
[CLEAN]UV__TIME Time /WEIGHT Wcol

Select the weight column. Default is 0.

.ti -4
1 UV__TRUNCATE
.ti +4
[CLEAN]UV__TRUNCATE Max [Min]

Truncate the UV data, by removing baselines out of
the specified range Min (default 0) and Max (in meter).

.ti -4
1 VIEW
.ti +4
[CLEAN_\]VIEW Argument [FirstPlane [LastPlane]] [/NOPAUSE]

where
.br Argument
.ti +4 
is the the name of an internal buffer to be plotted (BEAM, CCT, CLEAN, DIRTY,
FIELDS, MASK, etc.. ), or any Sic Image variable, or a file name.

.ti +4
[CLEAN_\]VIEW ?

will list the names of recognized keywords. If Variable
is not one of the recognized keywords, but an existing
Image variable, this image will be displayed.

.br 
FirstPlane and LastPlane
.ti +4
are optional arguments to restrict the range of
channels to be plotted (default: planes between variables FIRST
and LAST). If only FirstPlane is specified, SHOW only that plane.

VIEW is also controlled by a set of variables, available in the View% 
global structure. VIEW shows 4 (or 6) panels, representing the
Integrated area, the current channel, and the Integrated spectrum and
the current spectrul (in possibly 2 different scales). An interactive
control of the View is possible using the cursor, unless the /NOPAUSE
option is given.

The spectral panels can display line identifications based
on the current CATALOG. If a variable REDSHIFT exists, the frequency 
scale is corrected for the source Redshift, so that line identification
remains possible.

.ti -4
2 /NOPAUSE
.ti +4
[CLEAN_\]VIEW Argument [FirstPlane [LastPlane]] /NOPAUSE

  Just display the panels as currently defined, without looping 
with the Graphic cursor for interactive view.

.ti -4
2 Keys

Position-independent actions:
.nf
  Press E key: EXIT loop
  Press H key: HELP display
  Press P key: PRINT plot in "ha" subdirectory
  Press Q key: QUIT loop
  Press X key: EXTRACT on disk current zoomed region
  Press N key: Toggle  Narrow - Wide mode 
.fi

Cursor on images:
.nf
  Left  clic: Display spectrum at pointed position
  Right clic: Define a polygon
  Press B key: BACK to full field of view
  Press C key: COORDINATES toggled from absolute to relative and back
  Press M key: Display MASK if any
  Press S key: SLICE definition (velocity-position)
  Press U key: UNKILL pointed pixel
  Press Z key: ZOOM defined spatial region
  Press V key: Display map coordinates at current position 
  Press W key: WRITE Integrated Area image
.fi
Cursor on spectra:
.nf
  Left clic in Selected   Spectrum: Display selected velocity channel
  Left clic in Integrated Spectrum: Define velocity range
  Press B key: BACK to full velocity range
  Press C key: COORDINATES toggled from freq/velo to channels and back
  Press L key: LABEL spectral Lines
  Press M key: MOVIE  
  Press Z key: ZOOM defined velocity region
  Press W key: WRITE Integrated (and current) Spectrum
.fi
Cursor outside plots:
.nf
  Press B key: BACK to full velocity range AND full field of view
.fi

Returned values are found in view%current structure. The
ZOOM action produces a sub-cube named EXTRACTED.  The SLICE action produces
a 2-D data set named SLICE. As any other SIC Image variable, EXTRACTED
and SLICE can be written on disk using command WRITE.

.ti -4
2 Scripts

The VIEW plot is done by procedure p__view__cct for Clean Components CCT
and p__view__map for data cubes. 

.ti -4
2 Variables

VIEW uses the SHOW control variables SIZE, CENTER, RANGE and CROSS. 
In addition, it has its own control variables
.nf
view%expand       0.8 Character and Tick expansion factor
view%contour      NO  Contour the current channel map
view%movie        0   Elapsed time in seconds for a movie (0 means guess)
view%side         YES Display values in side Window
view%status%rima  NO  Relative coordinates in Images
view%status%rspe  NO  Relative coordinates in Spectra
.fi


.ti -4
1 WRITE
.ti +4
[CLEAN_\]WRITE Name File [/APPEND] [/RANGE Start End Kind] [/REPLACE] [/TRIM [Any]]

WRITE the buffer specified by Name (UV, CGAINS, and BEAM, PRIMARY, DIRTY, CLEAN, RESIDUAL,
SUPPORT, CCT, SKY) onto a File. Default extensions are .uvt for UV and CGAINS
and .beam, .lmv, .lobe, .lmv-clean, .lmv-res, .pol, .cct, and lmv-sky respectively
for the next ones. If Name does not refer to a known buffer, but to a
SIC Image variable, this variable is written. The default extension is then .gdf.

For UV data, the flagged data are written by default. They may
be omitted using the /TRIM option.

WRITE * File can be used to write all modified image-like buffers (not the
UV tables) under a common File name. This typically include .beam, .lmv 
and .lmv-clean, but also the .lmv-sky file if the PRIMARY command has been
used after deconvolution.

.ti -4 
2 /RANGE
.ti +4
[CLEAN_\]WRITE Buffer File /RANGE Start End Kind [/REPLACE]

A range of image planes can be specified through /RANGE option. Kind
is the unit of the Start-End values: CHANNEL, VELOCITY, or FREQUENCY.

Restrictions:
.br   
- The option is still experimental
.br   
- The Buffer name must be specified (* is not valid here) 
.br   
- This does not apply to UV data.

.ti -4
2 /APPEND
.ti +4 
[CLEAN_\]WRITE Buffer File /APPEND [/RANGE Start End Kind] 

EXPERIMENTAL: The selected channels are appended to an existing file. 

.ti -4
2 /REPLACE
.ti +4 
[CLEAN_\]WRITE Buffer File /REPLACE [/RANGE Start End Kind] 

EXPERIMENTAL: The selected channels are replaced in an existing file. 

.ti -4
2 /TRIM
.ti +4
[CLEAN_\]WRITE UV File /TRIM [ANY]

Remove the flagged visibilities while writing. A visibility
is declared "flagged" if all channels in it are flagged, unless
the keyword ANY is present. In this later case, if a single
channel is flagged, the whole visibility is declared flagged.



.ti -4
1 ENDOFHELP
