forked from tammojan/facet-calibration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_empty_image_many.py
49 lines (30 loc) · 1000 Bytes
/
make_empty_image_many.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
import numpy
import os
import sys
#casapy --nologger -c make_empty_image.py in.ms out.image 1024 1.5arcsec
el=len(sys.argv)
print sys.argv[:]
mslistfile= sys.argv[el-4]
imageoutlistfile = sys.argv[el-3]
imsizeplistfile = sys.argv[el-2]
cell = str(sys.argv[el-1])
print mslistfile, imageoutlistfile, imsizeplistfile, cell
mslist = numpy.load(mslistfile)
imageoutlist = numpy.load(imageoutlistfile)
imsizeplist = numpy.load(imsizeplistfile)
for i in range(len(mslist)):
ms = mslist[i]
imageout = imageoutlist[i]
imsizep = numpy.int(numpy.float(imsizeplist[i]))
os.system('rm -rf ' + imageout)
print ms, imageout, imsizep
im.open(ms)
imsize = [imsizep, imsizep]
#cell = '1.5arcsec'
im.defineimage(nx=imsize[0],ny=imsize[1],cellx=cell,celly=cell,stokes='I')
im.make(imageout)
im.done()
im.close()
os.system('rm -rf '+mslistfile)
os.system('rm -rf '+imageoutlistfile)
os.system('rm -rf '+imsizeplistfile)