## I-TRAIN #1 Imaging with the ALMA Pipeline ## D Tafoya, LT Maud, E Moravec, MC Toribio ## contact@nordic-alma.se ## This file provides general commands to follow the tutorial. Most lines have been commented out. Use at your convenience. ## References: https://casaguides.nrao.edu/index.php/ALMA_Imaging_Pipeline_Reprocessing ##================================================= ##Preparations ##Extract your tar file #tar -xvf 2018.1.01201.S.PLtutorial.tar.gz ##Descend the folder tree: #cd 2018.1.01201.S/science_goal.uid___A001_X133d_X2c85/group.uid___A001_X133d_X2c86/member.uid___A001_X133d_X2c8b/calibrated/working #================================================== ##Launch CASA from your terminal: #casapy -- pipeline # depends on your alias setup import glob import os ##Set up environment for the pipeline: __rethrow_casa_exceptions = True context = h_init() ## Delete uid*_target.ms and flagversions if it exists os.system('rm -rf uid*_target.ms') os.system('rm -rf uid*_target.ms.flagversions') ##List all MS in folder: #MyVis=glob.glob('*ms') ##Imaging Pipeline steps: try: #hifa_importdata(vis=MyVis,dbservice=False) #hif_mstransform(pipelinemode="automatic") ##OPTIONAL: If you want to use existing target flags, run the next line: #os.system('cp ../../calibration/*.flagtargetstemplate.txt ./*.flagtargetstemplate.txt) #hifa_flagtargets(pipelinemode="automatic") ##Calculate effective beams and theoretical noise for different robust parameters before imaging: #hifa_imageprecheck(pipelinemode="automatic") ##Generate image parameters: #hif_makeimlist(specmode='mfs') ##Continuum ##OPTIONAL: If you want to use the existing continuum selection, run the next line: #os.system('cp ../../calibration/cont.dat ./cont.dat') #hif_findcont(pipelinemode="automatic") ##Finds continuum #hif_uvcontfit(pipelinemode="automatic") ##Fits continuum #hif_uvcontsub(pipelinemode="automatic") ##Subtracts continuum ##Imaging #hif_makeimages(pipelinemode="automatic") #hif_makeimlist(specmode='cont') #hif_makeimages(pipelinemode="automatic") #hif_makeimlist(specmode='cube') #hif_makeimages(pipelinemode="automatic") #Export images to FITS #hifa_exportdata(imaging_products_only=True) finally: #Save pipeline environment: h_save()