tile="o" vv=['tile_o/uid___A002_Xe07f3e_X5b5b_line.ms/','tile_o/uid___A002_Xe07f3e_X62a2_line.ms/'] center='ICRS 05:40:14.6668 -069.46.27.571' cyclefactor=1 tile="n" vv=['tile_n/uid___A002_Xe1142b_X24bb_line.ms', 'tile_n/uid___A002_Xe12e07_X1a70_line.ms', 'tile_n/uid___A002_Xe12e07_X23c8_line.ms', 'tile_n/uid___A002_Xe12e07_X48a1_line.ms'] center='ICRS 05:40:09.2844 -069.45.01.878' # for n, turn down the cyclefactor? otherwise it diverges in ch109 even in the standardmask clean. # 3 worked; didn't test if 2 would have. cyclefactor=3 tile="m" vv=['tile_m/uid___A002_Xe1645c_Xfcf_line.ms/','tile_m/uid___A002_Xe1645c_X18d4_line.ms/','tile_m/uid___A002_Xe16acd_X3d24_line.ms/'] cyclefactor=1.5 # just a little margin center="ICRS 05:40:04.0007 -069.43.36.729" tclean(vis=vv,selectdata=True, field='North_Molecular_Ridge', intent='OBSERVE_TARGET#ON_SOURCE', datacolumn='data', imagename='tile_'+tile+'_12CO21', imsize=[576, 270], cell=['1.2arcsec'], cyclefactor=cyclefactor, phasecenter=center, specmode='cube', nchan=240, start='210km/s', width='0.25km/s', outframe='LSRK', veltype='radio', restfreq="230.538GHz", perchanweightdensity=True, gridder='mosaic', mosweight=True, usepointing=False, pblimit=0.2, normtype='flatnoise', deconvolver='hogbom', restoration=True, restoringbeam='common', pbcor=True, weighting='briggsbwtaper', robust=0.5, niter=3000000, minpsffraction=0.05, maxpsffraction=0.8, interactive=0, usemask='auto-multithresh', sidelobethreshold=1.25, noisethreshold=5.0, lownoisethreshold=2.0, negativethreshold=0.0, smoothfactor=1.0, minbeamfrac=0.1, cutthreshold=0.01, growiterations=75, dogrowprune=True, minpercentchange=1.0, verbose=True, fastnoise=False, savemodel='none', psfcutoff=0.35, threshold="1.0Jy") b=imhead("tile_"+tile+"_12CO21.image")['restoringbeam'] imsmooth("tile_"+tile+"_12CO21.model",beam=b,targetres=True,outfile="tile_"+tile+"_12CO21.stdmask.model.conv") import numpy as np i=imhead("tile_"+tile+"_12CO21.image")['incr'] bmarea=b['major']['value']*b['minor']['value']/(206265*i[0])**2*np.pi/4/np.log(2) import matplotlib.pyplot as pl pl.ion() pl.clf() fmask=imstat("tile_"+tile+"_12CO21.image",mask='tile_'+tile+'_12CO21.mask',axes=[0,1,2])['flux'] pl.plot(fmask,label="flux in mask") fmodmask=imstat("tile_"+tile+"_12CO21.stdmask.model.conv",mask="tile_"+tile+"_12CO21.mask",axes=[0,1,2])['flux'] pl.plot(fmodmask,label="flux in model in mask") pl.plot(fmask-fmodmask,':') pl.plot(imstat("tile_"+tile+"_12CO21.residual",mask="tile_"+tile+"_12CO21.mask",axes=[0,1,2])['sum']/bmarea,label="flux in residual in mask") pl.legend(loc="best",prop={"size":8}) pl.ylabel("Jy") pl.savefig("tile_"+tile+"_12CO21.stdmask.th1Jy.flux_freq.png") imregrid("North_Molecular_Ridge_sci.spw17.cube.I.sd.box3.image/",template="tile_"+tile+"_12CO21.image",output="tile_"+tile+"_12CO21.TP.image") imtrans("tile_"+tile+"_12CO21.TP.image",order="0132",outfile="tile_"+tile+"_12CO21.TP.canon") immath(["tile_"+tile+"_12CO21.TP.canon","tile_"+tile+"_12CO21.pb"],expr="IM0*IM1",outfile="tile_"+tile+"_12CO21.TP.canon.timespb") import shutil shutil.copytree("tile_"+tile+"_12CO21.image","tile_"+tile+"_12CO21.origbeam.stdmask.image") feather("tile_"+tile+"_12CO21.origbeam.stdmask.7fT.image",highres="tile_"+tile+"_12CO21.origbeam.stdmask.image",lowres="tile_"+tile+"_12CO21.TP.canon.timespb") shutil.move("tile_"+tile+"_12CO21.mask","tile_"+tile+"_12CO21.mask.stdmask.th1Jy") imsmooth("tile_"+tile+"_12CO21.mask.stdmask.th1Jy",major="12arcsec",minor="12arcsec",pa="0deg",outfile="tile_"+tile+"_12CO21.mask.12asecsm") specsmooth("tile_"+tile+"_12CO21.mask.12asecsm",function="hanning",outfile="tile_"+tile+"_12CO21.mask.12asecsm.hann",dmethod="") immath("tile_"+tile+"_12CO21.mask.12asecsm.hann",expr="iif(IM0>.1,1,0)",outfile="tile_"+tile+"_12CO21.mask") tclean(vis=vv,selectdata=True, field='North_Molecular_Ridge', intent='OBSERVE_TARGET#ON_SOURCE', datacolumn='data', imagename='tile_'+tile+'_12CO21', imsize=[576, 270], cell=['1.2arcsec'], cyclefactor=cyclefactor, phasecenter=center, specmode='cube', nchan=240, start='210km/s', width='0.25km/s', outframe='LSRK', veltype='radio', restfreq="230.538GHz", perchanweightdensity=True, gridder='mosaic', mosweight=True, usepointing=False, pblimit=0.2, normtype='flatnoise', deconvolver='hogbom', restoration=True, restoringbeam='common', pbcor=True, weighting='briggsbwtaper', robust=0.5, niter=3000000, minpsffraction=0.05, maxpsffraction=0.8, interactive=0, usemask='auto-multithresh', sidelobethreshold=1.25, noisethreshold=5.0, lownoisethreshold=2.0, negativethreshold=0.0, smoothfactor=1.0, minbeamfrac=0.1, cutthreshold=0.01, growiterations=75, dogrowprune=True, minpercentchange=1.0, verbose=True, fastnoise=False, savemodel='none', psfcutoff=0.35, threshold="1.0Jy", calcpsf=False, calcres=False) imsmooth("tile_"+tile+"_12CO21.model",beam=b,targetres=True,outfile="tile_"+tile+"_12CO21.model.conv") pl.clf() fmask=imstat("tile_"+tile+"_12CO21.image",mask='tile_'+tile+'_12CO21.mask',axes=[0,1,2])['flux'] pl.plot(fmask,label="flux in mask") fmodmask=imstat("tile_"+tile+"_12CO21.model.conv",mask="tile_"+tile+"_12CO21.mask",axes=[0,1,2])['flux'] pl.plot(fmodmask,label="flux in model in mask") pl.plot(fmask-fmodmask,':') pl.plot(imstat("tile_"+tile+"_12CO21.residual",mask="tile_"+tile+"_12CO21.mask",axes=[0,1,2])['sum']/bmarea,label="flux in residual in mask") pl.legend(loc="best",prop={"size":8}) pl.ylabel("Jy") pl.savefig("tile_"+tile+"_12CO21.expandmask.th1Jy.flux_freq.png") # I think that's pretty good. could run down to 0.7Jy if we wanted. feather("tile_"+tile+"_12CO21.origbeam.7fT.image",highres="tile_"+tile+"_12CO21.origbeam.image",lowres="tile_"+tile+"_12CO21.TP.canon.timespb") # finally, 7" round: shutil.move("tile_"+tile+"_12CO21.image","tile_"+tile+"_12CO21.origbeam.image") tclean(vis=vv,selectdata=True, field='North_Molecular_Ridge', intent='OBSERVE_TARGET#ON_SOURCE', datacolumn='data', imagename='tile_'+tile+'_12CO21', imsize=[576, 270], cell=['1.2arcsec'], cyclefactor=cyclefactor, phasecenter=center, specmode='cube', nchan=240, start='210km/s', width='0.25km/s', outframe='LSRK', veltype='radio', restfreq="230.538GHz", perchanweightdensity=True, gridder='mosaic', mosweight=True, usepointing=False, pblimit=0.2, normtype='flatnoise', deconvolver='hogbom', restoration=True, pbcor=True, weighting='briggsbwtaper', robust=0.5, niter=0, interactive=0, calcpsf=False, calcres=False, restoringbeam="7arcsec") shutil.move("tile_"+tile+"_12CO21.image","tile_"+tile+"_12CO21.7asec.image") shutil.move("tile_"+tile+"_12CO21.image.pbcor","tile_"+tile+"_12CO21.7asec.image.pbcor") feather("tile_"+tile+"_12CO21.7asec.7fT.image",highres="tile_"+tile+"_12CO21.7asec.image",lowres="tile_"+tile+"_12CO21.TP.canon.timespb") immath(["tile_"+tile+"_12CO21.7asec.7fT.image","tile_"+tile+"_12CO21.pb"],expr="IM0/IM1",outfile="tile_"+tile+"_12CO21.7asec.7fT.image.pbcor") # exportfits("tile_"+tile+"_12CO21.7asec.7fT.image","tile_"+tile+"_12CO21.7asec.7fT.fits",dropdeg=True) # exportfits("tile_"+tile+"_12CO21.7asec.7fT.image.pbcor","tile_"+tile+"_12CO21.7asec.7fT.pbcor.fits",dropdeg=True) # tar -czvf /lustre/naasc/ALMA_Data_Delivery/public/2018.A.00061.S/tile_o_12CO21_image.tgz tile_o_12CO21.7asec.image tile_o_12CO21.7asec.7fT.image tile_o_12CO21.7asec.7fT.image.pbcor tile_o_12CO21.mask tile_o_12CO21.pb tile_o_12CO21.expandmask.th1Jy.flux_freq.png tile_o_12CO21.stdmask.th1Jy.flux_freq.png