Scripts for Step 3 - Self-calibration of the continuum:

Self-Calibration of Short-Baseline Execution Blocks#

Here, we self-calibrate the short-baseline continuum data (phase-aligned and concatenated).

Summary of path through self-calibration#

ABAur_SB_path_selfcal
number-seconds-in-each-scan
Additional explanation of parameter choices

In the gaincal task:

  • spw: Setting to '' selects all spectral windows. In Step 4 we intend to apply the self-calibration solutions we generate with the (pseudo-)continuum onto the line data. So even though we are only self-calibrating (pseudo-) continuum data, it would defeat the whole purpose to not include SPWs 1-4.

  • solint: The time interval on which to generate solutions. 'inf' goes as wide as the boundaries specified by the combine parameter. In the first and second round (p1, p2), one solution is found per scan. Later we get down to 18 seconds (3x the record interval). In the last round we find one solution per scan again.

  • combine: Dimensions of the data to combine when generating solutions. In the first two rounds, we avoid combining spectral windows (i.e., we generate per-SPW solutions) to account for any per-SPW phase offsets. Later, we have to combine spectral windows because the SNR of the solutions (in the line SPWs) is too low.

  • refant: Which antenna to use as the reference antenna (in the priority listed). I selected DV08, DA57, DA52 using the refant lists generated by the pipeline hif_refant task, shown in the weblog. It was a happy coincidence that the 3 highest ranked antennas in SB EB1 were the same as in SB EB2 (or was it not coincidence?). If I was more comprehensive, I would have also specified the antenna’s pad, in case any were moved between executions, but the weblog did not specify the pad.

  • minSNR: Minimum SNR of the solutions. If a solution has SNR below this threshold, then it (and the corresponding data) is flagged, and a statement is printed. For example:

3 of 41 solutions flagged due to SNR < 3 in spw=10 at 2022/07/17/14:31:53.5
7 of 36 solutions flagged due to SNR < 3 in spw=15 at 2022/07/19/12:12:23.5

Unfortunately there’s no way (that I know of) to access/save those printouts, so I just copy and paste them from the terminal into a script and count them up later. These printouts are one of the factors you use to decide whether to use the generated solutions. If using applymode='calflag' in applycal, then you lose that flagged data. To get a sense of what relative amount of data did not meet the minSNR, you could multiply [the total number of solution intervals found (depends on solint and number of scans)] x [the number of antennas] x [the number of spectral windows (depends on combine)].

  • gaintype: Could have used 'G', as we only have 1 polarization mode, but DSHARP uses 'T'.

  • calmode: Sets “phase” or “amplitude + phase” self-cal. We attempt 1 round of amplitude+phase self-cal.

  • scan: Selecting all scans.

  • num flagged solns: See minSNR above.

In the applycal task:

  • spw: Selecting all spectral windows.

  • applymode: Leaving as the default (''), which is 'calflag', meaning we apply the calibration and apply the flags. This is how we lose data (see minSNR above).

  • interp: The kind of interpolation to use between solutions. 'Linear' is the default. 'LinearPD' adds an additional term into the solve that accounts for the frequency-dependence if you have a large bandwidth. Ryan says in our case it’s overkill (“like using GR equations when in Newtonian regime”), but DSHARP uses it and I figured it doesn’t hurt.

  • spwmap: Leave this as '' if combine does not include 'spw'. If combine does include 'spw', then we need to tell applycal which SPWs of the calibration table to apply to which SPWs of the data.

In the tclean task:

  • imsize: Set to go out to the primary beam HWHM (~20 arcsec). In hindsight this should be the full FOV.

  • cellsize: Set to sample the beam with ~10 cells.

  • specmode: Set to 'mfs' to make a continuum image.

  • deconvolver: Hogbom (basis of delta functions) rather than multiscale (basis of Gaussians) for disks with rings.

  • weighting: Briggs, of course.

  • spw: Using all SPWs to create a continuum image (we want to include the line SPWs in the model generation).

  • robust: Taken to be 0.5 for the SB self-cal, as DSHARP did, but we increase to 1.0 for the SB+LB self-cal.

Achieved phase solutions as a function of time and antenna (the calibration tables)#

Both SB EB1 and SB EB2 were self-calibrated together, but the following movies show plots of the solutions separately (to be able to resolve the time axis).

How to retrieve the solutions from a CASA calibration table for plotting/manipulation in python?

The plotms task can save the contents of a plot as a text file! Just set the plotfile argument (str) to a file name that ends in .txt instead of .png or equivalent. The selfcal_utils.py script has functions that were used to extract relevant quantities from the calibration tables and make the figures below:

  • retrieve_from_caltable()

  • get_scan_start_and_end_times()

  • plot_gaincal_solutions()

  • plot_gaincal_solutions_per_antenna()

SB EB1#

SB EB2#

Images made after each round#

The following movie shows the continuum image achieved after each round of self-cal (with a large colour bar stretch to exaggerate faint emission).

The results, before and after#

SB-before-after