Skip to content

Commit cb3b761

Browse files
Merge pull request #126 from CameronBodine/dev
Sonar log filter, coverage, bankline workflow
2 parents bb05de8 + c4eabde commit cb3b761

13 files changed

Lines changed: 1187 additions & 297 deletions

default_params.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"inDir":"",
33
"humFile":"",
4-
"aoi":"",
54
"projDir":"",
65
"project_mode":true,
76
"tempC":10,
@@ -10,6 +9,11 @@
109
"exportUnknown":false,
1110
"fixNoDat":false,
1211
"threadCnt":0,
12+
"aoi":"",
13+
"max_heading_deviation":0,
14+
"max_heading_distance":0,
15+
"min_speed":0,
16+
"max_speed":0,
1317
"pix_res_son":0.05,
1418
"pix_res_map":0.25,
1519
"x_offset":0.0,
@@ -40,5 +44,6 @@
4044
"mosaic_nchunk":0,
4145
"mosaic":"False",
4246
"map_mosaic":"False",
43-
"banklines":false
47+
"banklines":false,
48+
"coverage":false
4449
}

gui_main.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
layout = [
3737
[sg.Text('Recording to Process')],
3838
[sg.In(size=(80,1)), sg.FileBrowse(key='humFile', file_types=(("DAT File", "*.DAT"), ), initial_folder=os.path.dirname(default_params['humFile']))],
39-
[sg.Text('AOI')],
40-
[sg.In(size=(80,1)), sg.FileBrowse(key='aoi', file_types=(("Shapefile", "*.shp"), (".plan File", "*.plan")), initial_folder=os.path.dirname(default_params['aoi']))],
4139
[sg.Text('Output Folder')],
4240
[sg.In(size=(80,1)), sg.FolderBrowse(key='proj', initial_folder=os.path.dirname(default_params['projDir']))],
4341
[sg.Text('Project Name', size=(15,1)), sg.InputText(key='projName', size=(50,1), default_text=os.path.basename(default_params['projDir']))],
@@ -46,13 +44,16 @@
4644
[sg.Text('General Parameters')],
4745
[sg.Text('Temperature [C]', size=(20,1)), sg.Input(key='tempC', default_text=default_params['tempC'], size=(10,1))],
4846
[sg.Text('Chunk Size', size=(20,1)), sg.Input(key='nchunk', default_text=default_params['nchunk'], size=(10,1))],
49-
[sg.Text('Crop Range [m]', size=(20,1)), sg.Input(key='cropRange', default_text=default_params['cropRange'], size=(10,1))],
5047
[sg.Checkbox('Export Unknown Ping Attributes', key='exportUnknown', default=default_params['exportUnknown'])],
5148
[sg.Checkbox('Locate and flag missing pings', key='fixNoDat', default=default_params['fixNoDat'])],
5249
[sg.Text('Thread Count [0==All Threads]', size=(30,1)), sg.Input(key='threadCnt', default_text=default_params['threadCnt'], size=(10,1))],
5350
[sg.HorizontalSeparator()],
54-
[sg.Text('GeoTiff Pixel Resolution [0==Default Resolution (~0.02m)]')],
55-
[sg.Text('Sonar', size=(10,1)), sg.Input(key='pix_res_son', default_text=default_params['pix_res_son'], size=(10,1)), sg.Text('Substrate', size=(10,1)), sg.Input(key='pix_res_map', default_text=default_params['pix_res_map'], size=(10,1))],
51+
[sg.Text('Filter Sonar Log')],
52+
[sg.Text('Crop Range [m]', size=(22,1)), sg.Input(key='cropRange', default_text=default_params['cropRange'], size=(10,1))],
53+
[sg.Text('Max. Heading Deviation [deg]:', size=(22,1)), sg.Input(key='max_heading_deviation', default_text=default_params['max_heading_deviation'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Distance [m]:', size=(15,1)), sg.Input(key='max_heading_distance', default_text=default_params['max_heading_distance'], size=(10,1))],
54+
[sg.Text('Min. Speed [m/s]:', size=(22,1)), sg.Input(key='min_speed', default_text=default_params['min_speed'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Max. Speed [m/s]:', size=(15,1)), sg.Input(key='max_speed', default_text=default_params['max_speed'], size=(10,1))],
55+
[sg.Text('AOI')],
56+
[sg.In(size=(80,1)), sg.FileBrowse(key='aoi', file_types=(("Shapefile", "*.shp"), (".plan File", "*.plan")), initial_folder=os.path.dirname(default_params['aoi']))],
5657
[sg.HorizontalSeparator()],
5758
[sg.Text('Position Corrections')],
5859
[sg.Text('Transducer Offset [X]:', size=(22,1)), sg.Input(key='x_offset', default_text=default_params['x_offset'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Transducer Offset [Y]:', size=(22,1)), sg.Input(key='y_offset', default_text=default_params['y_offset'], size=(10,1))],
@@ -73,21 +74,23 @@
7374
[sg.Text('Depth Detection', size=(20,1)), sg.Combo(['Sensor', 'Auto'], key='detectDep', default_value=default_params['detectDep']), sg.VerticalSeparator(), sg.Checkbox('Smooth Depth', key='smthDep', default=default_params['smthDep']), sg.VerticalSeparator(), sg.Text('Adjust Depth [m]'), sg.Input(key='adjDep', default_text=default_params['adjDep'], size=(10,1)), sg.VerticalSeparator(()), sg.Checkbox('Plot Bedpick', key='pltBedPick', default=default_params['pltBedPick'])],
7475
[sg.HorizontalSeparator()],
7576
[sg.Text('Sonar Georectification Exports')],
77+
[sg.Text('Pixel Resolution [0==Default Resolution (~0.02m)]', size=(38,1)), sg.Input(key='pix_res_son', default_text=default_params['pix_res_son'], size=(10,1)),],
7678
[sg.Checkbox('WCP', key='rect_wcp', default=default_params['rect_wcp']), sg.Checkbox('WCR', key='rect_wcr', default=default_params['rect_wcr']), sg.Text('Sonar Colormap'), sg.Combo(plt.colormaps(), key='son_colorMap', default_value=default_params['son_colorMap'])],
7779
[sg.HorizontalSeparator()],
7880
[sg.Text('Substrate Mapping')],
7981
# [sg.Checkbox('Predict Substrate', key='pred_sub', default=default_params['pred_sub']), sg.VerticalSeparator(), sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
8082
# [sg.Checkbox('Map Substrate [Raster]', key='map_sub', default=default_params['map_sub']), sg.VerticalSeparator(), sg.Checkbox('Map Substrate [Polygon]', key='export_poly', default=default_params['export_poly']), sg.VerticalSeparator(), sg.Text('Classification Method'), sg.Combo(['max'], key='map_class_method', default_value=default_params['map_class_method'])],
8183
# [sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
8284
# [sg.Text('Map Predictions', size=(20,1)), sg.Combo(['False', 'Logit', 'Probability'], key='map_predict', default_value=default_params['map_predict'])],
85+
[sg.Text('Pixel Resolution [0==Default Resolution (~0.02m)]', size=(38,1)), sg.Input(key='pix_res_map', default_text=default_params['pix_res_map'], size=(10,1))],
8386
[sg.Checkbox('Map Substrate [Raster]', key='map_sub', default=default_params['map_sub']), sg.VerticalSeparator(), sg.Checkbox('Map Substrate [Polygon]', key='export_poly', default=default_params['export_poly']), sg.VerticalSeparator(), sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
8487
[sg.HorizontalSeparator()],
8588
[sg.Text('Mosaic Exports')],
8689
[sg.Text('# Chunks per Mosaic [0==All Chunks]'), sg.Input(key='mosaic_nchunk', default_text=default_params['mosaic_nchunk'], size=(10,1))],
8790
[sg.Text('Export Sonar Mosaic'), sg.Combo(['False', 'GTiff', 'VRT'], key='mosaic', default_value=default_params['mosaic']), sg.VerticalSeparator(), sg.Text('Export Substrate Mosaic'), sg.Combo(['False', 'GTiff', 'VRT'], key='map_mosaic', default_value=default_params['map_mosaic'])],
8891
[sg.HorizontalSeparator()],
89-
[sg.Text('Miscellaneous Exports')],
90-
[sg.Checkbox('Banklines', key='banklines', default=default_params['banklines'])],
92+
[sg.Text('Miscellaneous Shapefile Exports')],
93+
[sg.Checkbox('Banklines', key='banklines', default=default_params['banklines']), sg.VerticalSeparator(), sg.Checkbox('Coverage', key='coverage', default=default_params['coverage'])],
9194
[sg.HorizontalSeparator()],
9295
[sg.Submit(), sg.Quit(), sg.Button('Save Defaults')]
9396
]
@@ -204,7 +207,6 @@
204207

205208
params = {
206209
'humFile':values['humFile'],
207-
'aoi':aoi,
208210
'projDir':os.path.join(values['proj'], values['projName']),
209211
'project_mode':int(values['project_mode']),
210212
'tempC':float(values['tempC']),
@@ -213,6 +215,11 @@
213215
'exportUnknown':values['exportUnknown'],
214216
'fixNoDat':values['fixNoDat'],
215217
'threadCnt':int(values['threadCnt']),
218+
'aoi':aoi,
219+
'max_heading_deviation':float(values['max_heading_deviation']),
220+
'max_heading_distance':float(values['max_heading_distance']),
221+
'min_speed':float(values['min_speed']),
222+
'max_speed':float(values['max_speed']),
216223
'pix_res_son':float(values['pix_res_son']),
217224
'pix_res_map':float(values['pix_res_map']),
218225
'x_offset':float(values['x_offset']),
@@ -243,7 +250,8 @@
243250
'mosaic_nchunk':int(values['mosaic_nchunk']),
244251
'mosaic':mosaic,
245252
'map_mosaic':map_mosaic,
246-
'banklines':values['banklines']
253+
'banklines':values['banklines'],
254+
'coverage':values['coverage']
247255
}
248256

249257
globals().update(params)
@@ -315,7 +323,7 @@
315323
# read_master_func(sonFiles, humFile, projDir, t, nchunk, exportUnknown, wcp, wcr, tileFile, detectDepth, smthDep, adjDep, pltBedPick, threadCnt)
316324

317325
#==================================================
318-
if rect_wcp or rect_wcr or banklines:
326+
if rect_wcp or rect_wcr or banklines or coverage:
319327
print('\n===========================================')
320328
print('===========================================')
321329
print('***** RECTIFYING *****')

gui_main_batchDirectory.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
layout = [
3535
[sg.Text('Parent Folder of Recordings to Process')],
3636
[sg.In(key='inDir', size=(80,1)), sg.FolderBrowse(initial_folder=(default_params['inDir']))],
37-
[sg.Text('AOI')],
38-
[sg.In(size=(80,1)), sg.FileBrowse(key='aoi', file_types=(("Shapefile", "*.shp"), (".plan File", "*.plan")), initial_folder=os.path.dirname(default_params['aoi']))],
3937
[sg.Text('Output Folder')],
4038
[sg.In(size=(80,1)), sg.FolderBrowse(key='proj', initial_folder=os.path.dirname(default_params['projDir']))],
4139
[sg.Text('Project Name Prefix:', size=(20,1)), sg.Input(key='prefix', size=(10,1)), sg.VerticalSeparator(), sg.Text('Project Name Suffix:', size=(20,1)), sg.Input(key='suffix', size=(10,1))],
@@ -45,13 +43,16 @@
4543
[sg.Text('General Parameters')],
4644
[sg.Text('Temperature [C]', size=(20,1)), sg.Input(key='tempC', default_text=default_params['tempC'], size=(10,1))],
4745
[sg.Text('Chunk Size', size=(20,1)), sg.Input(key='nchunk', default_text=default_params['nchunk'], size=(10,1))],
48-
[sg.Text('Crop Range [m]', size=(20,1)), sg.Input(key='cropRange', default_text=default_params['cropRange'], size=(10,1))],
4946
[sg.Checkbox('Export Unknown Ping Attributes', key='exportUnknown', default=default_params['exportUnknown'])],
5047
[sg.Checkbox('Locate and flag missing pings', key='fixNoDat', default=default_params['fixNoDat'])],
5148
[sg.Text('Thread Count [0==All Threads]', size=(30,1)), sg.Input(key='threadCnt', default_text=default_params['threadCnt'], size=(10,1))],
5249
[sg.HorizontalSeparator()],
53-
[sg.Text('GeoTiff Pixel Resolution [0==Default Resolution (~0.02m)]')],
54-
[sg.Text('Sonar', size=(10,1)), sg.Input(key='pix_res_son', default_text=default_params['pix_res_son'], size=(10,1)), sg.Text('Substrate', size=(10,1)), sg.Input(key='pix_res_map', default_text=default_params['pix_res_map'], size=(10,1))],
50+
[sg.Text('Filter Sonar Log')],
51+
[sg.Text('Crop Range [m]', size=(22,1)), sg.Input(key='cropRange', default_text=default_params['cropRange'], size=(10,1))],
52+
[sg.Text('Max. Heading Deviation [deg]:', size=(22,1)), sg.Input(key='max_heading_deviation', default_text=default_params['max_heading_deviation'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Distance [m]:', size=(15,1)), sg.Input(key='max_heading_distance', default_text=default_params['max_heading_distance'], size=(10,1))],
53+
[sg.Text('Min. Speed [m/s]:', size=(22,1)), sg.Input(key='min_speed', default_text=default_params['min_speed'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Max. Speed [m/s]:', size=(15,1)), sg.Input(key='max_speed', default_text=default_params['max_speed'], size=(10,1))],
54+
[sg.Text('AOI')],
55+
[sg.In(size=(80,1)), sg.FileBrowse(key='aoi', file_types=(("Shapefile", "*.shp"), (".plan File", "*.plan")), initial_folder=os.path.dirname(default_params['aoi']))],
5556
[sg.HorizontalSeparator()],
5657
[sg.Text('Position Corrections')],
5758
[sg.Text('Transducer Offset [X]:', size=(22,1)), sg.Input(key='x_offset', default_text=default_params['x_offset'], size=(10,1)), sg.VerticalSeparator(), sg.Text('Transducer Offset [Y]:', size=(22,1)), sg.Input(key='y_offset', default_text=default_params['y_offset'], size=(10,1))],
@@ -72,21 +73,23 @@
7273
[sg.Text('Depth Detection', size=(20,1)), sg.Combo(['Sensor', 'Auto'], key='detectDep', default_value=default_params['detectDep']), sg.VerticalSeparator(), sg.Checkbox('Smooth Depth', key='smthDep', default=default_params['smthDep']), sg.VerticalSeparator(), sg.Text('Adjust Depth [m]'), sg.Input(key='adjDep', default_text=default_params['adjDep'], size=(10,1)), sg.VerticalSeparator(()), sg.Checkbox('Plot Bedpick', key='pltBedPick', default=default_params['pltBedPick'])],
7374
[sg.HorizontalSeparator()],
7475
[sg.Text('Sonar Georectification Exports')],
76+
[sg.Text('Pixel Resolution [0==Default Resolution (~0.02m)]', size=(38,1)), sg.Input(key='pix_res_son', default_text=default_params['pix_res_son'], size=(10,1)),],
7577
[sg.Checkbox('WCP', key='rect_wcp', default=default_params['rect_wcp']), sg.Checkbox('WCR', key='rect_wcr', default=default_params['rect_wcr']), sg.Text('Sonar Colormap'), sg.Combo(plt.colormaps(), key='son_colorMap', default_value=default_params['son_colorMap'])],
7678
[sg.HorizontalSeparator()],
7779
[sg.Text('Substrate Mapping')],
7880
# [sg.Checkbox('Predict Substrate', key='pred_sub', default=default_params['pred_sub']), sg.VerticalSeparator(), sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
7981
# [sg.Checkbox('Map Substrate [Raster]', key='map_sub', default=default_params['map_sub']), sg.VerticalSeparator(), sg.Checkbox('Map Substrate [Polygon]', key='export_poly', default=default_params['export_poly']), sg.VerticalSeparator(), sg.Text('Classification Method'), sg.Combo(['max'], key='map_class_method', default_value=default_params['map_class_method'])],
8082
# [sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
8183
# [sg.Text('Map Predictions', size=(20,1)), sg.Combo(['False', 'Logit', 'Probability'], key='map_predict', default_value=default_params['map_predict'])],
84+
[sg.Text('Pixel Resolution [0==Default Resolution (~0.02m)]', size=(38,1)), sg.Input(key='pix_res_map', default_text=default_params['pix_res_map'], size=(10,1))],
8285
[sg.Checkbox('Map Substrate [Raster]', key='map_sub', default=default_params['map_sub']), sg.VerticalSeparator(), sg.Checkbox('Map Substrate [Polygon]', key='export_poly', default=default_params['export_poly']), sg.VerticalSeparator(), sg.Checkbox('Export Substrate Plots', key='pltSubClass', default=default_params['pltSubClass'])],
8386
[sg.HorizontalSeparator()],
8487
[sg.Text('Mosaic Exports')],
8588
[sg.Text('# Chunks per Mosaic [0==All Chunks]'), sg.Input(key='mosaic_nchunk', default_text=default_params['mosaic_nchunk'], size=(10,1))],
8689
[sg.Text('Export Sonar Mosaic'), sg.Combo(['False', 'GTiff', 'VRT'], key='mosaic', default_value=default_params['mosaic']), sg.VerticalSeparator(), sg.Text('Export Substrate Mosaic'), sg.Combo(['False', 'GTiff', 'VRT'], key='map_mosaic', default_value=default_params['map_mosaic'])],
8790
[sg.HorizontalSeparator()],
88-
[sg.Text('Miscellaneous Exports')],
89-
[sg.Checkbox('Banklines', key='banklines', default=default_params['banklines'])],
91+
[sg.Text('Miscellaneous Shapefile Exports')],
92+
[sg.Checkbox('Banklines', key='banklines', default=default_params['banklines']), sg.VerticalSeparator(), sg.Checkbox('Coverage', key='coverage', default=default_params['coverage'])],
9093
[sg.HorizontalSeparator()],
9194
[sg.Submit(), sg.Quit(), sg.Button('Save Defaults')]
9295
]
@@ -213,14 +216,18 @@
213216
params = {
214217
# 'humFile':values[0],
215218
# 'projDir':os.path.join(values[1], values[2]),
216-
'aoi':aoi,
217219
'project_mode':int(values['project_mode']),
218220
'tempC':float(values['tempC']),
219221
'nchunk':int(values['nchunk']),
220222
'cropRange':float(values['cropRange']),
221223
'exportUnknown':values['exportUnknown'],
222224
'fixNoDat':values['fixNoDat'],
223225
'threadCnt':int(values['threadCnt']),
226+
'aoi':aoi,
227+
'max_heading_deviation':float(values['max_heading_deviation']),
228+
'max_heading_distance':float(values['max_heading_distance']),
229+
'min_speed':float(values['min_speed']),
230+
'max_speed':float(values['max_speed']),
224231
'pix_res_son':float(values['pix_res_son']),
225232
'pix_res_map':float(values['pix_res_map']),
226233
'x_offset':float(values['x_offset']),
@@ -251,7 +258,8 @@
251258
'mosaic_nchunk':int(values['mosaic_nchunk']),
252259
'mosaic':mosaic,
253260
'map_mosaic':map_mosaic,
254-
'banklines':values['banklines']
261+
'banklines':values['banklines'],
262+
'coverage':values['coverage']
255263
}
256264

257265
globals().update(params)

0 commit comments

Comments
 (0)