+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)



### pbmask
print("### step 10/10: pb mask at " + str(pbcut))


mask_pb = dir_data+galname+"/"+galname+"_pb_"+suffix+".mask"
peak = imhead(pbimage,mode="list")["datamax"]
myim2.createmask(pbimage,peak*pbcut,mask_pb)

os.chdir(dir_data+galname)
ia.open(glob.glob("*pb*mask")[0])
ia.calcmask(mask=glob.glob("*pb*mask")[0]+">0",
            name=glob.glob("*pb*mask")[0]+".2")
Exemplo n.º 2
0
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"
#peak = imhead(pbimage,mode="list")["datamax"]
#myim2.createmask(pbimage,peak*pbcut,mask_pb)

#os.chdir(dir_data+galname)
#ia.open(glob.glob("*pb*mask")[0])
#ia.calcmask(mask=glob.glob("*pb*mask")[0]+">0",
#            name=glob.glob("*pb*mask")[0]+".2")
#ia.close()
#os.chdir("/Users/saito/data/mycasaimaging_scripts/scripts_image_phangs2")
Exemplo n.º 3
0
myim2.remove_smallmask(mask_combine, beamarea, pixelmin)
"""
### step 8/10: imsmooth
print("### step 8/10: imsmooth")

myim2.easy_imsmooth(image_co32,beam_size,False) # co32
myim2.easy_imsmooth(image_co21,beam_size,False) # co21
"""

### mv to working directory
os.system("rm -rf " + cube_co32)
os.system("rm -rf " + cube_co21)
os.system("cp -r " + dir_data + "data/" + galname + "*co32* " + cube_co32)

print("### step 9/10: immoments")
myim2.moment_maps(cube_co32, chans, mask_combine, rms_co32 * thres_mom)

### pbmask
print("### step 10/10: pb mask at " + str(pbcut))

images_moment = glob.glob(cube_co32 + ".moment*")
images_moment.extend(glob.glob(cube_co21 + ".moment*"))
for i in range(len(images_moment)):
    os.system("rm -rf " + outfile)
    imagename = images_moment[i]
    outfile = images_moment[i].replace(".ICRS", "").replace(".cube.", "")
    imregrid(imagename=imagename, template="J2000", output=outfile)
    os.system("rm -rf " + imagename)

    # exportfits
    os.system("rm -rf " + outfile + ".fits")
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)

### pbmask
print("### step 10/10: pb mask at " + str(pbcut))

pbimage = glob.glob(dir_data + "fits/" + galname + "*.pb")[0]
mask_pb = dir_data + galname + "/" + galname + "_ci10_" + suffix + "_pb.mask"
peak = imhead(pbimage, mode="list")["datamax"]
myim2.createmask(pbimage, peak * pbcut, mask_pb)

images_moment = glob.glob(cube_ci10 + ".moment*")
for i in range(len(images_moment)):
    outfile = images_moment[i].replace(".cube", "")
    os.system("rm -rf " + outfile)
    immath(imagename=[images_moment[i], mask_pb],
           mode="evalexpr",
Exemplo n.º 5
0
myim2.remove_smallmask(mask_combine, beamarea, pixelmin)

### step 8/10: imsmooth
print("### step 8/10: imsmooth")

myim2.easy_imsmooth(image_co10, beam_size, False)  # co10
myim2.easy_imsmooth(image_co21, beam_size, False)  # co21

### mv to working directory
os.system("rm -rf " + cube_co10)
os.system("rm -rf " + cube_co21)
os.system("mv " + dir_data + "data/" + galname + "*10*smooth " + cube_co10)
os.system("mv " + dir_data + "data/" + galname + "*21*smooth " + cube_co21)

print("### step 9/10: immoments")
myim2.moment_maps(cube_co10, chans, mask_combine, rms_co10 * thres_mom)
myim2.moment_maps(cube_co21, chans, mask_combine, rms_co21 * thres_mom)

### pbmask
print("### step 10/10: pb mask at " + str(pbcut))

mask_pb = dir_data + galname + "/" + galname + "_pb_" + suffix + ".mask"
peak = imhead(pbimage, mode="list")["datamax"]
myim2.createmask(pbimage, peak * pbcut, mask_pb)

images_moment = glob.glob(cube_co10 + ".moment*")
images_moment.extend(glob.glob(cube_co21 + ".moment*"))
for i in range(len(images_moment)):
    outfile = images_moment[i].replace(".cube", "")
    os.system("rm -rf " + outfile)
    immath(imagename=[images_moment[i], mask_pb],