pingmapper 5.0.8__py3-none-any.whl → 5.0.9__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/class_sonObj.py +34 -6
- pingmapper/gui_main.py +27 -25
- pingmapper/main_readFiles.py +47 -11
- pingmapper/version.py +1 -1
- {pingmapper-5.0.8.dist-info → pingmapper-5.0.9.dist-info}/METADATA +1 -1
- {pingmapper-5.0.8.dist-info → pingmapper-5.0.9.dist-info}/RECORD +10 -10
- {pingmapper-5.0.8.data → pingmapper-5.0.9.data}/data/pingmapper_config/default_params.json +0 -0
- {pingmapper-5.0.8.dist-info → pingmapper-5.0.9.dist-info}/WHEEL +0 -0
- {pingmapper-5.0.8.dist-info → pingmapper-5.0.9.dist-info}/licenses/LICENSE +0 -0
- {pingmapper-5.0.8.dist-info → pingmapper-5.0.9.dist-info}/top_level.txt +0 -0
pingmapper/class_sonObj.py
CHANGED
|
@@ -1301,7 +1301,10 @@ class sonObj(object):
|
|
|
1301
1301
|
|
|
1302
1302
|
# Distance (in meters)
|
|
1303
1303
|
d = sonMeta['trk_dist'].to_numpy()
|
|
1304
|
-
d = np.max(d) - np.min(d)
|
|
1304
|
+
# d = np.max(d) - np.min(d)
|
|
1305
|
+
d = d[-1] - d[0]
|
|
1306
|
+
|
|
1307
|
+
|
|
1305
1308
|
|
|
1306
1309
|
pixM = sonMeta['pixM']
|
|
1307
1310
|
# Find most common pixel size
|
|
@@ -1313,11 +1316,36 @@ class sonObj(object):
|
|
|
1313
1316
|
# Distance in pix
|
|
1314
1317
|
d = round(d / pixM, 0).astype(int)
|
|
1315
1318
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1319
|
+
# to avoid oom errors
|
|
1320
|
+
rows = sonDat.shape[0]
|
|
1321
|
+
new_cols = d # your target width
|
|
1322
|
+
item_size = sonDat.itemsize # bytes per element
|
|
1323
|
+
|
|
1324
|
+
estimated_bytes = rows * new_cols * item_size
|
|
1325
|
+
estimated_MB = estimated_bytes / 1e6
|
|
1326
|
+
|
|
1327
|
+
available_bytes = psutil.virtual_memory().available
|
|
1328
|
+
available_MB = available_bytes / 1e6
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
mem_margin = 0.9
|
|
1332
|
+
safe_limit_MB = available_MB * (1 - mem_margin)
|
|
1333
|
+
|
|
1334
|
+
if d > 0 and estimated_MB < safe_limit_MB and new_cols<65500:
|
|
1335
|
+
sonDat = resize(
|
|
1336
|
+
sonDat,
|
|
1337
|
+
(rows, new_cols),
|
|
1338
|
+
mode='reflect',
|
|
1339
|
+
clip=True,
|
|
1340
|
+
preserve_range=True
|
|
1341
|
+
)
|
|
1342
|
+
if estimated_MB > safe_limit_MB:
|
|
1343
|
+
print(f"Resize skipped for chunk {chunk}: estimated {estimated_MB:.2f} MB exceeds safe limit of {safe_limit_MB:.2f} MB.")
|
|
1344
|
+
# Optionally: fallback to chunked resize or downsampling
|
|
1345
|
+
elif new_cols>65500:
|
|
1346
|
+
print(f"Resize skipped for chunk {chunk}: Maximum supported image dimension is 65500 pixels.")
|
|
1347
|
+
else:
|
|
1348
|
+
print(f"Resize skipped for chunk {chunk}: Vessel did not move.")
|
|
1321
1349
|
|
|
1322
1350
|
else:
|
|
1323
1351
|
sonDat = resize(sonDat,
|
pingmapper/gui_main.py
CHANGED
|
@@ -10,16 +10,16 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
10
10
|
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
|
|
11
11
|
sys.path.append(PACKAGE_DIR)
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
# For Debug
|
|
14
|
+
from funcs_common import *
|
|
15
|
+
from main_readFiles import read_master_func
|
|
16
|
+
from main_rectify import rectify_master_func
|
|
17
|
+
from main_mapSubstrate import map_master_func
|
|
18
18
|
|
|
19
|
-
from pingmapper.funcs_common import *
|
|
20
|
-
from pingmapper.main_readFiles import read_master_func
|
|
21
|
-
from pingmapper.main_rectify import rectify_master_func
|
|
22
|
-
from pingmapper.main_mapSubstrate import map_master_func
|
|
19
|
+
# from pingmapper.funcs_common import *
|
|
20
|
+
# from pingmapper.main_readFiles import read_master_func
|
|
21
|
+
# from pingmapper.main_rectify import rectify_master_func
|
|
22
|
+
# from pingmapper.main_mapSubstrate import map_master_func
|
|
23
23
|
|
|
24
24
|
import json
|
|
25
25
|
import pandas as pd
|
|
@@ -763,24 +763,26 @@ def gui(batch: bool):
|
|
|
763
763
|
print('\n===========================================')
|
|
764
764
|
print('===========================================')
|
|
765
765
|
print('***** READING *****')
|
|
766
|
-
read_master_func(**params)
|
|
766
|
+
ss_chan_avail = read_master_func(**params)
|
|
767
767
|
# read_master_func(sonFiles, humFile, projDir, t, nchunk, exportUnknown, wcp, wcr, detectDepth, smthDep, adjDep, pltBedPick, threadCnt)
|
|
768
768
|
|
|
769
|
-
if
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
769
|
+
if ss_chan_avail:
|
|
770
|
+
|
|
771
|
+
if rect_wcp or rect_wcr or banklines or coverage or pred_sub or map_sub or export_poly:
|
|
772
|
+
print('\n===========================================')
|
|
773
|
+
print('===========================================')
|
|
774
|
+
print('***** RECTIFYING *****')
|
|
775
|
+
rectify_master_func(**params)
|
|
776
|
+
# rectify_master_func(sonFiles, humFile, projDir, nchunk, rect_wcp, rect_wcr, mosaic, threadCnt)
|
|
777
|
+
|
|
778
|
+
#==================================================
|
|
779
|
+
#==================================================
|
|
780
|
+
if pred_sub or map_sub or export_poly or pltSubClass:
|
|
781
|
+
print('\n===========================================')
|
|
782
|
+
print('===========================================')
|
|
783
|
+
print('***** MAPPING SUBSTRATE *****')
|
|
784
|
+
print("working on "+projDir)
|
|
785
|
+
map_master_func(**params)
|
|
784
786
|
|
|
785
787
|
gc.collect()
|
|
786
788
|
print("\n\nTotal Processing Time: ",datetime.timedelta(seconds = round(time.time() - start_time, ndigits=0)))
|
pingmapper/main_readFiles.py
CHANGED
|
@@ -36,14 +36,14 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
36
36
|
PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
|
|
37
37
|
sys.path.append(PACKAGE_DIR)
|
|
38
38
|
|
|
39
|
-
#
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
# For debug
|
|
40
|
+
from funcs_common import *
|
|
41
|
+
from class_sonObj import sonObj
|
|
42
|
+
from class_portstarObj import portstarObj
|
|
43
43
|
|
|
44
|
-
from pingmapper.funcs_common import *
|
|
45
|
-
from pingmapper.class_sonObj import sonObj
|
|
46
|
-
from pingmapper.class_portstarObj import portstarObj
|
|
44
|
+
# from pingmapper.funcs_common import *
|
|
45
|
+
# from pingmapper.class_sonObj import sonObj
|
|
46
|
+
# from pingmapper.class_portstarObj import portstarObj
|
|
47
47
|
|
|
48
48
|
import shutil
|
|
49
49
|
|
|
@@ -419,8 +419,34 @@ def read_master_func(logfilename='',
|
|
|
419
419
|
if son.beamName == 'ss_port' or son.beamName == 'ss_star':
|
|
420
420
|
ss_chan_avail.append(son)
|
|
421
421
|
if len(ss_chan_avail) == 0:
|
|
422
|
-
print('\n\nNo side-scan channels available. Aborting!')
|
|
423
|
-
sys.exit()
|
|
422
|
+
# print('\n\nNo side-scan channels available. Aborting!')
|
|
423
|
+
# sys.exit()
|
|
424
|
+
|
|
425
|
+
print('\n\nNo side-scan channels available!\nUpdating processing parameters as necessary...')
|
|
426
|
+
print('\nFiltering not avaialable...')
|
|
427
|
+
max_heading_deviation = 0
|
|
428
|
+
min_speed = 0
|
|
429
|
+
max_speed = 0
|
|
430
|
+
aoi = ''
|
|
431
|
+
time_table = ''
|
|
432
|
+
|
|
433
|
+
print('\nAuto depth picking not available...')
|
|
434
|
+
detectDep = 0
|
|
435
|
+
pltBedPick = False
|
|
436
|
+
|
|
437
|
+
print('\nShadow removal not available')
|
|
438
|
+
remShadow = 0
|
|
439
|
+
pred_sub = False
|
|
440
|
+
|
|
441
|
+
print('\nEGN not available...')
|
|
442
|
+
egn = False
|
|
443
|
+
|
|
444
|
+
print('\nWCO and WCM not available...')
|
|
445
|
+
wco = False
|
|
446
|
+
wcm = False
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
424
450
|
elif len(ss_chan_avail) == 1:
|
|
425
451
|
print('\n\nMaking copy of {} to ensure PINGMapper compatibility'.format(son.beamName))
|
|
426
452
|
origBeam = son.beamName
|
|
@@ -1021,8 +1047,12 @@ def read_master_func(logfilename='',
|
|
|
1021
1047
|
saveDepth = False
|
|
1022
1048
|
|
|
1023
1049
|
if saveDepth:
|
|
1024
|
-
|
|
1025
|
-
|
|
1050
|
+
|
|
1051
|
+
if ss_chan_avail:
|
|
1052
|
+
# Save detected depth to csv
|
|
1053
|
+
depDF = psObj._saveDepth(chunks, detectDep, smthDep, adjDep, instDepAvail)
|
|
1054
|
+
else:
|
|
1055
|
+
depDF = []
|
|
1026
1056
|
|
|
1027
1057
|
# Store depths in downlooking sonar files also
|
|
1028
1058
|
for son in sonObjs:
|
|
@@ -1501,3 +1531,9 @@ def read_master_func(logfilename='',
|
|
|
1501
1531
|
son._pickleSon()
|
|
1502
1532
|
gc.collect()
|
|
1503
1533
|
printUsage()
|
|
1534
|
+
|
|
1535
|
+
if len(ss_chan_avail) == 0:
|
|
1536
|
+
return False
|
|
1537
|
+
else:
|
|
1538
|
+
return True
|
|
1539
|
+
|
pingmapper/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '5.0.
|
|
1
|
+
__version__ = '5.0.9'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.9
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine, Daniel Buscombe
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -3,21 +3,21 @@ pingmapper/__main__.py,sha256=AFopb_XqSU4ZWnmmNICLmtEP7XI_7D-9ng5mnvWNePc,1431
|
|
|
3
3
|
pingmapper/class_mapSubstrateObj.py,sha256=txB9YqXfVgDFi628jo2F1RtEw1lCNR8wYpkhy94bn0U,37036
|
|
4
4
|
pingmapper/class_portstarObj.py,sha256=vrk7zVdg0apQEashg2cxcG2EfUgNu01f6SSwyCadwiA,106951
|
|
5
5
|
pingmapper/class_rectObj.py,sha256=aJbM-q3UNBhvWutOJwnweGkWTrx6avslX2DCWdofW4Q,96182
|
|
6
|
-
pingmapper/class_sonObj.py,sha256=
|
|
6
|
+
pingmapper/class_sonObj.py,sha256=wt4M086rucGuZpEMSYf4JegugyG69QrzG3YWMr5M_00,76913
|
|
7
7
|
pingmapper/class_sonObj_nadirgaptest.py,sha256=DSFgjEgpwPgDZslw0vXGGBNFYlcoUa2Ufbr8i_Uqdhc,76915
|
|
8
8
|
pingmapper/funcs_common.py,sha256=0uZErbrWZ_jhOLOc-CT--8OX4eHF9qE_E5Wwy60aSvQ,15300
|
|
9
9
|
pingmapper/funcs_model.py,sha256=tvAISiYLOD9vO10xitrUq8qKmtIQVvN1NC4FQqbrqv8,8661
|
|
10
10
|
pingmapper/funcs_rectify.py,sha256=bAFWbNr4dyOuQzF1j4Je-K4zxfJZUjISc0nYrOot8Ng,12418
|
|
11
|
-
pingmapper/gui_main.py,sha256=
|
|
11
|
+
pingmapper/gui_main.py,sha256=DSDQSvFhh6IzvJE0Gb7tShFLw5amqCHuazwHiklGVl8,34888
|
|
12
12
|
pingmapper/main_mapSubstrate.py,sha256=E7jYmKHATXSk5XWhPR-pWH0288wurhX5ph94Gp_v0eg,21217
|
|
13
|
-
pingmapper/main_readFiles.py,sha256=
|
|
13
|
+
pingmapper/main_readFiles.py,sha256=q2sKPZAubn27yfMW-gS_gHi8ESta0_oGjbCjJo9nwW0,57782
|
|
14
14
|
pingmapper/main_rectify.py,sha256=uOKHHYrjVa3PVtU26G_fL9hTV7sZkvIzEgk3VJd3tVA,20217
|
|
15
15
|
pingmapper/test_PINGMapper.py,sha256=-SYMsdK-tTodXp5dCFSWPn-KRN7-OjX6OwjQ2-8hQg0,14176
|
|
16
16
|
pingmapper/test_time.py,sha256=uHT0mtLDP1J6w-snoELyk4UzZ2LrDeF6jGgJJVloalg,750
|
|
17
|
-
pingmapper/version.py,sha256=
|
|
18
|
-
pingmapper-5.0.
|
|
19
|
-
pingmapper-5.0.
|
|
20
|
-
pingmapper-5.0.
|
|
21
|
-
pingmapper-5.0.
|
|
22
|
-
pingmapper-5.0.
|
|
23
|
-
pingmapper-5.0.
|
|
17
|
+
pingmapper/version.py,sha256=HqMS0rnpSiDFIEcOWQ7kY54HvJuEhkV7etIZUx39NGw,21
|
|
18
|
+
pingmapper-5.0.9.data/data/pingmapper_config/default_params.json,sha256=YA9Rx1PSdUy4cTq-vtKORo3nNLisCYNOeUBxClldmHs,1285
|
|
19
|
+
pingmapper-5.0.9.dist-info/licenses/LICENSE,sha256=lowDp_th1CGR0Z224a-jYRi-oNFe_0fdldL3USXhX-k,1095
|
|
20
|
+
pingmapper-5.0.9.dist-info/METADATA,sha256=OLd899S9oygHLmgkwSLTy0Lr-alDD7Cq0iNom4_WeMg,9202
|
|
21
|
+
pingmapper-5.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
pingmapper-5.0.9.dist-info/top_level.txt,sha256=RlV4sDoE3uIIDzNMOjN2t012Ia_jsblNVojJvg4q84w,11
|
|
23
|
+
pingmapper-5.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|