Skip to content

Commit

Permalink
Handle missing separator in Parsivel data
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Jun 17, 2024
1 parent 7a42047 commit cb6d7d4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/processing/instrument_process.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import gzip
import logging
import re
import shutil
from pathlib import Path
from uuid import UUID
Expand Down Expand Up @@ -508,6 +509,17 @@ def process_parsivel(self):
if calibration["missing_timestamps"] is True:
full_paths, timestamps = utils.deduce_parsivel_timestamps(full_paths)
kwargs["timestamps"] = timestamps
# Add missing semicolon between timestamp and serial number (450416)
if self.params.site.id == "norunda":
for path in full_paths:
text = path.read_text()
new_text = re.sub(
r"^(\d{14}\.\d{3})450416;",
r"\1;450416;",
text,
flags=re.MULTILINE,
)
path.write_text(new_text)
self.uuid.product = parsivel2nc(full_paths, *self._args, **kwargs)

def process_thies_lnm(self):
Expand Down

0 comments on commit cb6d7d4

Please sign in to comment.