pingmapper 5.0.11__tar.gz → 5.0.13__tar.gz

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.
Files changed (29) hide show
  1. {pingmapper-5.0.11 → pingmapper-5.0.13}/PKG-INFO +1 -1
  2. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/__main__.py +0 -2
  3. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/class_rectObj.py +5 -0
  4. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/class_sonObj.py +88 -0
  5. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/default_params.json +1 -0
  6. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/gui_main.py +1 -1
  7. pingmapper-5.0.13/pingmapper/version.py +1 -0
  8. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper.egg-info/PKG-INFO +1 -1
  9. pingmapper-5.0.11/pingmapper/version.py +0 -1
  10. {pingmapper-5.0.11 → pingmapper-5.0.13}/LICENSE +0 -0
  11. {pingmapper-5.0.11 → pingmapper-5.0.13}/README.md +0 -0
  12. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/__init__.py +0 -0
  13. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/class_mapSubstrateObj.py +0 -0
  14. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/class_portstarObj.py +0 -0
  15. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/class_sonObj_nadirgaptest.py +0 -0
  16. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/funcs_common.py +0 -0
  17. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/funcs_model.py +0 -0
  18. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/funcs_rectify.py +0 -0
  19. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/main_mapSubstrate.py +0 -0
  20. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/main_readFiles.py +0 -0
  21. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/main_rectify.py +0 -0
  22. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/test_PINGMapper.py +0 -0
  23. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper/test_time.py +0 -0
  24. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper.egg-info/SOURCES.txt +0 -0
  25. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper.egg-info/dependency_links.txt +0 -0
  26. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper.egg-info/requires.txt +0 -0
  27. {pingmapper-5.0.11 → pingmapper-5.0.13}/pingmapper.egg-info/top_level.txt +0 -0
  28. {pingmapper-5.0.11 → pingmapper-5.0.13}/setup.cfg +0 -0
  29. {pingmapper-5.0.11 → pingmapper-5.0.13}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingmapper
3
- Version: 5.0.11
3
+ Version: 5.0.13
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
@@ -22,8 +22,6 @@ def main(process):
22
22
  # Process single sonar log
23
23
  if process == 'gui':
24
24
  print('\n\nLaunching gui for processing single sonar log...\n\n')
25
- # from pingmapper.gui_main import gui
26
- # gui()
27
25
  from pingmapper.gui_main import gui
28
26
  gui(batch=False)
29
27
 
@@ -1988,6 +1988,11 @@ class rectObj(sonObj):
1988
1988
  isChunk.iloc[chunk+1] = True
1989
1989
  trkMeta = trkMeta[isChunk].reset_index(drop=False)
1990
1990
 
1991
+ # Set pixel resolution if 0
1992
+ if pix_res == 0:
1993
+ pix_res = trkMeta['pixM'].mode()[0]
1994
+ do_resize = False
1995
+
1991
1996
  # Filter sonMetaDF by chunk
1992
1997
  if not hasattr(self, 'sonMetaDF'):
1993
1998
  self._loadSonMeta()
@@ -797,6 +797,94 @@ class sonObj(object):
797
797
  self.sonDat = sonDat.astype(np.uint8)
798
798
  return
799
799
 
800
+ # def _loadSonChunk(self, df):
801
+ # """
802
+ # Read pings and apply per-ping gain normalization.
803
+ # - Assumes gain index is in df['gain'] aligned with loop index i.
804
+ # - Uses table_value = (gidx - 255) * 137 and unit_scale to convert to physical units.
805
+ # - For 'dB' mode: undo applied gain by multiplying with 10^(-gain_dB/20).
806
+ # - For 'linear' mode: subtract the (scaled) offset: dat_corrected = dat - phys_value.
807
+ # """
808
+
809
+ # # Configurable defaults (set on self if desired)
810
+ # gain_mode = 'linear' # 'dB' or 'linear'
811
+ # unit_scale = 100.0 # divisor to convert table units -> dB or linear units
812
+
813
+ # # Only apply for RSD files (your earlier check)
814
+ # apply_gain = self.sonFile.lower().endswith(".rsd")
815
+ # sonDat = np.zeros((int(self.pingMax), len(self.pingCnt)), dtype=np.int32)
816
+
817
+ # with open(self.sonFile, "rb") as file:
818
+ # for i in range(len(self.headIdx)):
819
+ # if ~np.isnan(self.headIdx[i]):
820
+ # ping_len = min(int(self.pingCnt[i]), int(self.pingMax))
821
+ # if not self.son8bit:
822
+ # ping_len *= 2
823
+
824
+ # headIDX = int(self.headIdx[i])
825
+ # son_offset = int(self.son_offset[i])
826
+ # pingIdx = headIDX + son_offset
827
+
828
+ # file.seek(pingIdx)
829
+ # buffer = file.read(ping_len)
830
+
831
+ # if self.flip_port:
832
+ # buffer = buffer[::-1]
833
+
834
+ # # Read raw samples: big-endian in file per your original code
835
+ # if self.son8bit:
836
+ # dat = np.frombuffer(buffer, dtype=">u1").astype(np.float32)
837
+ # else:
838
+ # # read big-endian uint16, then convert to native-endian float32
839
+ # try:
840
+ # dat_be = np.frombuffer(buffer, dtype=">u2")
841
+ # except Exception:
842
+ # dat_be = np.frombuffer(buffer[:-1], dtype=">u2")
843
+ # # convert to native-endian 16-bit then to float
844
+ # dat = dat_be.astype(np.uint16).astype(np.float32)
845
+
846
+ # # Apply gain correction if appropriate
847
+ # if apply_gain and gain_mode in ("dB", "linear"):
848
+ # # read gain index from your df (ensure integer)
849
+ # try:
850
+ # gidx = int(df.iloc[i]["gain"])
851
+ # except Exception:
852
+ # gidx = 0
853
+ # gidx = max(0, min(255, gidx))
854
+
855
+ # # table value in raw units
856
+ # table_unit_value = (gidx - 255) * 137
857
+ # phys_value = table_unit_value / float(unit_scale)
858
+
859
+ # if gain_mode == "dB":
860
+ # # phys_value is gain in dB that was applied when recording.
861
+ # # To normalize, undo that gain: multiply by 10^(-gain_dB/20).
862
+ # scale = 10.0 ** (-phys_value / 20.0)
863
+ # dat_corr = dat * scale
864
+ # else:
865
+ # # Linear offset case: subtract the stored offset to undo it.
866
+ # dat_corr = dat - phys_value
867
+ # else:
868
+ # dat_corr = dat
869
+
870
+ # # Clip and store into integer array, keep dynamic range
871
+ # # Here we store into sonDat as int32 to avoid overflow during processing.
872
+ # n = len(dat_corr)
873
+ # sonDat[:n, i] = np.round(dat_corr).astype(np.int32)
874
+
875
+ # # Finalize sonDat dtype choice: keep float-like behavior downstream by using float32,
876
+ # # or map to uint8/uint16 if your pipeline expects those dtypes.
877
+ # if self.son8bit:
878
+ # # clip to 0..255 and save as uint8
879
+ # self.sonDat = np.clip(sonDat, 0, 255).astype(np.uint8)
880
+ # else:
881
+ # # preserve range as uint16 (clip to uint16) if desired
882
+ # self.sonDat = np.clip(sonDat, 0, 65535).astype(np.uint16)
883
+
884
+ # return
885
+
886
+
887
+
800
888
  # ======================================================================
801
889
  def _WC_mask(self, i, son=True):
802
890
  '''
@@ -2,6 +2,7 @@
2
2
  "inDir":"",
3
3
  "inFile":"",
4
4
  "projDir":"",
5
+ "projName":"",
5
6
  "project_mode":true,
6
7
  "tempC":10,
7
8
  "nchunk":500,
@@ -113,7 +113,7 @@ def gui(batch: bool):
113
113
 
114
114
  else:
115
115
  text_project = sg.Text('Project Name', size=(15,1))
116
- in_project = sg.InputText(key='projName', size=(50,1), default_text=os.path.basename(default_params['projDir']))
116
+ in_project = sg.InputText(key='projName', size=(50,1), default_text=default_params['projName'])
117
117
 
118
118
  # Add to layout
119
119
  layout.append([text_project, in_project])
@@ -0,0 +1 @@
1
+ __version__ = '5.0.13'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingmapper
3
- Version: 5.0.11
3
+ Version: 5.0.13
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
@@ -1 +0,0 @@
1
- __version__ = '5.0.11'
File without changes
File without changes
File without changes
File without changes