SRDP > Self-calibration Preview

Self-calibration Preview

The SRDP project is pleased to announce the release of ALMA and VLA imaging pipelines that include a new task to perform self-calibration of the science targets (hif_selfcal). We expect that the imaging pipeline will function properly in most circumstances; however, this CASA and pipeline package is not fully validated for automated data processing in operations by the ALMA and VLA staff. It has been tested most completely for use with the ALMA User-Defined Imaging (AUDI) capability.

This initial implementation of automated self-calibration heuristics is specifically intended for single pointing observations; mosaics and spectral scans will be supported in a future release (see Standalone tools). The heuristics are expected to perform well on datasets that have modest to high signal-to-noise (S/N), dependent upon the distribution of flux as a function of uv-distance. Long-baseline data can be successfully self-calibrated, depending on how much flux is present at the longest baselines. Heuristics to better optimize self-calibrations of long baselines will be addressed in a future release.

We plan to use self-calibration as part of the standard workflow with the Fall 2023 pipeline release for the VLA imaging pipeline. The ALMA imaging pipeline will not use self-calibration by default in the Fall 2023 release, but more widespread testing will be conducted with the goal of bringing it into operations in Fall 2024.

Quick Access to AUDI in the NRAO Archive:

Link to the CASA+Pipeline tarball including selfcal: casa-6.5.3-28-pipeline-2023.0.0.36

Example Results from Automated Self-calibration

Without Self-calibrationWith Self-calibration

ALMA Band 6 images of the NGC 2071 IR star forming region from ALMA project 2018.1.01038.S (Cheng et al. 2022). The left image is without self-calibration, while the right image is from the automated self-calibration within the pipeline.

ALMA User-Defined Imaging Workflow

AUDI requests will attempt phase-only self-calibration by default, and if self-calibration is successful, both the non-self-calibrated and the self-calibrated images will be delivered to users. If self-calibration is unsuccessful, only the non-self-calibrated images are delivered. By design the AUDI workflows operate on only a single source and produce a single data cube per request. The self-calibration solutions are applied to both the continuum and spectral line data. In many cases, self-calibration primarily benefits the continuum data and the impact to the line data is negligible because the line emission is generally too faint to be dynamic range limited.

Self-calibration solutions are applied using applycal(applymode='calflag') which means that flagged gain solutions will result in data being flagged. After each self-calibration solution interval the S/N is verified to ensure that there is a net gain from that self-calibration interval and it is ensured that the beam has not increased by more than 5% in beam area from the pre-self-calibration image. If S/N decreases or the beam changes by > 5%, that solution interval is regarded as 'failed' and the last successful solution interval is restored.

When self-calibration is conducted with applycal(applymode='calflag'), the line data cube can have a marginally higher RMS due to the flagging applied. Users will have the ability choose whether the cube with or without self-calibration applied better suits their needs.

Interactive Pipeline Usage

The only officially validated workflow with self-calibration is AUDI; however, it is possible for users to make use of self-calibration in interactive use with the ALMA and VLA imaging pipelines. In such a usage mode, self-calibration also supports:

    • Multi-source data
    • Multi-band data (VLA only)
    • Parameters to make self-calibration more permissive/restrictive

Example ALMA imaging pipeline script:

# This CASA pipescript is meant for use with CASA 6.5.3 and pipeline 2023.0.0.36
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Atacama Large Millimeter/submillimeter Array')
context.set_state('ProjectSummary', 'telescope', 'ALMA')
    hifa_importdata(vis=['',''], session=['session_1','session_2'], datacolumns={'data': 'raw','corrected': 'regcal_contline_all'})
    hif_makeimlist(specmode='cont', datatype='selfcal')

Example VLA imaging pipeline script:

# This CASA pipescript is meant for use with CASA 6.5.3 and pipeline 2023.0.0.36
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Karl G. Jansky Very Large Array')
context.set_state('ProjectSummary', 'telescope', 'EVLA')
    hifv_importdata(vis=[''], datacolumns={'data': 'raw','corrected': 'regcal_contline_all'})

Task Parameters

We list the most relevant parameters here that users may want to experiment with, the less relevant parameters are listed below the line.

  • field (string) - field names to self-calibrate e.g., "HL_Tau"; default = "" which will self-calibrate all sources
  • apply_cal_mode_default (string) -  Apply mode to use for applycal task during self-calibration; default = 'calflag'; options: 'calflag' ,'calonly', 'calflagstrict'
  • amplitude_selfcal (boolean) - Attempt amplitude self-calibration following phase-only self-calibration; default = False
  • gaincal_minsnr (float) - Minimum S/N for a solution to not be flagged by gaincal; default = 2.0
  • minsnr_to_proceed (float) - Minimum estimated self-cal S/N computed on a per solution interval, per per antenna basis, used to determine whether to attempt self-calibration for a source at a given solution interval; default = 3.0
  • delta_beam_thresh (float) - Allowed fractional change in beam area for self-calibration to accept results of a solution interval; default = 0.05

Less relevant parameters to adjust:

  • rel_thresh_scaling (string) - Scaling type to determine how clean thresholds per solution interval should be determined going from the starting clean threshold to 3.0 * RMS for the final solution interva'; default='log10', options: 'linear', 'log10', or 'loge' (natural log)
  • dividing_factor (float) - Scaling factor to determine clean threshold for first self-calibration solution interval. Equivalent to (Peak S/N / dividing_factor) *RMS = First clean threshold;  however, if (Peak S/N / dividing_factor) *RMS is < 5.0; a value of 5.0 is used for the first clean threshold. default = 40.0 for < 8 GHz; 15.0 for > 8 GHz
  • check_all_spws (boolean) - The S/N of mfs images created on a per-spectral-window basis will be compared; default=False
  • inf_EB_gaincal_combine (boolean) -If True, the gaincal combine parameter will be set to 'scan,spw'; if False, the gaincal combine parameter will be set to 'scan'; default=False; the only applies to the first solution interval that is computed over the length of an entire Execution Block
  • spw (string)- spectral windows to self-calibrate; default = ""; all science spws will be self-calibrated
  • apply (boolean) - apply final selfcal solutions back to the input Measurement Sets; default = True


Standalone self-calibration tools

The ALMA/VLA imaging pipeline implementations of self-calibration are based on the standalone automated self-calibration implementations developed by John Tobin and Patrick Sheehan. Users interested in further investigation/customization of the detailed heuristics can access the code on github. Note that the tunable parameters for the standalone versions might have different names than those listed above. Also, there may be new parameters and some parameters that have been removed, see the documentation for the specific standalone versions.

Stable Version (heuristics used by current pipeline):

The development version has new heuristics improvements to better handle lower S/N long-baseline data, initial support for mosaics, and spectral scan support. The development version is the basis for pipeline improvements for the Fall 2023 release. Branches from the development version also host further heuristic development.

Development Version:



We acknowledge the adaptation of some routines and methodology published by the DSHARP (Andrews et al. 2018) and eDisk (Ohashi et al. 2023) ALMA large programs in the development of the automated self-calibration procedures. Some code from these projects is reused in the standalone and pipeline implementations of self-calibration. The development and implementation of self-calibration was a joint effort between the NRAO SRDP Project, the ALMA Pipeline Working Group, and the ALMA and NRAO pipeline development teams.


Help with SRDP and self-calibration:

Please visit the NRAO helpdesk and submit a ticket under the ‘Data Products’ Topic.