Skip to content

Commit

Permalink
Skip null characters Lampedusa weather station
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Feb 10, 2025
1 parent 36f24bd commit a573a6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cloudnetpy/instruments/weather_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,15 @@ def _read_data(self) -> dict:
raw_data: dict = {key: [] for key in fields}
for row in reader:
for key, value in row.items():
fixed_value = value.strip("\0")
parsed_value: float | datetime.datetime
if key == "time":
parsed_value = datetime.datetime.strptime(
value, "%y%m%d %H%M%S"
fixed_value, "%y%m%d %H%M%S"
)
else:
try:
parsed_value = float(value)
parsed_value = float(fixed_value)
except ValueError:
parsed_value = math.nan
raw_data[key].append(parsed_value)
Expand Down

0 comments on commit a573a6d

Please sign in to comment.