.ec _
.ll 76
.ad b
.in 4
.ti -4
1 Language
.nf
APPLY         : Apply gain solution to current UV Data
SCALE__FLUX    : Adjust flux scale on a daily basis
MODEL         : Compute a UV model from the Clean Components Table
SOLVE         : Solve for complex gains using the UV model
UV__SELF       : Build the Self Calibration UV Table and dirty image 
.fi 

.ti -4
1 APPLY
.ti +4
[CALIBRATE_\]APPLY [AMPLI|PHASE [gain]] [/FLAG]

  Apply gain solution computed by MODEL and SOLVE (which
are called implicitely by SELFCAL)  or obtained by READ CGAINS 
to the current UV data. The optional arguments indicate whether this
should be an AMPLITUDE or PHASE gain, and what gain value is used
(in range 0 to 1).
  If no argument is given, the current SELF__MODE (see HELP SELFCAL)
is used, and the gain is 1.0.
  
  
The /FLAG option controls whether data without a valid gain
solution are kept unchanged or flagged.
  
.ti -4
2 /FLAG
.ti +4

[CALIBRATE_\]APPLY [AMPLI|PHASE [gain]] /FLAG

  Apply gain solution (in AMPLITUDE or PHASE) and flag data without a 
corresponding valid gain solution. 


.ti -4
1 SCALE__FLUX
.ti +4
[CALIBRATE_\]SCALE__FLUX Find|Apply|List|Calibrate [Args...]

A set of commands to check flux calibration on a day to day basis.
It gives the ratio between the observed flux (in the current
UV data set) and the model flux for each separate period.  
The Model flux can be derived
from Clean Component Tables using the MODEL command, or read
from an outer file using READ MODEL.

Error bars are approximate. The User-defined command SOLVE__FLUX
performs a more accurate evaluation of the error, but is 
typically 50 times slower.

SCALE__FLUX FIND [DateTolerance [UVmin UVmax]]
.br
determines, by linear regression, the best scaling factor to match date 
by date the UV data set with the MODEL data set. Separate Periods are 
defined when Dates differ more than DateTolerance (default 1 day). Only 
data with baseline lengths in the range UVmin UVmax are considered for 
the regression (default all).

SCALE__FLUX APPLY VarName
.br
apply previously determined flux scale factors to the MODEL data set, 
previously read by READ MODEL. This is in general used only in an 
iterative search way, e.g. by the user-defined command SOLVE__FLUX 
(which calls procedure solve__flux). The resulting UV data set is 
loaded into the specified VarName SIC variable.

SCALE__FLUX LIST
.br
print out dates, baselines and determined flux factors

SCALE__FLUX CALIBRATE
.br
apply previously determined flux scale factors to the current UV data 
set (i.e. divide the visibilities by the scaling factor of each date,
and correct the weight accordingly).
This may then be written using command WRITE UV .

SCALE__FLUX SOLVE [DateTolerance [UVmin UVmax]]
.br
combines FIND and PRINT behaviours.

.ti -4
1 MODEL
.ti +4
[CALIBRATE_\]MODEL [MaxIter] [/MINVAL Value [Unit]]

Compute visibilities on the current UV sampling using a source
model made of the MaxIter first Clean Components, or of 
all pixel values above the given Value if /MINFLUX is present.

.ti -4
2 /MINVAL
.ti +4
[CALIBRATE_\]MODEL [MaxIter] /MINVAL Value [Unit]

Construct the source model using all Clean Components until
MaxIter (all if MaxIter is 0 or not specified). These components
are stacked on a grid, and then all pixels above the given Value
are taken as source model to derive visibilities.

Unit can be Jy, mJy, K or sigma. The default value is Jy.

.ti -4
1 SOLVE
.ti +4
[CALIBRATE_\]SOLVE Time SNR [Reference] 
      /MODE [Phase|Amplitude] [Antenna|Baseline] [Flag|Keep]

Solve the baseline or antenna based gains using the current UV
data and current MODEL.

Time is the integration time for the solution.
SNR is the minimum Signal to Noise Ratio required to find
a solution. 

.ti -4
2 /MODE
.ti +4
[CALIBRATE_\]SOLVE Time SNR [Reference] 
      /MODE [Phase|Amplitude] [Antenna|Baseline] [Flag|Keep]

Dependin on the /MODE arguments, the gains can be antenna-based or 
baseline-based, and include Phase or Amplitude, and data without 
solutions either KEEPed or FLAGged,


.ti -4
1 UV__SELF
.ti +4 
[CALIBRATE_\]UV__SELF [CenterX CenterY UNIT [Angle]] 
  [/RANGE [Min Max Type]] [/RESTORE]

Use (and if specified and/or needed create) the "Self Calibrated" 
UV dataset to make a dirty image, instead of using the current
UV table. 

UV__SELF utilizes UV__MAP for imaging. See HELP UV__MAP
for parameters.

.ti -4
2 /RANGE 
.ti +4
[CALIBRATE_\]UV__SELF [CenterX CenterY UNIT [Angle]] /RANGE [Min Max Type]

Create and image the "Self Calibrated" UV data.

The "Self Calibrated" UV dataset is created from the current UV data 
set by extracting the range of channels specified by the /RANGE
arguments Min  Max Type.  Type can be CHANNEL, VELOCITY or FREQUENCY. 
If /RANGE has no argument, all channels are averaged together.

It is then updated by command SOLVE at each self-calibration loop. 
See SOLVE and CLEAN_\SELFCAL for details.

.ti -4
2 /RESTORE 
.ti +4
[CALIBRATE_\]UV__SELF /RESTORE

As UV__RESTORE but for the self-calibrated UV table.

Restores the Clean image from the Clean Component Table by removing
the components from the Self-calibrated UV data and imaging the
residuals before adding them to the convolved Clean components.

See UV__RESTORE for details.


.ti -4
1 ENDOFHELP
