From eff440b2b25099d8edbaf1cccbf821ebfedcb9c5 Mon Sep 17 00:00:00 2001 From: giumas Date: Mon, 11 Mar 2024 07:47:44 +0100 Subject: [PATCH] bugfixes for ASVP and DQA --- hyo2/ssm2/__init__.py | 2 +- .../app/gui/soundspeedmanager/dialogs/text_editor.py | 2 +- hyo2/ssm2/lib/formats/writers/asvp.py | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hyo2/ssm2/__init__.py b/hyo2/ssm2/__init__.py index fd474a9a..8bd2d36e 100644 --- a/hyo2/ssm2/__init__.py +++ b/hyo2/ssm2/__init__.py @@ -12,7 +12,7 @@ logger.addHandler(logging.NullHandler()) name = "Sound Speed" -__version__ = '2024.0.0' +__version__ = '2024.0.1' __copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping' pkg_info = PkgInfo( diff --git a/hyo2/ssm2/app/gui/soundspeedmanager/dialogs/text_editor.py b/hyo2/ssm2/app/gui/soundspeedmanager/dialogs/text_editor.py index ebe388bf..a294650b 100644 --- a/hyo2/ssm2/app/gui/soundspeedmanager/dialogs/text_editor.py +++ b/hyo2/ssm2/app/gui/soundspeedmanager/dialogs/text_editor.py @@ -30,7 +30,7 @@ def __init__(self): # set the tab size metrics = QtGui.QFontMetrics(font) # noinspection PyArgumentList - self.setTabStopWidth(3 * metrics.width(' ')) + self.setTabStopDistance(3 * metrics.horizontalAdvance(' ')) @property def dirty(self): diff --git a/hyo2/ssm2/lib/formats/writers/asvp.py b/hyo2/ssm2/lib/formats/writers/asvp.py index 2f789788..e0232acf 100644 --- a/hyo2/ssm2/lib/formats/writers/asvp.py +++ b/hyo2/ssm2/lib/formats/writers/asvp.py @@ -2,6 +2,7 @@ import logging import math import operator +import os import numpy as np @@ -31,7 +32,12 @@ def write(self, ssp, data_path, data_file=None, project=''): # logger.debug('*** %s ***: start' % self.driver) self.ssp = ssp - self._write(data_path=data_path, data_file=data_file) + if data_file is None: + asvp_base_name = os.path.basename(self.ssp.cur.meta.original_path) + else: + asvp_base_name = data_file + asvp_file = "%s.asvp" % asvp_base_name + self._write(data_path=data_path, data_file=asvp_file) self._write_header() self._write_body() self.finalize() @@ -41,8 +47,6 @@ def write(self, ssp, data_path, data_file=None, project=''): if (np.sum(self.ssp.cur.sis.temp[ti]) != 0) and (np.sum(self.ssp.cur.sis.sal[ti]) != 0) \ and (np.sum(self.ssp.cur.sis.speed[ti]) != 0): - asvp_base_name = self.fod.basename - # first write the SSP file s01_file = "%s.ssp" % asvp_base_name self._write(data_path=data_path, data_file=s01_file)