forked from lifewatch/pypam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
75 lines (58 loc) · 2.25 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import pathlib
import pyhydrophone as pyhy
import argparse
from pypam import dataset
parser = argparse.ArgumentParser(description='Generate a dataset and some plots for data exploration in the bpns')
parser.add_argument('summary_path', metavar='N', type=str, nargs='+', help='csv file with a list of all the ')
args = parser.parse_args()
# Acoustic Data
summary_path = pathlib.Path(args.summary_path[0])
include_dirs = False
# Output folder
output_folder = summary_path.parent.joinpath('data_exploration')
# Hydrophone Setup
# If Vpp is 2.0 then it means the wav is -1 to 1 directly related to V
model = 'ST300HF'
name = 'SoundTrap'
serial_number = 67416073
soundtrap = pyhy.soundtrap.SoundTrap(name=name, model=model, serial_number=serial_number)
bk_model = 'Nexus'
bk_name = 'B&K'
amplif0 = 10e-3
bk = pyhy.BruelKjaer(name=bk_name, model=bk_model, amplif=amplif0, serial_number=1)
upam_model = 'uPam'
upam_name = 'Seiche'
upam_serial_number = 'SM7213'
upam_sensitivity = -196.0
upam_preamp_gain = 0.0
upam_Vpp = 20.0
upam = pyhy.Seiche(name=upam_name, model=upam_name, serial_number=upam_serial_number, sensitivity=upam_sensitivity,
preamp_gain=upam_preamp_gain, Vpp=upam_Vpp)
aural_name = 'Aural'
aural_model = 'M2'
aural_serial_number = 0
aural_sensitivity = -164.0
aural_preamp_gain = 16.0
aural_Vpp = 2.0
aural = pyhy.MTE(name=aural_name, model=aural_model, serial_number=aural_serial_number, sensitivity=aural_sensitivity,
preamp_gain=aural_preamp_gain, Vpp=aural_Vpp, string_format='%y%m%d_%H%M%S')
instruments = {'SoundTrap': soundtrap, 'uPam': upam, 'B&K': bk, 'Aural': aural}
# Acoustic params. Reference pressure 1 uPa
REF_PRESSURE = 1e-6
# SURVEY PARAMETERS
nfft = 4096
binsize = 5.0
band_lf = [50, 500]
band_mf = [500, 2000]
band_hf = [2000, 20000]
band_list = [band_lf]
features = ['rms', 'sel', 'aci']
third_octaves = False
env_vars = ['shipping', 'time', 'shipwreck', 'habitat_suitability', 'seabed_habitat', 'sea_surface', 'sea_wave']
if __name__ == "__main__":
ds = dataset.DataSet(summary_path, output_folder, instruments, features, third_octaves, band_list, binsize, nfft)
ds()
# dataset.read_all_deployments()
# dataset.read_dataset()
# dataset.plot_all_features_evo()
# dataset.plot_all_features_distr()