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 into a work area e.g. /lustre/aoc/sciops/<your dir>/<ws_request id>/working
- Edit run_casa.sh and selfcal_script.py (see info box below) to use the current working directory and ms name. These should also be stored in the working directory.
- login to nmpost-master and submit the batch job (from inside the working directory: "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 it ran OK).
- As vlapipe, move the contents of the project directory from the original workspaces directory for the imaging run to e.g. /lustre/aoc/sciops/<your dir>/old_<ws_request id> (just in case..). Note you need to keep them away from the paths workspaces uses (spool, image-qa in /lustre/aoc/cluster/pipeline/dsoc-prod/workspaces/...) otherwise ingest can fail.
- As vlapipe, copy the contents of the new (with selfcal) 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. Report the CASA version that was used for the self-cal process. Also add an internal note that self-cal was performed.
- Submit for phase-2 review as usual
- Clean up your working area once the job has passed QA and been ingested.
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.4-9-pipeline-2023.1.0.124/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_contline_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()