rcyndie / QuartiCal

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

First look into Shapley ms #6

Open rcyndie opened 2 months ago

rcyndie commented 2 months ago

This is a UHF MeerKAT ms with 1024 channels, channel width of 0.531 MHz, and a 8s integration time. It contains observations of the Shapley Supercluster pointed at the cluster A3562 (refer to Venturi et al. 2022 for more information).

Consider the following phase plots of running different gain_type on DATA (column only has 1GC corrections applied).

Figure gain_type Sol. tint Sol. fint
1 diag_complex 1 1
2 diag_complex 1 8
3 diag_complex 1 32
4 delay_and_tec with/without initial estimates 1 $\infty$
5 delay_and_offset with/without initial estimates 1 $\infty$
6 tec_and_offset with/without initial estimates 1 $\infty$

Figure 1 image

Figure 2 image

Figure 3 image

Figure 4 (Left: without initial estimates; right: with initial estimates) image

Figure 5 (Left: without initial estimates; right: with initial estimates) image

Figure 6 (Left: without initial estimates; right: with initial estimates) image

landmanbester commented 2 months ago

It is interesting that the LHS of figures 5 and 6 look so similar. In this case we don't expect the initial estimates to produce something sensible because this is not a calibrator field. You would have to divide out the model phases for that to work. But I don't see phase wraps in figures 1-3 so it shouldn't be necessary. I'm guessing that delay_and_tec fails because it doesn't have an offset. You could try adding a phase only term to the chain and doing a couple of epochs but this may not be the best field to test your project. Let me rather find you some UHF calibrator data

rcyndie commented 2 months ago

You could try adding a phase only term to the chain and doing a couple of epochs but this may not be the best field to test your project.

Figure gain_type Sol. tint Sol. fint
7 (Left) delay_and_tec without init. est. + phase-only 1 $\infty$
8 delay_and_offset (same as Figure 5)
9 tec_and_offset (same as Figure 6)

Figure 7 (Right: difference w.r.t. diag_complex from Figure 1) image

Figure 8 (Right: difference w.r.t. diag_complex from Figure 1) image

Figure 9 (Right: difference w.r.t. diag_complex from Figure 1) image

The difference in phase plots (ph(diag_complex) - ph(delay_and_tec)) on RHS of Figure 7 suggests residual phases not captured by the diag_complex.

Summary: The initial estimates by the different gain_type (delay_and_offset, tec_and_offset and delay_and_tec) are not expected to work on a target field due to the more complex (and unknown) sky model involved. It is possible to compare delay_and_tec + phase-only term with the traditional parametrised diag_complex, as shown by an improvement from Figure 4 to Figure 7 against Figure 1.

Note: Except for RHS of Figure 7, all phase plots are directly comparable as they are set to the same colourbar $[-0.1, 0.1]$.

JSKenyon commented 2 months ago

Ah, great. I think that figure 7 is pretty interesting. It suggests that the chain you used does a good job of capturing the phase errors without overfitting in the way that the complex solver would. Can you please produce difference plots for delay_and_offset and tec_and_offset? It would be interesting to see if the phase and delay_and_tec chain produces better gain residuals than the other two.

JSKenyon commented 2 months ago

Can you double check that the left hand image in figure 7 is correct? Looking at it more closely, it seems very noisy for something which only has 3 degrees of freedom per timeslot. Have you accidentally plotted the diag_complex phases on the left? Alternatively, are you certain that you had the solution intervals on the phase term as 1 in time and 0 in frequency?

JSKenyon commented 2 months ago

I found your config file - please rerun with K.freq_interval: 0. Currently you have fit the phase at every point. This will be very close to identical to the phase on the diag_complex term. I also suggest you always solve for the phase term before the delay_and_tec term in the chain.

rcyndie commented 2 months ago

I found your config file - please rerun with K.freq_interval: 0. Currently you have fit the phase at every point. This will be very close to identical to the phase on the diag_complex term. I also suggest you always solve for the phase term before the delay_and_tec term in the chain.

Yes, I did have the phase-only term to be solved for every frequency while the offset term from the intended equivalent delay_and_tec_offset should only vary with time. I will give this another try.

rcyndie commented 2 months ago

From the updated plots in the above, the difference plots generated by both delay_and_offset (Figure 8) and tec_and_offset (Figure 9) are not significantly different from the difference plot in Figure 7. This likely implies that, for this field, there is no significant difference between running either gain_type or chain on the corrected gains. And also what Jonathan mentioned above, in terms of the number of free parameters, the other gain_type do so by not overfitting in the way that the diag_complex does.

gain_type Degrees of freedom ($N{tint} N{fint} Na N{param}$)
diag_complex 225 1024 61 * 4
delay_and_offset 225 1 61 * 4
tec_and_offset 225 1 61 * 4
delay_and_tec + phase-only 225 1 61 * (4 + 2)