forked from alirezaniki/OBSTransformer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
detection.py
32 lines (27 loc) · 1.02 KB
/
detection.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
import os, sys
from EQTransformer.utils.hdf5_maker import preprocessor
input = sys.argv[1].replace('/', '')
json_basepath = os.path.join(os.getcwd(),"json/station_list.json")
if not os.path.isdir(f'./{input}_processed_hdfs'):
preprocessor(preproc_dir="./preproc",
mseed_dir=input,
stations_json=json_basepath,
overlap=0.0,
n_processor=10)
from EQTransformer.core.predictor import predictor
predictor(input_dir=f"./{input}_processed_hdfs",
input_model="./models/OBSTransformer/OBSTransformer.h5",
output_dir="output/OBSTransformer",
estimate_uncertainty=False,
output_probabilities=False,
number_of_sampling=5,
loss_weights=[0.02, 0.40, 0.58],
detection_threshold=0.3,
P_threshold=0.1,
S_threshold=0.1,
number_of_plots=50,
plot_mode='time',
batch_size=500,
number_of_cpus=10,
keepPS=False,
spLimit=60)