[ Basic Info | References | User Guide ]
Basic Information on varfit
Task: varfit
Purpose: Analyse correlations of antenna gains and uv-variables.
Categories: uv analysis
VARFIT is a Miriad task to analyse the correlations of
antenna gains and uv-variables. VARFIT fits the following:
yaxis = slope * xaxis + intercept
D(yaxis) = slope * D(xaxis) + intercept
where D() is the difference between succesive samples,
xaxis, yaxis are the uv variables from single uvfiles.
In addition, VARFIT provides an option of regression for
the phases derived from the gains of two uvfiles and
plots both phase-phase diagram and phase residual vs UT time.
If either axis is an antenna gain, then SELFCAL must be run first
and the axes are sampled at the interval used in SELFCAL.
For linear regression between the two phase solutions, the setup
in the SELFCAL for the two simultaneously sampled data files needs
identical.
The rms and correlation coefficient are listed for each antenna.
Key: vis
The input UV dataset name. The antenna gains must first be
derived for the selected linetype by the task SELFCAL with
the desired averaging interval.
Key: xaxis
xaxis can be antenna gain ``amplitude'' or
``phase'', or any uv-variables. The default is ``time''.
Key: yaxis
yaxis can be antenna gain ``amplitude'' or
``phase'', or any uv-variables. The default is ``phase''.
Key: log
Output log file. Default is the terminal.
Key: device
Standard PGPLOT device, if plot of yaxis versus xaxis is wanted.
Default is no plot.
Key: nxy
Number of plots in the x and y directions. The default is 3,3.
Key: xrange
The min and max range along the x axis of the plots. The default
is to autoscale. Note that for "time" should be given in days.
Key: yrange
The min and max range along the y axis of the plots. The default
is to autoscale. Note that for "time" should be given in days.
Key: refant
Reference antenna for gains and uv-variables. If refant.ne.0 then
the gain of this antenna is set to cmplx(1.,0.). The
other antenna gains are then relative to the reference antenna.
The uv-variable value for the refant is subtracted from each of the
other antennas. Single valued variables, e.g. time, are unchanged.
The default is to use the original gains and uv-variable values.
Key: refant2
Reference antenna for cross correlation of gains and uv-variables.
Compare the gains or uv-variables between antennas by fitting
yaxis = slope * xaxis(refant2) + intercept
D(yaxis) = slope * D(xaxis(refant2)) + intercept
where D() is the difference between succesive samples.
Key: phratio
Phase ratio (phase2/phase1) for slope input from users, which is
used for adding a line with an expected-phase-slope in phase-phase
linear regression plot when options=uniscale.
Default is 0.
Key: nsigma
Number of sigmas specified by users to reject 'bad gains' (or
uncorrelated gains between receiver 2 and receiver 1) in
the linear regression between phase2 and phase1. The sigma here
is the uncertainty in the mean of the residual phase which is
the phase2 subtracted by the phase determined from the initial
fitting assuming the slope = freq2/freq1 in the linear regression
between phase2 and phase1. It must be positive.
nsigma = 4 is recommended. Default is 0, which means that no data
rejection is performed.
Key: options
wrap Do not unwrap phase.
xscale Re-scale xaxis = slope * xaxis + offset, where slope
and offset are fitted w.r.t. xaxis(refant)
The fit is written into the log file. E.g.
yaxis=phase xaxis=tpower refant=4 log=tpscale
results can be used in the task tpgains to correct
tpower to a common Tsys scale.
yscale Re-scale yaxis = slope * yaxis + offset, where slope
and offset are fitted w.r.t. yaxis(refant)
structure Replace yaxis with it's structure function:
<{yaxis(i+k) - yaxis(i)}**2>
allan Replace yaxis with it's Allan variance:
<{yaxis(i+2k) - 2*yaxis(i+k) + yaxis(i)}**2>
quad Fit yaxis = a + b*xaxis + c*xaxis**2
where a and b are first derived from a linear fit.
The fit is written into the log file. E.g.
yaxis=tpower xaxis=tpower refant2=4 options=quad
results can be used in the task tpgains to correct
tpower to a common Tsys scale.
uniscale use the maximum ranges in x and y axies
to make uniformly-scaled plots for each of the antennas.
phareg do linear regression between phase1 and phase2 derived
from the gain tables in uvfile1 and uvfile2, respectively.
plot a solid line: phase2 = slope * phase1 + offset
with the raw phase corrections in the phase/phase diagram.
phatran transfer phase2 from phase1 using the linear correlation
derived:
phase2 = slope * phase1 + offset
and using the transferred phase2 replaces the
phases in the gain table of file2.
gflag excluding the failed gains in the phase regression.
tambient do linear regression between the residual phase
(phase2-(slope * phase1 + offset)) and a variable
tambient which is antenna-based variable and stored
elsewehere (for example, SMA Sybase).
The data of tambient must be
stored in a ASCII file (tambient.dat) under the miriad
working area in the following format:
2005 2 18 8 RM_AMBIENTLOAD_TEMPERATURE_F
1
1439 tmp1.dat
0 1.437269e+01
1 1.437269e+01
2 1.437269e+01
...
2
1439 tmp2.dat
0 1.519706e+01
1 1.519706e+01
2 1.547185e+01
...
1st row is year,month,day,number of antenna,RM variable
followed by concatenated individual antenna files.
in each antenna section,
1st row is the antenna ID;
2nd row is number of total data points and filename;
3rd and larger number rows contains the body of the data:
1st column is ut time in minute;
2nd column is the RM Variable.
For the SMA users, a C-shell script (TambSybase.csh)
is provided under $MIR/examples, which can be used
to extract the data from SMA sybase on the computer
d2o.sma.hawaii.edu at the SMA site in Hawaii.