forked from zackspica/MyFAST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path006.combine_pairs.py
43 lines (34 loc) · 1.36 KB
/
006.combine_pairs.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
import numpy as np
from params import basic_params
import subprocess, os
from params import *#create_json_network_params
"""/!\ Want to weight each station equally,
so multiply similarity in each 1-component
station by nvote.
Check example in postprocesing/combine_HecotrMine.sh
"""
if __name__ == '__main__':
p = basic_params()
subprocess.call(['rm', '-rf', 'data/inputs_network/'])
subprocess.call(['mkdir', 'data/inputs_network/'])
print '... copying candidate_pairs*merged.txt to data/inputs_network/\
because they are going to be deleted.'
subprocess.call(['cp -r data/waveforms*/fingerprints/candidate_pairs*merged.txt\
data/inputs_network/'], shell=True)
os.chdir('postprocessing/')
comandLine = 'python parse_results.py \
-d ../data/inputs_network/ \
-p candidate_pairs_%s \
--sort true --parse false -c true -t 6'
for sta in p['stalist']:
cmd = comandLine % (sta)
print cmd
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE, shell=True)
output, error = process.communicate()
print output
print ">>> Network detection inputs ready for station %s"% sta
print ">>> Network detection inputs ready at ../data/inputs_network/"
print
create_json_network_params()
print ">>> Network params json ready"