Skip to content

Commit

Permalink
bumped version and minor S&S fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Nov 9, 2023
1 parent 4a5d435 commit 6937e9a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion hyo2/soundspeed/__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__ = '2023.0.8'
__version__ = '2023.0.9'
__copyright__ = 'Copyright 2023 University of New Hampshire, Center for Coastal and Ocean Mapping'

lib_info = LibInfo()
Expand Down
29 changes: 15 additions & 14 deletions hyo2/soundspeed/formats/readers/sea_and_sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SeaAndSun(AbstractTextReader):
'CTP': Dicts.probe_types['SST-CTP'],
'CTM': Dicts.probe_types['SST-MEM']
}

def __init__(self):
super(SeaAndSun, self).__init__()
self.desc = "SeaAndSun"
Expand Down Expand Up @@ -91,18 +91,18 @@ def _parse_header(self):
date_string = date_tuple.strftime("%d.%m.%Y")
locale.setlocale(locale.LC_TIME, old_loc)
except Exception as e:
logger.info("Fail to interpret date from German: %s" % e)
logger.info("unable to interpret date using German locale: %s" % e)
date_string = None

elif line_idx == 17: # probe type and serial number
if line[:len(self.tk_serial)] == self.tk_serial:
try:
probe_sn_tokens = line.split()[1]
self.ssp.cur.meta.probe_type = self.probe_dict[probe_sn_tokens[:3]]
self.ssp.cur.meta.sn = probe_sn_tokens[3:]
except KeyError:
logger.warning("unable to recognize probe type from line #%s" % line_idx)
elif line_idx == 17: # probe type and serial number
if line[:len(self.tk_serial)] == self.tk_serial:
try:
probe_sn_tokens = line.split()[1]
self.ssp.cur.meta.probe_type = self.probe_dict[probe_sn_tokens[:3]]
self.ssp.cur.meta.sn = probe_sn_tokens[3:]
except KeyError:
logger.warning("unable to recognize probe type from line #%s" % line_idx)

if not line: # skip empty lines
continue

Expand Down Expand Up @@ -130,10 +130,11 @@ def _parse_header(self):

if (time_string is not None) and (date_string is not None):
try:
self.ssp.cur.meta.utc_time = dt.datetime.strptime(date_string + ' ' + time_string, "%d.%m.%Y %H:%M:%S")
timestamp = "%s %s" % (date_string, time_string)
self.ssp.cur.meta.utc_time = dt.datetime.strptime(timestamp, "%d.%m.%Y %H:%M:%S")

except Exception:
logger.warning("issue in retrieving the timestamp")
except Exception as e:
logger.warning("issue in retrieving the timestamp: %s" % e)

# sample fields checks
if not has_pressure:
Expand Down
2 changes: 1 addition & 1 deletion hyo2/soundspeedmanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger.addHandler(logging.NullHandler())

name = "Sound Speed Manager"
__version__ = "2023.0.8"
__version__ = "2023.0.9"
__copyright__ = "Copyright 2023 University of New Hampshire, Center for Coastal and Ocean Mapping"

app_info = AppInfo()
Expand Down
2 changes: 1 addition & 1 deletion hyo2/soundspeedsettings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
logger.addHandler(logging.NullHandler())

name = "Sound Speed Settings"
__version__ = '2023.0.8'
__version__ = '2023.0.9'
__copyright__ = 'Copyright 2023 University of New Hampshire, Center for Coastal and Ocean Mapping'

app_info = AppInfo()
Expand Down

0 comments on commit 6937e9a

Please sign in to comment.