Skip to content

Commit

Permalink
Update sbe_ctd_parser.py (#338)
Browse files Browse the repository at this point in the history
ignore non-ascii characters (like sigma from ctd files)
  • Loading branch information
shaunwbell authored Aug 14, 2024
1 parent c617f0c commit 4205b0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EcoFOCIpy/io/sbe_ctd_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def seabird_header(filename=None):

header, headercount, utc_time, latitude, longitude = [], [], [], [], []
var_names = {}
with open(filename) as fobj:
with open(filename, errors='ignore') as fobj:
for k, line in enumerate(fobj.readlines()):
header = header + [line]
if "# name" in line:
Expand Down Expand Up @@ -66,7 +66,7 @@ def manual_parse(file_list=[None]):

for ctdfile in file_list:

with open(ctdfile) as fobj:
with open(ctdfile, errors='ignore') as fobj:
print(f"Processing {ctdfile}")
for k, line in enumerate(fobj.readlines()):
if (not "*" in line) & (not "#" in line):
Expand Down

0 comments on commit 4205b0d

Please sign in to comment.