Bandpass Solver Test
Date: 01/06/05
Subject: Report on bandpass solver test
From: Jun-Hui Zhao (SAO)
To: Ram Rao (SAO), Shengyuan Liu (ASIAA), Peter Teuben (U. of Maryland),
Mel Wright (Berkeley), Todd Hunter (SAO) and Bob Wilson (SAO)

Abstract
We report the results of the bandpass solver test. An aglorithm of pre-processing the visibility prior to solving bandpass (Mfcal) in MIRIAD has been implemented in a test code smaMfcal. Namely, the visibility channel data is divided by the pseudo-continuum vector (or a vector-average of the channels) and is weighted by the nth power of the inverse variance of the normalized vector. In this report, we show that the problems of the phase instability in SMA data and artifacts in amplitude of bandpass solutions due to nulls in visibilities of a large planet can be effectively suppressed by the pseudo-continuum normalization and weighting by the 4th power of the ratio (Amp_ave/sigma). Test codes, test script and the SMA data for the test are also provided.

1. Observed data:
Aug30_04 in Nimesh's Cepha track; Saturn was observed for 30 min. The data used here are the seven high spectral resolution chunks (3 to 9); each chunk has 256 channels or 406kHz channel width. Here is the SMA data (482MBytes) used in this test.

2. Saturn Model:
A disk model (17.06", 15.64", -6.75deg, Tb=137 K, no limb darkening) was made using task uvplanet in Miriad with the same uv coverage as the real data.
saturn model uv-ampl
saturn model uv-phas
saturn model real-imag

3. Compare with the SMA data (uncalibrated):
saturn data uv-ampl
saturn data uv-phas
saturn data real-imag
Note: both the nulls in the visibilities for a large planet and unstable phase in the high-frequency data have been troubling us in achieving reliable bandpass solutions. The limb darkening, hot spots, and phase instability in the real data are difficult to model. The original idea (dividing the data by the planet model) is able to reduce the effect of the nulls in a disk source but is not as good as we desired.

4. Algorithm and Testing codes
An algorithm for pre-processing the SMA data prior to the bandpass solver (MFCAL) is suggested. The channel visibility (V_ch) is divided by the pseudo-continuum vector (V_ave) which can be calculated by averaging the channel data weighted by 1/sigma**2 where sigma is the rms noise of the visibility. Then, the variance of the normalized vector (V_ch/V_ave) is naturally proportional to (sigma/Amp_ave)**2, where Amp_ave is the amplitude of V_ave. Then the data can be weighted by the inverse of the nth power of the variance:
weight  ~ (Amp_ave/sigma)**(2*n)
The algorithm has been coded in a smatest code smaMfcal. The source code and compiling scripts for smaMfcal can be obtained. If you would like to run the test script Bandpass.csh that was used for this report, you may also get smaGpplt , which has some features of polynomial fit/moving smooth to the bandpass or antenna gains. Both smaMfcal and smaGpplt are in test and will be folded into MIRIAD4.

5. Solving for bandpass from the model data:
Since the model data have no effects from both instruments and atmosphere, we can quantitavely test what artifacts can be produced by the software due to the nulls in the planet visibilities.
Here is a Key parameter used in the solver ( smaMfcal ) in Miriad:
weight =-1: uniformly weight, (used in original miriad solver (Mfcal));
weight = 1: divided by averaged channel; weighted by the 1st power of 1/variance = (amp_ave/sigma)**2; This is the algorithm that has been used in AIPS to handle VLBA/VLA data.
weight = 2: divided by averaged channel; weighted by the 2nd power of 1/variance = (amp_ave/sigma)**4;
Here are the results of the bandpass solution from the disk model derived with different weight methods:
weight=-1: bandpass-ampl
weight=-1: bandpass-phas
weight=1: bandpass-ampl
weight=1: bandpass-phas
weight=2: bandpass-ampl
weight=2: bandpass-phas
Note: Artifacts due to the nulls in the planet visibilities are seen in the bandpass solutions. Since no instrumental and atmospheric errors, there are essentially no corrections in the phase solutions. The solver with different weighting methods gives consistent solutions in phase. The solver properly handels 180 degree phase jump across the nulls. The effect of nulls all goes to amplitude. For the uniformly weighting, upto 10% [(max-min)/(max+min)] across 7 chunks (600MHz) is observed for some antennas (e.g. antenna 3). The weighting by amp_ave/sigma helps reducing the effects in amplitude. The weight with the 4th power of amp_ave/sigma (weight=2) appears to effectively suppress the artifact in bandpass solutions to the level of 1% in amplitude. This has been used as the default in the test code of the bandpass solver ( smaMfcal ).

6. Solving for bandpass from the real data:
weight=-1: bandpass-ampl
Note: the phase instability in the data gives trouble to achieve good bandpass solutions for all the antennas if a uniform weight is used without dividing the channel by the continuum vector.
weight=-1: bandpass-phas
weight=2: bandpass-ampl
Note: The phase instability in the data appears to be effectively removed after the channel data divided by the continuum vector. The bandpass solutions are converged for all the antennas although some of the antennas (2,3,4, and 6) show relavely large scattering probably due to the long baselines. Antennas 1,5,7,8 in (center of the array) show better solutions.
weight=2: bandpass-phas

7. Polynomial fit to bandpass solution:
5th-order poly fit to bandpass-ampl
Note: The 5th-order polynomial fit (black lines in weight=2: bandpass-ampl) to the bandpass appears to give reasonably good and flat bandpass solutions to this high spectral resolution data.

8. Summary:
The algorithm (weight=2), namely, the channel data divided by the averaged vector and weighted by (amp_ave/sigma)**4, appears to be good in solving for bandpass using data of a large planet with unstable phase. This algorithm should be good for observations of a large planet by pointing at the different sides of the` limb in order to obtain evenly sampled high S/N data across all the baselines.