ratt-ru / QuartiCal

CubiCal, but with greater power.
MIT License
8 stars 4 forks source link

can we have an option to process all 4 correlations, but solve only for the diagonals? #337

Open o-smirnov opened 3 months ago

o-smirnov commented 3 months ago

I just stumbled over this in the PARROT pipeline... been calibrating with corrs [0,3] all along, so my Stokes UV images are coming out zero.

CubiCal has a solve diag-only feature. Would this be difficult to implement? Effectively, it comes down to discarding the off-diagonal elements when the update equations are formed.

There's an important use case for this. At initial stages of selfcal, we usually want to image in Stokes I and use XX/YY only, since the polarized sky is uncertain. However, as soon as we switch to Stokes QUV imaging, we do want off-diagonal terms that have been corrected for the gain solution.

(Or is it the case that having a model with 0 on the off-diagonals comes down to the same thing as ignoring the off-diagonals? It's a bit too late in the day to remember the equations...)

landmanbester commented 3 months ago

Surely just don't select out the diagonal correlations and use the complex_diag solver?

o-smirnov commented 3 months ago

"Select out" is the wrong answer -- that's how I ended up with null Stokes UV images. I do need to process all four.

However, @JSKenyon has enlightened me that diag solvers implicitly ignore off-diag correlations in the updates. So QuartiCal in full-corr mode with a diagonal solver is equivalent to CubiCal with --jones-diag-only. Which is exactly what I need.

Non-diag-only solutions are a bit of an esoteric use case, so we have decided to shelve it for now.

landmanbester commented 3 months ago

"Select out" is the wrong answer -- that's how I ended up with null Stokes UV images. I do need to process all four.

By don't select out I obviously mean don't set input_ms.select_corr to anything which gives exactly the answer you gave above does it not?

JSKenyon commented 3 months ago

Non-diag-only solutions are a bit of an esoteric use case, so we have decided to shelve it for now.

Indeed. My own experience has been that including the off-diagonal correlations when attempting to solve for diagonal terms doesn't tend to work very well. I will note that this is simply implemented by setting the weights of the off-diagonal contributions to zero when computing the update i.e. it is a one liner to change if ever we want to experiment.

o-smirnov commented 3 months ago

"Select out" is the wrong answer -- that's how I ended up with null Stokes UV images. I do need to process all four.

By don't select out I obviously mean don't set input_ms.select_corr to anything which gives exactly the answer you gave above does it not?

Ah indeed that's exactly what you said. Sorry, I'm only on my second coffee so my vision is having a senior moment.

landmanbester commented 3 months ago

Ah indeed that's exactly what you said. Sorry, I'm only on my second coffee so my vision is having a senior moment.

No problem, just making sure I wasn't having one