SKA-ScienceDataProcessor/algorithm-reference-library

Cross polarisation calibration solution

Opened this issue · 1 comments

The cross polarisation solution does not converge (judged by residual error), Currently this does work.

    def test_solve_gaintable_matrix_both_linear(self):
        self.core_solve('stokesIQUV', 'linear', phase_error=0.1, amplitude_error=0.01, leakage=0.01, residual_tol=1e-3,
                        crosspol=True, phase_only=False, f = [100.0, 50.0, 0.0, 0.0])
    
    def test_solve_gaintable_matrix_both_circular(self):
        self.core_solve('stokesIQUV', 'circular', phase_error=0.1, amplitude_error=0.01, leakage=0.01,
                        residual_tol=1e-3, crosspol=True, phase_only=False, f=[100.0, 0.0, 0.0, 50.0])

Setting the cross pol terms to nonzero leads to non-convergence

For example:

    def test_solve_gaintable_matrix_both_circular(self):
        self.core_solve('stokesIQUV', 'circular', phase_error=0.1, amplitude_error=0.01, leakage=0.01,
                        residual_tol=1e-3, crosspol=True, phase_only=False, f=[100.0, 10.0, -20.0, 50.0],
                        niter=1000)


yields:

Ran 1 test in 130.815s

FAILED (failures=1)

Failure
Traceback (most recent call last):
  File "/Users/timcornwell/anaconda/envs/arlenv/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/Users/timcornwell/anaconda/envs/arlenv/lib/python3.6/unittest/case.py", line 601, in run
    testMethod()
  File "/Users/timcornwell/Code/algorithm-reference-library/tests/test_calibration_solvers.py", line 120, in test_solve_gaintable_matrix_both_circular
    niter=1000)
  File "/Users/timcornwell/Code/algorithm-reference-library/tests/test_calibration_solvers.py", line 89, in core_solve
    assert residual < residual_tol, "%s %s Max residual = %s" % (spf, dpf, residual)
AssertionError: stokesIQUV circular Max residual = 0.0788709005565)