ratt-ru / CubiCal

A fast radio interferometric calibration suite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nan values in off-diagonal correlations of flag data points causing division by zero error in robust solver

ulricharmel opened this issue · comments

I just noticed from one of the 3C147 (C-config, average, low bandwidth) that certain visibilities have nan values in their off diagonals (nan+nanj). Although these visibilities are flagged and have zero weights, this computation https://github.com/ratt-ru/CubiCal/blob/master/cubical/solver.py#L497 returns [0, nan+nanj, nan+nanj, 0] for those visibilities. This doesn't seem to have any repercussions on the complex solver but this leads to division by zero error for the robust solver. I don't know if this can be fixed in the data handler when reading the data. A temporary quick fix for now which I have adopted on my local branch is to reset all flagged visibilities to zero. i.e. add a copy of line https://github.com/ratt-ru/CubiCal/blob/master/cubical/solver.py#L502 below https://github.com/ratt-ru/CubiCal/blob/master/cubical/solver.py#L497

Probably a similar thing should be done after line https://github.com/ratt-ru/CubiCal/blob/master/cubical/solver.py#L521 for model visibilities.

3.0 I will try 3.3 then