1
Fork 0

Added logging to read_swash

This commit is contained in:
Edgar P. Burkhart 2022-03-30 10:53:11 +02:00
parent b982baa3c2
commit 4412084996
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 5 additions and 0 deletions

View File

@ -1,9 +1,12 @@
import logging
import subprocess import subprocess
import tempfile import tempfile
import numpy as np import numpy as np
log = logging.getLogger("read_swash")
class ReadSwash: class ReadSwash:
def __init__(self): def __init__(self):
self._n_x = None self._n_x = None
@ -13,7 +16,9 @@ class ReadSwash:
@classmethod @classmethod
def read_nohead(cls, path): def read_nohead(cls, path):
log.info(f"Replacing \\s with \\n in '{path}'")
subprocess.run(("sed", "-i", r"s/\s\+/\n/g", path)) subprocess.run(("sed", "-i", r"s/\s\+/\n/g", path))
log.info(f"Loading '{path}'")
return np.loadtxt(path) return np.loadtxt(path)
def read_time(self, path): def read_time(self, path):