ratt-ru / CubiCal

A fast radio interferometric calibration suite.
GNU General Public License v2.0
18 stars 13 forks source link

Can other machine types work in a chain, if set to solvable=0 #55

Open o-smirnov opened 7 years ago

o-smirnov commented 7 years ago

I understand that the current chain implementation can only solve for complex-2x2 Jones terms (with an update type option to reduce them to diagonal or phase-only, see also #54). This is because of the update functionality.

However, for a term has solvable=0, then in principle there's no reason why a different type of term can't be inserted into the chain. It's a question of what ChainMachine expects the machine to provide. Is it just a gains array and an apply_gains/apply_inv_gains method? If so, then things should just magically work.

JSKenyon commented 7 years ago

In theory, there is no reason why you couldn't insert an arbitrary, non-solvable term into the chain. The difficulties only arise when you have chain rule derivatives appearing inside the chain. Non-solvable terms will never be differentiated, so they could be inserted provided they could provide all the required methods. Practically, the best thing would probably be to initialise a complex2x2 machine with the non-solvable gains, and then fiddle the Jones chain logic to ensure it never attempts to update that term.

o-smirnov commented 7 years ago

OK, that's an interesting alternative. It's really a design decision. Do we:

Hmmm....

ulricharmel commented 5 years ago

Hi @o-smirnov, @JSKenyon I just made chain machine for the robust solver. It is on jones_chain_robust branch on my fork. Here is the commit to it https://github.com/ulricharmel/CubiCal/commit/80246132fd353443d5aefd15f4cd1dbb1a3f0aed

Here is the output of git diff jones_chain_robust_machine.py and jones_chain_machine.py. You can see the changes I had to made to the current jones_chain.py to turn it into a robust chain machine

diff.txt