### mv the cubes to the working directory os.system("mkdir "+dir_data+galname) os.system("mv "+dir_data+"data/"+galname+"*32*smooth "\ +dir_data+galname+"/"+galname+"_co32_"+suffix+".cube") ### step 6/10: create CO(2-1) cube mask print("### step 6/10: create CO(2-1) cube mask") cube_co32 = glob.glob(dir_data+galname+"/"\ +galname+"*_co32_"+suffix+".cube")[0] thres_co32 = rms_co32 * increment_mask * thres_masking outmask_co32=cube_co32.replace(".cube",".mask") myim2.createmask(cube_co32,thres_co32,outmask_co32) beamarea = myim2.beam_area(image_co32,increment_mask) myim2.remove_smallmask(outmask_co32,beamarea,pixelmin) ### mv to working directory os.system("rm -rf "+cube_co32) os.system("mv "+image_co32+" "+cube_co32) print("### step 9/10: immoments") myim2.moment_maps(cube_co32,chans,outmask_co32,rms_co32*thres_mom)
beam_mask = beam_size * increment_mask # beam size for the masking myim2.easy_imsmooth(image_co21, beam_mask, False) # co21 ### mv the cubes to the working directory os.system("mkdir " + dir_data + galname) os.system("mv "+dir_data+"data/"+galname+"*smooth "\ +dir_data+galname+"/"+galname+"_"+suffix+".cube") ### step 6/10: create CO(2-1) cube mask print("### step 6/10: create CO(2-1) cube mask") cube_co21 = glob.glob(dir_data+galname+"/"\ +galname+"_"+suffix+".cube")[0] thres_co21 = rms_co21 * increment_mask * thres_masking outmask_co21 = cube_co21.replace(".cube", ".mask") myim2.createmask(cube_co21, thres_co21, outmask_co21) beamarea = myim2.beam_area(image_co21, increment_mask) myim2.remove_smallmask(outmask_co21, beamarea, pixelmin) ### mv to working directory os.system("rm -rf " + cube_co21) os.system("mv " + image_co21 + " " + cube_co21) print("### step 9/10: immoments") myim2.moment_maps(cube_co21, chans, outmask_co21, rms_co21 * thres_mom) ### pbmask print("### step 10/10: pb mask at " + str(pbcut)) #mask_pb = dir_data+galname+"/"+galname+"_pb_"+suffix+".mask"
beam_mask = beam_size * increment_mask # beam size for the masking myim2.easy_imsmooth(image_co10, beam_mask, False) # co10 ### mv the cubes to the working directory os.system("mkdir " + dir_data + galname) os.system("mv "+dir_data+"data/"+galname+"*10*smooth "\ +dir_data+galname+"/"+galname+"_co10_"+suffix+".cube") ### step 6/10: create CO(2-1) cube mask print("### step 6/10: create CO(2-1) cube mask") cube_co10 = glob.glob(dir_data+galname+"/"\ +galname+"*_co10_"+suffix+".cube")[0] thres_co10 = rms_co10 * increment_mask * thres_masking outmask_co10 = cube_co10.replace(".cube", ".mask") myim2.createmask(cube_co10, thres_co10, outmask_co10) beamarea = myim2.beam_area(image_co10, increment_mask) myim2.remove_smallmask(outmask_co10, beamarea, pixelmin) ### mv to working directory os.system("rm -rf " + cube_co10) os.system("mv " + image_co10 + " " + cube_co10) print("### step 9/10: immoments") myim2.moment_maps(cube_co10, chans, outmask_co10, rms_co10 * thres_mom) ### pbmask print("### step 10/10: pb mask at " + str(pbcut)) #mask_pb = dir_data+galname+"/"+galname+"_pb_"+suffix+".mask"
beam_mask = beam_size * increment_mask # beam size for the masking myim2.easy_imsmooth(image_ci10, beam_mask, False) # ci10 ### mv the cubes to the working directory os.system("mkdir " + dir_data + galname) os.system("mv "+dir_data+"fits/"+galname+"*10*smooth "\ +dir_data+galname+"/"+galname+"_ci10_"+suffix+".cube") ### step 5/10: create CO(1-0) cube mask print("### step 5/10: create CI(1-0) cube mask") cube_ci10 = glob.glob(dir_data+galname+"/"\ +galname+"*_ci10_"+suffix+".cube")[0] thres_ci10 = rms_ci10 * increment_mask * thres_masking outmask_ci10 = cube_ci10.replace(".cube", ".mask") myim2.createmask(cube_ci10, thres_ci10, outmask_ci10) beamarea = myim2.beam_area(image_ci10, increment_mask) myim2.remove_smallmask(outmask_ci10, beamarea, pixelmin) ### step 8/10: imsmooth print("### step 8/10: imsmooth") myim2.easy_imsmooth(image_ci10, beam_size, True) # ci10 ### mv to working directory os.system("rm -rf " + cube_ci10) os.system("mv " + dir_data + "fits/" + galname + "*10*smooth " + cube_ci10) print("### step 9/10: immoments") myim2.moment_maps(cube_ci10, chans, outmask_ci10, rms_ci10 * thres_mom)
multiplier_co10 = 0.05 # peak * multiplier multiplier_co21 = 0.05 # peak * multiplier ##################### ### Main Procedure ##################### ### setup dir_data1 = dir_data + galname + "/" im_co10 = glob.glob(dir_data1 + galname + "*co10*" + suffix + "*m*0.fits")[0] im_co21 = glob.glob(dir_data1 + galname + "*co21*" + suffix + "*m*0.fits")[0] outmask_co10 = im_co10.replace(".moment0.fits", "_mom.mask") outmask_co21 = im_co21.replace(".moment0.fits", "_mom.mask") ### create mask for each moment map peak = imstat(im_co10)["max"][0] myim2.createmask(im_co10, peak * multiplier_co10, outmask_co10) peak = imstat(im_co21)["max"][0] myim2.createmask(im_co21, peak * multiplier_co21, outmask_co21) outfile = dir_data1 + galname + "_r21_" + suffix + ".mask" os.system("rm -rf " + outfile) immath(imagename=[outmask_co10, outmask_co21], mode="evalexpr", expr="IM0*IM1", outfile=outfile) makemask(mode="copy", inpimage=outfile, inpmask=outfile, output=outfile + ":mask0", overwrite=True)