Open o-smirnov opened 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.
OK, that's an interesting alternative. It's really a design decision. Do we:
Allow other types of GMs in the chain as long as they're non-solvable. Enforce an interface that all GMs must provide in order to facilitate this (e.g. "thou shalt provide self.apply_gains()" etc.)
Only allow complex-2x2 in a chain, but trust all other GM types to save a "gain" parameter to the database (in additional to any intrinsic parameters that their gains are derived from), so that a complex-2x2 machine can be initialized from a database populated by another machine type.
Hmmm....
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
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.