Until self-calibration is included in the VLA imaging pipeline it is sometime necessary to run it outside of the workspaces environment.
Step-by-step guide
- Copy the calibrated ms and flagversions table to the working directory in a work area.
- Edit the run_casa.sh and selfcal_script.py (see info box below) to use the current working directory and ms name.
- login to nmpost-master and submit the batch job (sbatch run_casa.sh)
- wait a few days
- The job should email you when done (it may claim the job has failed when in fact to ran OK).
- As vlapipe, move the contents of the project directory from the original workspaces directory for the imaging run somewhere safe (just in case..)
- As vlapipe, copy the contents of the new (with selcal) products directory to the original.
- In the original directory, gunzip the weblog.
- Make a note in the weblog by manually making and editing the qa_notes file in the weblog that the image has been self-calibrated. Also add an internal note that self-cal was performed.
- Submit for phase-2 review as usual
run_casa.sh:
#!/bin/sh
#Don't put any commands before the #SBATCH options or they will not work
#SBATCH --export ALL # Export all environment variables to the job.
#SBATCH --mem=64G # Amount of memory needed by the whole job.
#SBATCH -D /lustre/aoc/users/mlacy/srdp/selfcal/req1236/working # Working directory set to your Lustre area
#SBATCH --mail-type=END,FAIL # Send email when Jobs end or fail
# casa's python requires a DISPLAY for matplot, so create a virtual X server
xvfb-run /home/casa/packages/pipeline/casa-6.5.3-28-pipeline-2023.0.0.36/bin/casa --pipeline --nogui -c selfcal_script.py >& casa.out
selfcal_script.py:
# This CASA pipescript is meant for use with CASA 6.5.3 and pipeline 2023.1.0.42
context = h_init()
context.set_state('ProjectSummary', 'observatory', 'Karl G. Jansky Very Large Array')
context.set_state('ProjectSummary', 'telescope', 'EVLA')
try:
hifv_importdata(vis=['23A-157.sb44369379.eb44370721.60147.8327970949.ms'], datacolumns={'data': 'raw','corrected': 'regcal_contl
ine_all'})
hifv_flagtargetsdata(pipelinemode="automatic")
hif_mstransform(pipelinemode="automatic")
hif_checkproductsize(maximsize=16384)
hif_makeimlist(specmode='cont',datatype='regcal')
hif_makeimages(hm_cyclefactor=3.0)
hif_selfcal(pipelinemode="automatic")
hif_makeimlist(specmode='cont',datatype='selfcal')
hif_makeimages(hm_cyclefactor=3.0)
hifv_pbcor(pipelinemode="automatic")
hifv_exportdata(imaging_products_only=True)
finally:
h_save()