## Edit the USER SET INPUTS section below and then execute ## this script (note it must be in the 'calibrated/working' directory. import glob as glob __rethrow_casa_exceptions = True pipelinemode='automatic' context = h_init() ########################################################### ## USER SET INPUTS ## Select a title for the weblog context.project_summary.proposal_code = 'SUBSET CUBE IMAGING' ## Delete uid*_targets.ms and flagversions if it exists os.system('rm -rf uid*_targets.ms') os.system('rm -rf uid*_targets.ms.flagversions') os.system('rm -rf uid*_targets_line.ms') os.system('rm -rf uid*_targets_line.ms.flagversions') ## Select spw(s) to image and channel binning for each spcified ## MySpw. All spws listed in MySpw must have a corresponding MyNbins ## entry, even if it is 1 for no binning. MySpw='16' MyNbins='16:4' ## Select subset of sources to image by field name. ## To select all fields, set MyFields='' MyFields='IC1528' ## Select Briggs Robust factor for data weighting (affects angular ## resolution of images) MyRobust=1.5 ############################################################ ## Make a list of all uv-datasets appended with *.ms MyVis=glob.glob('*.ms') try: ## Load the *.ms files into the pipeline hifa_importdata(vis=MyVis, dbservice=False, pipelinemode=pipelinemode) ## Split off the science target data into its own ms (called ## *targets.ms) and apply science target specific flags ## In this example we split off all science targets and science ## spws, however hif_mstransform could also contain the spw and field ## selections hif_mstransform(pipelinemode=pipelinemode) hifa_flagtargets(pipelinemode=pipelinemode) ## Fit and subtract the continuum using existing cont.dat ## for selected spws and fields only. #hif_makeimlist(specmode='mfs') hif_uvcontsub(spw=MySpw,field=MyFields,pipelinemode=pipelinemode) #hif_makeimages(pipelinemode=pipelinemode) ## calculate the synthesized beam and estimate the sensitivity ## for the aggregate bandwidth and representative bandwidth ## for three values of the robust parameter. ## Don't need to run this task if you will use a different robust value anyway. ## hifa_imageprecheck(pipelinemode=pipelinemode) ## check the imaging product size and adjust the relevent ## imaging parameters (channel binning, cell size and image size) ## User can comment this out if they don't want size mitigation. #hif_checkproductsize(maxproductsize=350.0, maxcubesize=40.0, maxcubelimit=60.0) ## Make new continuum subtracted cube for selected spw(s) and fields hif_makeimlist(specmode='cube',spw=MySpw,nbins=MyNbins,field=MyFields,robust=MyRobust, pipelinemode=pipelinemode) hif_makeimages(pipelinemode=pipelinemode) ## Export new images to fits format if desired. hifa_exportdata(pipelinemode=pipelinemode) finally: h_save()