## Averaging Antenna Gains with Time - GPAVER

If the phase stability is bad during the observation (the atmospheric conditions are poor), the phase of the antenna gains can vary rapidly. A change of tens of degrees or more during the calibrator scan is not uncommon. However the software that determines the antenna gains assumes that the gains are constant during a solution interval. So during periods of poor phase stability, it is often desirable to make the solution interval of the calibration software quite short. While the resultant gains probably track the phase during the calibrator scan, what we are really interested in are the antenna gains for the program source. If you solved for a number of time intervals during the calibrator scan, the best guess at the antenna gains for the program source is derived by interpolating between some average of the calibrator scan gains. Thus after determining the gains at a fine time step in the calibrator scan, you should average these gains together to get some representative gain for the whole calibrator scan. This is probably the best guess you can make (at least as far as correcting the program source is concerned), although in times of truly awful phase stability, its a pretty poor guess (self-calibration will be needed in this case).

There are two ways to average your gains, either the ``vector'' or ``scalar'' averages. Which is the most appropriate will depend on whether you want good estimates of the gains or good estimates of the resultant images.

• Scalar averaging consists of averaging the amplitude of the gains separately (the `average' phase is still determined by a traditional (vector) average of the real and imaginary parts of the gains). Assuming the variation in gain is purely due to poor phase stability, a scalar average will give you a good estimate of the amplitude of the gain. If you are going to self-calibrate later, then scalar averages are probably the most appropriate. This means that when you come to self-calibrate, you only have to solve for the phase (at least initially), because you already have a good amplitude estimate.
• On the other hand, if you are not going to self-calibrate, you are more interested in getting a good estimate of your image at this stage, and less concerned about partially correct gains (the two do not necessarily go hand in hand). If we were to use vector averaged antenna gains (averaging the real and imaginary parts), the poor phase stability will cause partial decorrelation in both the program source and calibrator. This will result in apparent reduced flux densities of both of them. Assuming that the decorrelation is approximately the same for both, then we could scale up the program source by the decorrelation that we note in the calibrator. This can be achieved by vector averaging the antenna gains.
To summarise the above discussion, when phase stability is poor, it is best to use a very short solution interval when solving for the antenna gains of the calibrator scan. The gains during a scan should then be averaged before applying them to the program source. Scalar averaging is appropriate if self-calibration is to be used later. Otherwise vector averaging should be used.

The task gpaver can be used to perform averaging of antenna gains. Its pretty straightforward.Typical inputs are

 GPAVER vis=vela.4800 Average the gain table for the program source interval=10 Averaging interval (calibrator scan length) options=scalar Scalar average if self-calibrating later, or options=vector vector average otherwise