-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngcaResults.py
62 lines (60 loc) · 1.81 KB
/
ngcaResults.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
#!/usr/bin/env python3
import sys
import os
import shutil
import glob
d = os.getcwd()
jur = d.split('/')[-2]
os.chdir('../')
dirs = glob.glob('20*')
dirs.sort()
date = dirs[-1]
os.chdir(d)
campaign = jur.upper() + '_NGCA_' + date
os.chdir('/home/fedora/ngca/sent')
try:
os.mkdir(campaign)
except OSError:
shutil.rmtree(campaign)
os.mkdir(campaign)
os.chdir(campaign)
os.mkdir('dynaML')
os.chdir('dynaML')
os.system('cp /home/fedora/ngca/' + jur + '/baselines/*.xml .')
os.system('rm -f *GDA2020*')
os.system('mv *NGCA* ../')
os.chdir('../')
os.mkdir('adjustments')
os.chdir('adjustments')
os.system('cp /home/fedora/ngca/' + jur + '/baselines/*.adj .')
os.chdir('../')
os.mkdir('feedback')
os.chdir('feedback')
for item in ['sigma0.dat', 'checkNgca.log']:
os.system('cp /home/fedora/ngca/' + jur + '/baselines/' + item + ' .')
for item in ['log_4_submit.txt', 'selectRef.log', 'verifySub.log']:
target = '../../../' + jur + '/' + date + '/' + item
sys_cmd = 'cp ../../../' + jur + '/' + date + '/' + item + ' .'
if os.path.isfile(target):
os.system(sys_cmd)
os.chdir('../')
os.mkdir('other')
os.chdir('other')
os.system('cp /home/fedora/ngca/' + jur + '/' + date + '/nameChanges.dat ./' )
os.system('cp /home/fedora/transTables/' + jur + 'TransTable*.csv ./' )
os.chdir('../')
sys_cmd = 'cp -r ../../' + jur + '/sinexFiles ./snx'
os.system(sys_cmd)
os.system('rm snx/*.SNX')
sys_cmd = 'cp -r ../../' + jur + '/rinexantls ./clusters'
os.system(sys_cmd)
os.chdir('../')
zip_cmd = 'zip -r ' + campaign + '.zip ' + campaign
os.system(zip_cmd)
os.system('rm -rf ' + campaign)
cmd = 'aws s3 rm s3://gda2020-ngca/ngcaResults/ --quiet --recursive --exclude "*" --include "*' + jur.upper() + '*"'
print(cmd)
os.system(cmd)
cmd = 'aws s3 cp ' + campaign + '.zip s3://gda2020-ngca/ngcaResults/ --quiet'
print(cmd)
os.system(cmd)