-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (28 loc) · 1.65 KB
/
main.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
# Imports
import warnings
warnings.filterwarnings('ignore')
from backend_code.align_waveforms import * # Functions to align waveforms from the same sticker and filter out bad SNR signals
from backend_code.time_extraction_for_solenoid import * # Finding t_0 for the solenoid
# define the following
locations = [11, 14, 17, 21, 22, 23, 25, 26, 27, 31, 32, 33, 35, 36, 37, 41, 44, 47]
def main(list_of_emitting_locations, number_of_stickers, save_results_to_csv = True,
make_plots = False, neglect_low_SNR_signals = True, SNR_threshold=0.1, tp=17.5):
results = get_time_differences(list_of_emitting_locations, number_of_stickers,
make_plots = make_plots, neglect_low_SNR_signals = neglect_low_SNR_signals, SNR_threshold=SNR_threshold, tp=tp)
if save_results_to_csv == True:
export_to_csv(results, "results/time_differences.csv")
if __name__ == "__main__":
locations = locations
number_of_stickers = 22
# Do you want to save the results?
# I would always put this on true as it doesn't take much time and it would be a shame having to rerun it in order to save
save_csv = True
# Do you want to visualise what the program is doing?
# The results are saved in the plots directory
make_plots = False
# When processing all the signals do you want to disregard signals below a certain SNR? Select yes and specify a value
disregard_bad_signals = True
SNR_threshold = 0.2
# What should the variance threshold (as a percentage of the median variance before t0) be to trigger t1?
tp = 16.0 # percent %
main(locations, number_of_stickers, save_csv, make_plots, disregard_bad_signals, SNR_threshold, tp)