-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmosaic_vlow.py
28 lines (23 loc) · 900 Bytes
/
mosaic_vlow.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
# mosaic the vlow stokes I images
from __future__ import print_function
from surveys_db import SurveysDB
import os
def run(c):
print(c)
result=os.system(c)
if result!=0:
raise RuntimeError('Failed to run '+c)
with SurveysDB(readonly=True) as sdb:
sdb.cur.execute('select id from fields where dr2')
results=sdb.cur.fetchall()
os.chdir('/beegfs/car/mjh/vlow_temp')
for r in results:
field=r['id']
if os.path.isfile('/beegfs/car/mjh/vlow_sub_mosaics/'+field+'-mosaic.fits'):
print(field,'done, skipping')
continue
command='mosaic_pointing.py --directories /data/lofar/DR2/fields --do-wsclean --no-check --no-bdsf --do_scaling '+field
run(command)
for f in ['vlow-mosaic-blanked.fits','vlow-mosaic.fits','vlow-mosaic-weights.fits']:
run('mv '+f+' /beegfs/car/mjh/vlow_sub_mosaics/'+f.replace('vlow',field))
run('rm *')