pingmapper 5.0.0__py3-none-any.whl → 5.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pingmapper/main_readFiles.py +37 -2
- pingmapper/main_rectify.py +67 -65
- pingmapper/version.py +1 -1
- {pingmapper-5.0.0.dist-info → pingmapper-5.0.2.dist-info}/METADATA +1 -1
- {pingmapper-5.0.0.dist-info → pingmapper-5.0.2.dist-info}/RECORD +9 -9
- {pingmapper-5.0.0.data → pingmapper-5.0.2.data}/data/pingmapper_config/default_params.json +0 -0
- {pingmapper-5.0.0.dist-info → pingmapper-5.0.2.dist-info}/WHEEL +0 -0
- {pingmapper-5.0.0.dist-info → pingmapper-5.0.2.dist-info}/licenses/LICENSE +0 -0
- {pingmapper-5.0.0.dist-info → pingmapper-5.0.2.dist-info}/top_level.txt +0 -0
pingmapper/main_readFiles.py
CHANGED
|
@@ -55,6 +55,7 @@ sys.path.insert(0, r'Z:\UDEL\PythonRepos\PINGVerter')
|
|
|
55
55
|
from pingverter import hum2pingmapper, low2pingmapper, cerul2pingmapper, gar2pingmapper
|
|
56
56
|
|
|
57
57
|
import cv2
|
|
58
|
+
import copy
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
#===========================================
|
|
@@ -377,6 +378,7 @@ def read_master_func(logfilename='',
|
|
|
377
378
|
# son.son8bit = sonar_obj.son8bit
|
|
378
379
|
# else:
|
|
379
380
|
son.son8bit = sonar_obj.son8bit
|
|
381
|
+
son.export_beam = True
|
|
380
382
|
|
|
381
383
|
# print(son.beamName, son.son8bit)
|
|
382
384
|
|
|
@@ -400,6 +402,40 @@ def read_master_func(logfilename='',
|
|
|
400
402
|
else:
|
|
401
403
|
sonObjs.append(son)
|
|
402
404
|
|
|
405
|
+
# Both port and starboard are required for side scan workflows
|
|
406
|
+
## Make copy of ss if both aren't available
|
|
407
|
+
ss_dups = {
|
|
408
|
+
'ss_port': ['ss_star', 'B003'],
|
|
409
|
+
'ss_star': ['ss_port', 'B002']
|
|
410
|
+
}
|
|
411
|
+
ss_chan_avail = []
|
|
412
|
+
for son in sonObjs:
|
|
413
|
+
if son.beamName == 'ss_port' or son.beamName == 'ss_star':
|
|
414
|
+
ss_chan_avail.append(son)
|
|
415
|
+
if len(ss_chan_avail) == 0:
|
|
416
|
+
print('\n\nNo side-scan channels available. Aborting!')
|
|
417
|
+
sys.exit()
|
|
418
|
+
elif len(ss_chan_avail) == 1:
|
|
419
|
+
print('\n\nMaking copy of {} to ensure PINGMapper compatibility'.format(son.beamName))
|
|
420
|
+
origBeam = son.beamName
|
|
421
|
+
print(son.beam, son.beamName)
|
|
422
|
+
son_copy = copy.deepcopy(ss_chan_avail[0])
|
|
423
|
+
son_copy.beamName = ss_dups[origBeam][0]
|
|
424
|
+
son_copy.beam = ss_dups[origBeam][1]
|
|
425
|
+
son_copy.export_beam = False
|
|
426
|
+
|
|
427
|
+
# Make copy of meta file
|
|
428
|
+
oldMeta = son.sonMetaFile
|
|
429
|
+
newMeta = '{}_{}_meta_copy.csv'.format(son_copy.beam, son_copy.beamName)
|
|
430
|
+
newMeta = os.path.join(os.path.dirname(oldMeta), newMeta)
|
|
431
|
+
shutil.copy(oldMeta, newMeta)
|
|
432
|
+
son_copy.sonMetaFile = newMeta
|
|
433
|
+
son_copy.outDir = os.path.join(os.path.dirname(oldMeta), son_copy.beamName)
|
|
434
|
+
sonObjs.append(son_copy)
|
|
435
|
+
else:
|
|
436
|
+
pass
|
|
437
|
+
|
|
438
|
+
print(sonObjs)
|
|
403
439
|
####
|
|
404
440
|
# OLD
|
|
405
441
|
|
|
@@ -1002,7 +1038,6 @@ def read_master_func(logfilename='',
|
|
|
1002
1038
|
dep = savgol_filter(dep, 51, 3)
|
|
1003
1039
|
|
|
1004
1040
|
# Interpolate over nan's (and set zero's to nan)
|
|
1005
|
-
dep = dep.to_numpy()
|
|
1006
1041
|
dep[dep==0] = np.nan
|
|
1007
1042
|
nans, x = np.isnan(dep), lambda z: z.nonzero()[0]
|
|
1008
1043
|
dep[nans] = np.interp(x(nans), x(~nans), dep[~nans])
|
|
@@ -1332,7 +1367,7 @@ def read_master_func(logfilename='',
|
|
|
1332
1367
|
start_time = time.time()
|
|
1333
1368
|
print("\nExporting sonogram tiles:\n")
|
|
1334
1369
|
for son in sonObjs:
|
|
1335
|
-
if son.wcp or son.wcr_src or son.wco or son.wcm:
|
|
1370
|
+
if (son.wcp or son.wcr_src or son.wco or son.wcm) and son.export_beam:
|
|
1336
1371
|
# Set outDir
|
|
1337
1372
|
son.outDir = os.path.join(son.projDir, son.beamName)
|
|
1338
1373
|
|
pingmapper/main_rectify.py
CHANGED
|
@@ -310,7 +310,7 @@ def rectify_master_func(logfilename='',
|
|
|
310
310
|
# COG Pre-processing #
|
|
311
311
|
# ##########################################################################
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
for son in portstar:
|
|
314
314
|
son.rect_wcp = rect_wcp
|
|
315
315
|
son.rect_wcr = rect_wcr
|
|
316
316
|
|
|
@@ -322,63 +322,64 @@ def rectify_master_func(logfilename='',
|
|
|
322
322
|
start_time = time.time()
|
|
323
323
|
print("\nRectifying and Exporting Geotiffs based on heading:\n")
|
|
324
324
|
for son in portstar:
|
|
325
|
+
if son.export_beam:
|
|
325
326
|
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
# Set output directory
|
|
328
|
+
son.outDir = os.path.join(son.projDir, son.beamName)
|
|
328
329
|
|
|
329
|
-
|
|
330
|
-
|
|
330
|
+
# # Get sonar coords dataframe
|
|
331
|
+
# sonarCoordsDF = son.sonarCoordsDF
|
|
331
332
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
# Get smoothed trackline file
|
|
334
|
+
smth_trk_file = son.smthTrkFile
|
|
335
|
+
sDF = pd.read_csv(smth_trk_file)
|
|
335
336
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
337
|
+
# Smooth heading
|
|
338
|
+
if rectMethod == 'Heading':
|
|
339
|
+
heading = 'instr_heading'
|
|
340
|
+
if smthHeading:
|
|
341
|
+
for name, group in sDF.groupby('transect'):
|
|
342
|
+
# Convert degrees to radians
|
|
343
|
+
hding = np.deg2rad(group[heading])
|
|
344
|
+
# Unwrap the heading because heading is circular
|
|
345
|
+
hding_unwrapped = np.unwrap(hding)
|
|
346
|
+
# Do smoothing
|
|
347
|
+
smth = savgol_filter(hding_unwrapped, 51, 3)
|
|
348
|
+
# Convert to degrees and make sure 0-360
|
|
349
|
+
smth = np.rad2deg(smth) % 360
|
|
350
|
+
group[heading] = smth
|
|
351
|
+
# Update sDF
|
|
352
|
+
sDF.update(group)
|
|
353
|
+
else:
|
|
354
|
+
heading = 'trk_cog'
|
|
354
355
|
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
smth_trk_file = son.smthTrkFile
|
|
357
|
+
sDF.to_csv(smth_trk_file)
|
|
357
358
|
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
# Get chunk id
|
|
360
|
+
chunks = son._getChunkID()
|
|
360
361
|
|
|
361
|
-
|
|
362
|
-
|
|
362
|
+
# Get colormap
|
|
363
|
+
son._getSonColorMap(son_colorMap)
|
|
363
364
|
|
|
364
|
-
|
|
365
|
+
print('\n\tExporting', len(chunks), 'GeoTiffs for', son.beamName)
|
|
365
366
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
# Parallel(n_jobs= np.min([len(sDF), threadCnt]))(delayed(son._rectSonHeadingMain)(sonarCoordsDF[sonarCoordsDF['chunk_id']==chunk], chunk) for chunk in tqdm(range(len(chunks))))
|
|
368
|
+
Parallel(n_jobs= np.min([len(sDF), threadCnt]))(delayed(son._rectSonHeadingMain)(sDF[sDF['chunk_id']==chunk], chunk, heading=heading, interp_dist=rectInterpDist) for chunk in tqdm(chunks))
|
|
369
|
+
# for i in chunks:
|
|
370
|
+
# # son._rectSonHeading(sonarCoordsDF[sonarCoordsDF['chunk_id']==i], i)
|
|
371
|
+
# r = son._rectSonHeadingMain(sDF[sDF['chunk_id']==i], i, heading=heading, interp_dist=rectInterpDist)
|
|
371
372
|
|
|
372
|
-
|
|
373
|
+
# # sys.exit()
|
|
373
374
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
# # # Concatenate and store cooordinates
|
|
376
|
+
# # dfAll = pd.concat(r)
|
|
377
|
+
# # son.sonarCoordsDF = dfAll
|
|
377
378
|
|
|
378
|
-
|
|
379
|
-
|
|
379
|
+
# smth_trk_file = smth_trk_file.replace('.csv', 'heading.csv')
|
|
380
|
+
# r.to_csv(smth_trk_file)
|
|
380
381
|
|
|
381
|
-
|
|
382
|
+
# print(dfAll)
|
|
382
383
|
|
|
383
384
|
print("Done!")
|
|
384
385
|
print("Time (s):", round(time.time() - start_time, ndigits=1))
|
|
@@ -405,26 +406,27 @@ def rectify_master_func(logfilename='',
|
|
|
405
406
|
# Always use COG for rubber sheeting
|
|
406
407
|
cog = True
|
|
407
408
|
for son in portstar:
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
#
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
409
|
+
if son.export_beam:
|
|
410
|
+
# Set output directory
|
|
411
|
+
son.outDir = os.path.join(son.projDir, son.beamName)
|
|
412
|
+
|
|
413
|
+
# Get chunk id's
|
|
414
|
+
chunks = son._getChunkID()
|
|
415
|
+
|
|
416
|
+
# Load sonMetaDF
|
|
417
|
+
son._loadSonMeta()
|
|
418
|
+
|
|
419
|
+
# Get colormap
|
|
420
|
+
son._getSonColorMap(son_colorMap)
|
|
421
|
+
|
|
422
|
+
print('\n\tExporting', len(chunks), 'GeoTiffs for', son.beamName)
|
|
423
|
+
# for i in chunks:
|
|
424
|
+
# son._rectSonRubber(i, filter, cog, wgs=False)
|
|
425
|
+
# sys.exit()
|
|
426
|
+
Parallel(n_jobs= np.min([len(chunks), threadCnt]))(delayed(son._rectSonRubber)(i, filter, cog, wgs=False) for i in tqdm(chunks))
|
|
427
|
+
son._cleanup()
|
|
428
|
+
gc.collect()
|
|
429
|
+
printUsage()
|
|
428
430
|
|
|
429
431
|
if rect_wcp or rect_wcr:
|
|
430
432
|
for son in portstar:
|
pingmapper/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '5.0.
|
|
1
|
+
__version__ = '5.0.2'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.2
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -9,14 +9,14 @@ pingmapper/funcs_model.py,sha256=dO9J4-0s1COggHkSUqHFC1qKTs20A6PSvkDqXWMUT6A,791
|
|
|
9
9
|
pingmapper/funcs_rectify.py,sha256=bAFWbNr4dyOuQzF1j4Je-K4zxfJZUjISc0nYrOot8Ng,12418
|
|
10
10
|
pingmapper/gui_main.py,sha256=5JsOYqRu146T1xhRgYC9ag3vnpRWqa2PDuJky595YA0,34780
|
|
11
11
|
pingmapper/main_mapSubstrate.py,sha256=E7jYmKHATXSk5XWhPR-pWH0288wurhX5ph94Gp_v0eg,21217
|
|
12
|
-
pingmapper/main_readFiles.py,sha256=
|
|
13
|
-
pingmapper/main_rectify.py,sha256=
|
|
12
|
+
pingmapper/main_readFiles.py,sha256=KPOpbUQ10ap-tkUeeaMlFlkhoULD_6J2djQlwcWyHSU,56706
|
|
13
|
+
pingmapper/main_rectify.py,sha256=uOKHHYrjVa3PVtU26G_fL9hTV7sZkvIzEgk3VJd3tVA,20217
|
|
14
14
|
pingmapper/test_PINGMapper.py,sha256=-SYMsdK-tTodXp5dCFSWPn-KRN7-OjX6OwjQ2-8hQg0,14176
|
|
15
15
|
pingmapper/test_time.py,sha256=uHT0mtLDP1J6w-snoELyk4UzZ2LrDeF6jGgJJVloalg,750
|
|
16
|
-
pingmapper/version.py,sha256=
|
|
17
|
-
pingmapper-5.0.
|
|
18
|
-
pingmapper-5.0.
|
|
19
|
-
pingmapper-5.0.
|
|
20
|
-
pingmapper-5.0.
|
|
21
|
-
pingmapper-5.0.
|
|
22
|
-
pingmapper-5.0.
|
|
16
|
+
pingmapper/version.py,sha256=6uWFQehl-5aBFrqs3GTNhQ-LWpJsUujT5MWerCWmEOY,21
|
|
17
|
+
pingmapper-5.0.2.data/data/pingmapper_config/default_params.json,sha256=YA9Rx1PSdUy4cTq-vtKORo3nNLisCYNOeUBxClldmHs,1285
|
|
18
|
+
pingmapper-5.0.2.dist-info/licenses/LICENSE,sha256=lowDp_th1CGR0Z224a-jYRi-oNFe_0fdldL3USXhX-k,1095
|
|
19
|
+
pingmapper-5.0.2.dist-info/METADATA,sha256=BaI6dpLlkrjM7tcCXJ5QIn0GzmoZNe4q_xmcC-Zber8,9173
|
|
20
|
+
pingmapper-5.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
pingmapper-5.0.2.dist-info/top_level.txt,sha256=RlV4sDoE3uIIDzNMOjN2t012Ia_jsblNVojJvg4q84w,11
|
|
22
|
+
pingmapper-5.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|