Skip to content

Commit

Permalink
checked length of profile sent to SIS
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Mar 19, 2024
1 parent 4e09aab commit 324614e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hyo2/ssm2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger.addHandler(logging.NullHandler())

name = "Sound Speed"
__version__ = '2024.0.2'
__version__ = '2024.0.3'
__copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping'

pkg_info = PkgInfo(
Expand Down
12 changes: 12 additions & 0 deletions hyo2/ssm2/lib/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,25 @@ def send_kng_format(self, prj: 'SoundSpeedLibrary', server_mode: bool = False) -
logger.info("issue in preparing the data")
return False

si = prj.cur.sis_thinned
thin_profile_length = prj.cur.sis.flag[si].size
logger.debug("thin profile size: %d (with tolerance: %.3f)" % (thin_profile_length, tolerance))
if thin_profile_length >= 1000:
logger.info("too many samples, attempting with a lower tolerance")
continue

asvp = Asvp()
tx_data = asvp.convert(prj.ssp, fmt=kng_fmt)
# print(tx_data)
tx_data_size = len(tx_data)
logger.debug("tx data size: %d (with tolerance: %.3f)" % (tx_data_size, tolerance))
if tx_data_size < self.UDP_DATA_LIMIT:
break
tx_data = None

if tx_data is None:
logger.info("issue in thinning the data")
return False

return self._transmit(tx_data)

Expand Down

0 comments on commit 324614e

Please sign in to comment.