-
Notifications
You must be signed in to change notification settings - Fork 10
/
run_weightcalc.py
42 lines (37 loc) · 1.25 KB
/
run_weightcalc.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
# -*- coding: utf-8 -*-
"""Performs weight calculation for all cases specified in the
configuration file.
"""
# Standard modules
import json
import logging
import multiprocessing
import os
from faultmap import config_setup
from faultmap.gaincalc import weight_calc
if __name__ == "__main__":
multiprocessing.freeze_support()
logging.basicConfig(level=logging.INFO)
dataloc, configloc, _, _ = config_setup.get_locations()
weightcalc_config = json.load(
open(os.path.join(configloc, "config_weightcalc.json"))
)
# Flag indicating whether calculated results should be written to disk
writeoutput = weightcalc_config["writeoutput"]
# Flag indicating whether single signal entropy values for each
# signal involved should be calculated
single_entropies = weightcalc_config["calc_single_entropies"]
# Provide the mode and case names to calculate
mode = weightcalc_config["mode"]
cases = weightcalc_config["cases"]
fftcalc = weightcalc_config["fft_calc"]
do_multiprocessing = weightcalc_config["multiprocessing"]
for case in cases:
weight_calc(
mode,
case,
writeoutput,
single_entropies,
fftcalc,
do_multiprocessing,
)