auto_selfcal#
- auto_selfcal.auto_selfcal(vislist=[], spectral_average=True, do_amp_selfcal=True, usermask={}, usermodel={}, inf_EB_gaincal_combine='scan', inf_EB_gaintype='G', inf_EB_override=False, optimize_spw_combine=True, gaincal_minsnr=2.0, gaincal_unflag_minsnr=5.0, minsnr_to_proceed=2.95, spectral_solution_fraction=0.25, delta_beam_thresh=0.05, apply_cal_mode_default='calflag', unflag_only_lbants=False, unflag_only_lbants_onlyap=False, calonly_max_flagged=0.0, second_iter_solmode='', unflag_fb_to_prev_solint=False, rerank_refants=False, allow_gain_interpolation=False, guess_scan_combine=False, aca_use_nfmask=False, allow_cocal=False, scale_fov=1.0, rel_thresh_scaling='log10', dividing_factor=-99.0, check_all_spws=False, apply_to_target_ms=False, uvcontsub_target_ms=False, sort_targets_and_EBs=False, run_findcont=False, debug=False, parallel=False, weblog=True, **kwargs)#
Main function to run the self-calibration pipeline.
- Parameters:
- visliststr or list, optional
A string or list of strings containing the names of the measurement sets to be processed.
- spectral_averagebool, optional
If True, spectral averaging will be performed on the data before self- calibration.
- do_amp_selfcalbool, optional
If True, amplitude self-calibration will be performed.
- usermaskdict, optional
A dictionary containing user-defined masks for specific targets and bands. The keys should be target names, and the values should be dictionaries with band names as keys and mask file names as values, for example,
usermask={'IRAS32':{'Band_6':'IRAS32.rgn'}, 'IRS5N':{'Band_6': 'IRS5N.rgn'}}.
The mask files are required to be CRTF regions (CASA region format). If multiple sources are present in a MS and only want to use a mask for one, just specify that source. The keys for remaining sources will be filled with empty strings.
NOTE: THE DICTIONARY HEIRARCHY HAS CHANGED FROM PREVIOUS VERSIONS, NOW IT IS [TARGET][BAND] INSTEAD OF [BAND][TARGET]
- usermodeldict, optional
A dictionary containing user-defined models for specific targets and bands. The keys should be target names, and the values should be dictionaries with band names as keys and model file names as values, for example,
usermodel={'IRAS32':{'Band_6':['IRAS32-model.tt0', 'IRAS32-model.tt1']}, 'IRS5N':{'Band_6'['IRS5N-model.tt0', 'IRS5N-model.tt1']}}.
If the model name includes .fits, auto_selfcal will assume it is a fits image, otherwise it assumes a CASA image. For a multi-term image, input the term images as a list i.e.,
usermodel=['usermodel.tt0','usermodel.tt1'].
If multiple sources are present in a dataset and a model is being supplied for only a subset, just specify the models for those sources and exclude sources for which auto_selfcal should derive a model. The keys for remaining sources will be filled with empty strings.
NOTE: THE DICTIONARY HEIRARCHY HAS CHANGED FROM PREVIOUS VERSION, NOW IT IS [TARGET][BAND] INSTEAD OF [BAND][TARGET]
- inf_EB_gaincal_combinestr, optional
The method for combining gain calibration solutions for inf_EB. Default is ‘scan’.
- inf_EB_gaintypestr, optional
The type of gain calibration to use for inf_EB. Default is ‘G’.
- inf_EB_overridebool, optional
If True, will override the inf_EB settings in the self-calibration library.
- optimize_spw_combinebool, optional
If True, will attempt to optimize (per-baseband, per-spw, spw mapping) the spw combination for solution intervals beyond the inf_EB solution interval.
- gaincal_minsnrfloat, optional
The minimum SNR for gain calibration solutions; solutions below this SNR will be flagged. Default is 2.0.
- gaincal_unflag_minsnrfloat, optional
The minimum SNR for gain calibration solutions during the beam-size fallback mode; solutions below this SNR will be flagged. Default is 5.0.
- minsnr_to_proceedfloat, optional
The minimum SNR, per solution interval per antenna, required to proceed with the next iteration of self-calibration. Default is 2.95.
- spectral_solution_fractionfloat, optional
The fraction of the spectral range to use for spectral solutions. Default is 0.25.
- delta_beam_threshfloat, optional
The threshold fraction for the change in beam size to consider a significant change. If the beam size grows by more than this value self-calibration will fail, and on the first failure per solint the beam-size fallback mode will be invoked. Default is 0.05.
- apply_cal_mode_defaultstr, optional
The default mode for applying calibration solutions. Default is ‘calflag’.
- unflag_only_lbantsbool, optional
If True, will only unflag antennas identified as long-baseline during the beam-size fallback mode.
- unflag_only_lbants_onlyapbool, optional
If True, will only unflag antennas identified as long-baseline during the beam-size fallback mode, and only during solution intervals performing amplitude self-calibration.
- calonly_max_flaggedfloat, optional
The maximum fraction of flagged data allowed for calonly solutions. Default is 0.0.
- second_iter_solmodestr, optional
The gaincal solution mode for the second iteration of self- calibration. Enables passing alternative optimization metrics to the gaincal method, such as ‘L1’, ‘R’, or ‘L1R’.
- unflag_fb_to_prev_solintbool, optional
If True, when in the beam-size fallback mode, antennas identified as long-baseline and also as having significant flagging will use gain solutions from the last solint in which the antenna was successfully calibrated, rather than having the gain solutions set to 1+0j.
- rerank_refantsbool, optional
If True, will re-rank the reference antennas list based on their performance during self-calibration.
- allow_gain_interpolationbool, optional
During mosaic self-calibration, setting this to True will allow solutions from successful sub-fields to be applied to unsuccessful sub-fields via interpolation.
- guess_scan_combinebool, optional
If True, auto_selfcal will attempt to guess at which mosaic scans on a target fall between successive gain calibrator scans for the scan_inf solint, and will combine the gaincal solutions for these scans. If False, scans will all be treated individually.
- aca_use_nfmaskbool, optional
If True, will use the near-field mask statistics when evaluating ACA data.
- allow_cocalbool, optional
If True, will allow a fallback self-calibration mode where the inf_EB and inf solutions for targets with successful self-calibration solutions will be applied to fields with unsuccessful self-calibration solutions.
- scale_fovfloat, optional
Scale factor for the field of view imaged within tclean. Default is 1.0 (no scaling).
- rel_thresh_scalingstr, optional
How the thresholds for tclean should scale across the solution intervals. Options are ‘linear’, ‘log10’, or ‘loge’ (natural log). Default is ‘log10’.
- dividing_factorfloat, optional
The factor by which the peak SNR is divided to determine the first clean threshold. Default is -99.0, which uses the default values (40 for <8 GHz and 15 for others).
- check_all_spwsbool, optional
If True, will generate per-spw initial and final images to check phase transfer did not go poorly for narrow windows.
- apply_to_target_msbool, optional
If True, will apply the final self-calibration solutions back to the input _target.ms files.
- uvcontsub_target_msbool, optional
If True, will perform continuum subtraction on the input _target.ms files after the application of the self-calibration solutions.
- sort_targets_and_EBsbool, optional
If True, will sort targets and execution blocks (EBs) alphabetically before processing.
- run_findcontbool, optional
If True, will run the hif_findcont task to identify continuum windows. Only available when run within CASA distributions where the pipeline is installed.
- debugbool, optional
If True, will print debug information during processing.
- parallelbool, optional
If True, will run tasks in parallel where possible.
- weblogbool, optional
If True, will create a weblog that provides information on how the self-calibration process proceeded.
- **kwargsdict, optional
Additional keyword arguments to pass to the self-calibration functions.
- Returns:
- None