forked from tammojan/facet-calibration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
casapy_cleanv4_checksubtract.py
72 lines (49 loc) · 1.91 KB
/
casapy_cleanv4_checksubtract.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
import sys
import numpy
#casapy --nologger -c ~weeren/scripts/rx42_hba/casapy_cleanv2.py ms1 ms2 imout maskname 1mJy 1000 1 512 True
el=len(sys.argv)
print sys.argv[:]
ms = sys.argv[4:el-2]
imageout = sys.argv[el-2]
imsizep = numpy.int(sys.argv[el-1])
#timer = '>15:32:00'
timer = '<23:50:00' # to fix instabilities at the end of a 20 min block
timer = ''
nfacets = 1
wplanes = 1
if imsizep > 512:
wplanes = 64
if imsizep > 799:
wplanes = 72
if imsizep > 1023:
wplanes = 96
if imsizep > 1599:
wplanes = 128
nfacets = 1
if imsizep > 2047:
wplanes = 164
nfacets = 1
if imsizep > 3000:
wplanes = 256
nfacets = 1
if imsizep > 4095:
wplanes = 448
nfacets = 1
print ms, imageout
imsize = [imsizep, imsizep]
cell = ['30arcsec', '30arcsec']
uvrange =">80lambda"
# clean up in case images are present from a previous run
os.system('rm -rf ' + imageout + '.*')
clean(vis=ms,imagename=imageout,outlierfile="",field="",spw="",selectdata=True,timerange=timer,\
uvrange=uvrange,antenna="",scan="",observation="",mode="mfs",gridmode="widefield",wprojplanes=wplanes,\
facets=1,cfcache="cfcache.dir",painc=360.0,epjtable="",interpolation="linear", \
niter=10,gain=0.1,threshold="0Jy",psfmode="clark",imagermode="csclean", \
ftmachine="mosaic",mosweight=False,scaletype="SAULT",multiscale=[],negcomponent=-1, \
smallscalebias=0.6,interactive=False,mask="",nchan=-1,start=0,width=1,outframe="", \
veltype="radio",imsize=imsize,cell=cell,phasecenter="",restfreq="",stokes="I", \
weighting="briggs",robust=0.0,uvtaper=False,outertaper=[''],innertaper=['1.0'], \
modelimage="",restoringbeam=[''],pbcor=False,minpb=0.2,usescratch=False,noise="1.0Jy",\
npixels=0,npercycle=100,cyclefactor=1.5,cyclespeedup=-1,nterms=1,reffreq="", \
chaniter=False,flatnoise=True,allowchunk=False)