rcyndie / QuartiCal

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

Testing `delay_and_tec` on PKS1934 #7

Open rcyndie opened 1 month ago

rcyndie commented 1 month ago

Consider some of the first attempts of delay and TEC separation on this MeerKAT UHF calibrator observation at around 7am (may be coinciding with winter sunrise in the Karoo). The table below summarises the different chains of gain_type selected, with G and B capturing the complex gain and bandpass variables respectively. Here, we are using K for delay and T for TEC corrections.

Figure gain_chain gain_type (K/T)
1 GKB K $\leftarrow$ delay_and_offset with init. est.
2 GTB T $\leftarrow$ tec_and_offset with init. est.
3 GKTB KT $\leftarrow$ delay_and_tec with init. est.

(Figure: LHS: phase plot from gain_chain; RHS: phase of B)

Figure 1 image

Figure 2 image

Figure 3

No phase wrapping captured by the different gain chains suggest no highly varying phase delays in the observation period.

landmanbester commented 1 month ago

Interesting that they all look so similar. I think we need to look at the phase residuals when comparing to the complex (1,1) solution to test which chain is performing best

JSKenyon commented 1 month ago

I would also plot the phase on the B term - it will make it obvious if anything has gone wrong.

rcyndie commented 1 month ago
Figure gain_chain gain_type (K/T)
4 G diag_complex (1, 1)

Figure 4 image

Figure 5 (difference phase plot GKB w.r.t. diag_complex) image

Figure 6 (difference phase plot GTB w.r.t. diag_complex) image Note: All difference phase plots have their colourbars set to $[-0.1, 0.1]$.

rcyndie commented 1 month ago

_About MAD flagging and SIGMA_SPECTRUM_ The following plots are not directly comparable with the previous ones because of different config settings for the calibration, but should help give an idea of the not MAD flagged plots, for example, Fig. 5. When implementing MAD flagging, only the threshold_bl is being considered (with the rest disabled including whitening). All plots shown are the difference phase plots from the diag_complex at the corresponding settings (unless specified otherwise).

Figure gain_type MAD threshold_bl Whitening
7 GKB with K $\leftarrow$ delay 2. Disabled

(colourbar limits are $[-0.04, 0.04]$) Figure 7a (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [Full view] image

Figure 7b (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [showing only a few antennas] image

JSKenyon commented 1 month ago

Ok, so it looks like the SIGMA_SPECTRUM column is throwing off the solutions. This doesn't exactly surprise me. I am a bit confused by your MAD threshold_bl setting. A two sigma threshold is extremely low. Could you possibly report the flagging statistics before and after the run?

rcyndie commented 1 month ago

Do you mean the 'percentage flagged' from for example, goquartical-summary?

JSKenyon commented 1 month ago

Do you mean the 'percentage flagged' from for example, goquartical-summary?

Exactly.

rcyndie commented 1 month ago
Percentage Flagged
Initial flags 27.88
MAD flagging with threshold_bl$=2.$ 70.40
MAD flagging with threshold_bl$=2.$ (with SIGMA_SPECTRUM) 70.40

With or without specifying the SIGMA column, the percentage slagged is the same.

JSKenyon commented 1 month ago

Yeah, I would dial that threshold back to 5. That is relatively conservative (and shouldn't overflag so heavily). The fact that the flagged percentage is the same with and without SIGMA_SPECTRUM is a little odd but not impossible.

rcyndie commented 1 month ago
Figure gain_type MAD threshold_bl whitening
8 GKB with K $\leftarrow$ delay 5. native
9 same 4. native

(same as in Figure 7, colourbar limits are $[-0.04, 0.04]$) Figure 8a (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [Full view] image

Figure 8b (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [showing only a few antennas] image

Figure 9a (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [Full view] image

Figure 9b (LHS: SIGMA column not specified; RHS: SIGMA $\leftarrow$ SIGMA_SPECTRUM) [showing only a few antennas] image

Percentage Flagged
Initial flags 27.88
MAD flagging with threshold_bl$=5.$ 30.87
MAD flagging with threshold_bl$=5.$ (with SIGMA_SPECTRUM) 29.11
MAD flagging with threshold_bl$=4.$ 35.90
MAD flagging with threshold_bl$=4.$ (with SIGMA_SPECTRUM) 32.20

When comparing Figure 8b with Figure 9b, the residual structure is better observed with the threshold_bl$=4.$, and I believe it is on the lower end but should not be overflagging the results, as per the percentage flagged. But, it is difficult to definitely conclude a pattern in the residual at this point.