caracal-pipeline / caracal

Containerized Automated Radio Astronomy Calibration (CARACal) pipeline
GNU General Public License v2.0
28 stars 6 forks source link

scan selection for solving (SPR1-1177 workaround) #1391

Closed bennahugo closed 2 years ago

bennahugo commented 2 years ago

Implementing this as workaround for SPR1-1177 ([JIRA] (SPR1-1177) For 2s dump, there is a mislabelling of scans in katdal) for @Sinah-astro

bennahugo commented 2 years ago

Context - not enough to flag scans mislabelled as tracking by katdal - the interpolation will be flagging the scan immediately next to the flagged 1-2 dump scan if the flagged scan is used in solving. This implements deselection during solving routines in transfer calibration

bennahugo commented 2 years ago

PR incoming

Verified that for

schema_version: 1.0.3

general:
  prefix: mypipelinerun

getdata:
  dataid: ['1491291289.1ghz.1.1ghz.4hrs']
  extension: ms

obsconf:
  refant: '0'

transform:
  enable: true
  field: calibrators
  label_out: cal
  split_field:
    enable: true
    col: data

prep:
  enable: true
  label_in: cal
  field: calibrators

crosscal:
  enable: true
  label_in: cal
  set_model:
    enable: true
    meerkat_skymodel: false
  primary:
    order: KGB
    calmode: [p, ap, ap]
    solint: [inf, inf, inf]
    combine: ["","",scan]
    scanselection: "2"
  secondary:
    order: KF
    calmode: [p, ap]
    solint: [inf, inf]
    combine: ["",""]
    scanselection: "2~9"
  apply_cal:
    applyto:
      - gcal
      - bpcal
  report: true

I get e.g gain calibrator:

# --> CrashReporter initialized.
# 2021-11-29 20:00:10   INFO    gaincal::::
# 2021-11-29 20:00:10   INFO    gaincal::::+    ##########################################
# 2021-11-29 20:00:10   INFO    gaincal::::+    ##### Begin Task: gaincal            #####
# 2021-11-29 20:00:10   INFO    gaincal::::     gaincal(vis="/stimela_mount/msdir/1491291289.1ghz.1.1ghz.4hrs-cal.ms",caltable="/stimela_mount/output/mypipelinerun-1491291289.1ghz.1.1ghz.4hrs-1gc1_secondary.K0",field="0408-65,0252-712",spw="",intent="",
# 2021-11-29 20:00:10   INFO    gaincal::::+            selectdata=True,timerange="",uvrange="",antenna="",scan="2~9",
...

bandpass calibrator

# 2021-11-29 19:59:51   INFO    bandpass::::
# 2021-11-29 19:59:51   INFO    bandpass::::+   ##########################################
# 2021-11-29 19:59:51   INFO    bandpass::::+   ##### Begin Task: bandpass           #####
# 2021-11-29 19:59:51   INFO    bandpass::::    bandpass(vis="/stimela_mount/msdir/1491291289.1ghz.1.1ghz.4hrs-cal.ms",caltable="/stimela_mount/output/mypipelinerun-1491291289.1ghz.1.1ghz.4hrs-1gc1_primary.B0",field="0408-65",spw="",intent="",
# 2021-11-29 19:59:51   INFO    bandpass::::+           selectdata=True,timerange="",uvrange=['>50'],antenna="",scan="2",