#=====# # SCRIPT TO IMAGE THE CALIBRATED MEASUREMENT SET # uid___A002_Xbff114_X4684.split.cal FOR THE # MASSIVE STAR FORMING SOURCE IRAS13481-6124 # Generated by A.Avison using the ALMA IMAGIN SCRIPT GENERATOR # THIS IS A GENERIC IMAGING SCRIPT AND NEED SIGNIFICANT USER INPUT # IT WAS GENERATED FOR USE AT THE DUBLIN INTERFEROMETRIC DATA # REDUCTION WORKSHOP 10-12 SEP 2018 BUT IS PROVIDED WITH NO TUTORIAL # ACCOMPANIMENT AS A BONUS REDUCTION EXERCISE. #=====# # ALMA Data Reduction Script # Imaging thesteps = [] step_title = {0: 'Agg. bandwidth image for non-science target J1337-6509 (intent OBSERVE_CHECK_SOURCE), spws [0, 1, 2, 3, 4]', 1: 'Continuum image for target IRAS13481-6124, spws [0, 1, 2, 3, 4]', 2: 'Continuum subtraction for field IRAS13481-6124', 3: 'Cube for target IRAS13481-6124, spw 0', 4: 'Cube for target IRAS13481-6124, spw 1', 5: 'Cube for target IRAS13481-6124, spw 2', 6: 'Cube for target IRAS13481-6124, spw 3', 7: 'Cube for target IRAS13481-6124, spw 4', 8: 'Export images to FITS format'} if 'applyonly' not in globals(): applyonly = False try: print 'List of steps to be executed ...', mysteps thesteps = mysteps except: print 'global variable mysteps not set.' if (thesteps==[]): thesteps = range(0,len(step_title)) print 'Executing all steps: ', thesteps # The Python variable 'mysteps' will control which steps # are executed when you start the script using # execfile('scriptForCalibration.py') # e.g. setting # mysteps = [2,3,4]# before starting the script will make the script execute # only steps 2, 3, and 4 # Setting mysteps = [] will make it execute all steps. thevis = ['uid___A002_Xbff114_X4684.ms.split.cal'] # put restfreqs in this dictionary, # one for each SPW ID, e.g. {17: '350GHz', 19: '356GHz'} therestfreqs = {0: '346614.0962MHz', 1: '344781.0962MHz', 2: '356778.4412MHz', 3: '356299.7119MHz', 4: '358544.4077MHz'} # Agg. bandwidth image for non-science target J1337-6509 (intent OBSERVE_CHECK_SOURCE), spws [0, 1, 2, 3, 4] mystep = 0 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf J1337-6509_chk.spw0_1_2_3_4.mfs.I.manual*') tclean(vis = thevis, imagename = 'J1337-6509_chk.spw0_1_2_3_4.mfs.I.manual', field = 'J1337-6509', stokes = 'I', spw = '0,1,2,3,4', outframe = 'LSRK', specmode = 'mfs', nterms = 1, imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '', interactive = True ) # Continuum image for target IRAS13481-6124, spws [0, 1, 2, 3, 4] mystep = 1 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw0_1_2_3_4.cont.I.manual*') tclean(vis = thevis, imagename = 'IRAS13481-6124_sci.spw0_1_2_3_4.cont.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '0,1,2,3,4', outframe = 'LSRK', specmode = 'cont', nterms = 1, imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '', interactive = True ) # NOTE: enter the continuum channel selection in the spw parameter! # Continuum subtraction for field IRAS13481-6124 mystep = 2 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] uvcontsub(vis = 'uid___A002_Xbff114_X4684.ms.split.cal', field = 'IRAS13481-6124', spw = '0,1,2,3,4', fitspw = '', fitorder = 1, solint = 'int', combine = '', excludechans = False, want_cont = False ) os.system('rm -rf uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub') os.system('mv uid___A002_Xbff114_X4684.ms.split.cal.contsub uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub') # Cube for target IRAS13481-6124, spw 0 mystep = 3 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw0.cube.I.manual*') tclean(vis = 'uid___A002_Xbff114_X4684.ms.split.cal',#_IRAS13481-6124.contsub imagename = 'IRAS13481-6124_sci.spw0.cube.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '0', outframe = 'LSRK', restfreq = therestfreqs[0], specmode = 'cube', imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '0.1mJy', width = 1, start = '', # native number of channels > 1000 (not taking into account width parameter) nchan = -1, # use ms.cvelfreqs to check; possibly constrain start and nchan to speed up processing interactive = True ) # Cube for target IRAS13481-6124, spw 1 mystep = 4 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw1.cube.I.manual*') tclean(vis = 'uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub', imagename = 'IRAS13481-6124_sci.spw1.cube.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '1', outframe = 'LSRK', restfreq = therestfreqs[1], specmode = 'cube', imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '0.1mJy', width = 1, start = '', # native number of channels > 1000 (not taking into account width parameter) nchan = -1, # use ms.cvelfreqs to check; possibly constrain start and nchan to speed up processing interactive = True ) # Cube for target IRAS13481-6124, spw 2 mystep = 5 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw2.cube.I.manual*') tclean(vis = 'uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub', imagename = 'IRAS13481-6124_sci.spw2.cube.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '2', outframe = 'LSRK', restfreq = therestfreqs[2], specmode = 'cube', imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '0.1mJy', width = 1, nchan = -1, interactive = True ) # Cube for target IRAS13481-6124, spw 3 mystep = 6 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw3.cube.I.manual*') tclean(vis = 'uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub', imagename = 'IRAS13481-6124_sci.spw3.cube.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '3', outframe = 'LSRK', restfreq = therestfreqs[3], specmode = 'cube', imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '0.1mJy', width = 1, nchan = -1, interactive = True ) # Cube for target IRAS13481-6124, spw 4 mystep = 7 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] os.system('rm -rf IRAS13481-6124_sci.spw4.cube.I.manual*') tclean(vis = 'uid___A002_Xbff114_X4684.ms.split.cal_IRAS13481-6124.contsub', imagename = 'IRAS13481-6124_sci.spw4.cube.I.manual', field = 'IRAS13481-6124', stokes = 'I', spw = '4', outframe = 'LSRK', restfreq = therestfreqs[4], specmode = 'cube', imsize = [540, 540], cell = '0.046arcsec', deconvolver = 'hogbom', niter = 100, weighting = 'briggs', robust = 0.5, mask = '', gridder = 'standard', pbcor = True, threshold = '0.1mJy', width = 1, start = '', # native number of channels > 1000 (not taking into account width parameter) nchan = -1, # use ms.cvelfreqs to check; possibly constrain start and nchan to speed up processing interactive = True ) # Export images to FITS format mystep = 8 if(mystep in thesteps): casalog.post('Step '+str(mystep)+' '+step_title[mystep],'INFO') print 'Step ', mystep, step_title[mystep] myimages = ['IRAS13481-6124_sci.spw0.cube.I.manual', 'IRAS13481-6124_sci.spw0_1_2_3_4.cont.I.manual', 'IRAS13481-6124_sci.spw1.cube.I.manual', 'IRAS13481-6124_sci.spw2.cube.I.manual', 'IRAS13481-6124_sci.spw3.cube.I.manual', 'IRAS13481-6124_sci.spw4.cube.I.manual', 'J1337-6509_chk.spw0_1_2_3_4.mfs.I.manual'] for myimagebase in myimages: exportfits(imagename = myimagebase+'.image.pbcor', fitsimage = myimagebase+'.pbcor.fits', overwrite = True ) exportfits(imagename = myimagebase+'.pb', fitsimage = myimagebase+'.pb.fits', overwrite = True )