pingmapper 5.0.8__py3-none-any.whl → 5.0.10__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.
@@ -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
- sonDat = resize(sonDat,
1317
- (sonDat.shape[0], d),
1318
- mode='reflect',
1319
- clip=True,
1320
- preserve_range=True)
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
@@ -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 rect_wcp or rect_wcr or banklines or coverage or pred_sub or map_sub or export_poly:
770
- print('\n===========================================')
771
- print('===========================================')
772
- print('***** RECTIFYING *****')
773
- rectify_master_func(**params)
774
- # rectify_master_func(sonFiles, humFile, projDir, nchunk, rect_wcp, rect_wcr, mosaic, threadCnt)
775
-
776
- #==================================================
777
- #==================================================
778
- if pred_sub or map_sub or export_poly or pltSubClass:
779
- print('\n===========================================')
780
- print('===========================================')
781
- print('***** MAPPING SUBSTRATE *****')
782
- print("working on "+projDir)
783
- map_master_func(**params)
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)))
@@ -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
- # Save detected depth to csv
1025
- depDF = psObj._saveDepth(chunks, detectDep, smthDep, adjDep, instDepAvail)
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.8'
1
+ __version__ = '5.0.10'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingmapper
3
- Version: 5.0.8
3
+ Version: 5.0.10
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=7HVeCTDSUTwerkdB-hrRTITvh9q7kCfbL98QCTFp85Q,75683
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=5JsOYqRu146T1xhRgYC9ag3vnpRWqa2PDuJky595YA0,34780
11
+ pingmapper/gui_main.py,sha256=XErZgHdXQrqzxv7BiytyqSh-7IAzA5G5g72NcTtP5m0,34890
12
12
  pingmapper/main_mapSubstrate.py,sha256=E7jYmKHATXSk5XWhPR-pWH0288wurhX5ph94Gp_v0eg,21217
13
- pingmapper/main_readFiles.py,sha256=v-LCC6Yl7htttOkAme9rZ6AhpP4aaZSD_sHq30vsygc,56964
13
+ pingmapper/main_readFiles.py,sha256=1J0m2Hu4tJ0tBn6CHE1qKWszcGDE4rRljA-2_Fp9bnQ,57784
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=09G9VFaz1clAk9W4CwD7jaXBusQQgwfuHkZn5i8Ccbw,21
18
- pingmapper-5.0.8.data/data/pingmapper_config/default_params.json,sha256=YA9Rx1PSdUy4cTq-vtKORo3nNLisCYNOeUBxClldmHs,1285
19
- pingmapper-5.0.8.dist-info/licenses/LICENSE,sha256=lowDp_th1CGR0Z224a-jYRi-oNFe_0fdldL3USXhX-k,1095
20
- pingmapper-5.0.8.dist-info/METADATA,sha256=7-w-w1UY_PmbbhbrucA0v4CFL6BRX9rz2CItHR-Fp3o,9202
21
- pingmapper-5.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- pingmapper-5.0.8.dist-info/top_level.txt,sha256=RlV4sDoE3uIIDzNMOjN2t012Ia_jsblNVojJvg4q84w,11
23
- pingmapper-5.0.8.dist-info/RECORD,,
17
+ pingmapper/version.py,sha256=gUHzDgDh5c9ghGAd8QXBYhEyQPmETSQxlU6fvs_iz6s,22
18
+ pingmapper-5.0.10.data/data/pingmapper_config/default_params.json,sha256=YA9Rx1PSdUy4cTq-vtKORo3nNLisCYNOeUBxClldmHs,1285
19
+ pingmapper-5.0.10.dist-info/licenses/LICENSE,sha256=lowDp_th1CGR0Z224a-jYRi-oNFe_0fdldL3USXhX-k,1095
20
+ pingmapper-5.0.10.dist-info/METADATA,sha256=eInV14VWPvx6Y9k0oZtz9diGBMoiObpV9V3hNnNwajM,9203
21
+ pingmapper-5.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ pingmapper-5.0.10.dist-info/top_level.txt,sha256=RlV4sDoE3uIIDzNMOjN2t012Ia_jsblNVojJvg4q84w,11
23
+ pingmapper-5.0.10.dist-info/RECORD,,