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

View file

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