mweastwood / TTCal.jl

A calibration routine developed for the OVRO LWA.
http://mweastwood.github.io/TTCal.jl
Other
11 stars 6 forks source link

detect bad antennas while calibrating #46

Closed mweastwood closed 8 years ago

mweastwood commented 8 years ago

this seems to work but might need a little bit of tweaking

Algorithm description:

TTCal attempts to choose the gains such that the model visibilities match the measured visibilities as closely as possible. However another (equally valid choice) would have been to choose the gains such that the corrected measured visibilities match the model as closely as possible.

Now imagine you have an antenna that is just picking up noise. TTCal will dial down its gain because it's trying to make the model match the measured data. The antenna will appear to look good because its residuals are small. However, when you invert the gains to correct the measured visibilities, the antenna no longer has small residuals.

So as we're calibrating (minimizing | measured - gain of antenna 1 * gain of antenna 2 * model |), we will check | measured / (gain of antenna 1 * gain of antenna 2) - model | to see if each antenna is an outlier.

One bad antenna however, can trick you into thinking other antennas are also bad. So only flag antennas one at a time.

related to #45 but more tweaks might be necessary

mweastwood commented 8 years ago

@marinanderson I think this also fixes an error you might have been seeing with polcal? Hidden in here is a fix for an error that would have read solve! not defined while trying to run polcal.

I've expanded the tests to make sure polcal is tested just as much as gaincal so this should hopefully never break again.

Note also that you should pull down the latest CasaCore.jl changes and run make && make install from /path/to/CasaCore.jl/deps/src.