1
Fork 0

Added support for const

This commit is contained in:
Edgar P. Burkhart 2022-03-04 10:43:45 +01:00
parent c517ddaf68
commit 0f9841bff6
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 6 additions and 2 deletions

View file

@ -22,7 +22,11 @@ class ReadSwash:
self._x = np.unique(self.read_nohead(path))
self._n_x = self._x.size
def read_scalar(self, path):
def read_scalar(self, path, const=False):
if const:
self._data[path.stem] = slef.read_nohead(path).reshape(
(self._n_t, self._n_x)
)[0, :]
self._data[path.stem] = self.read_nohead(path).reshape(
(self._n_t, self._n_x)
)

View file

@ -30,7 +30,7 @@ rsws.read_x(sws_out.joinpath("xp.dat"))
log.info("Reading 'dep'")
rsws.read_scalar(sws_out.joinpath("dep.dat"))
log.info("Reading 'botl'")
rsws.read_scalar(sws_out.joinpath("botl.dat"))
rsws.read_scalar(sws_out.joinpath("botl.dat"), const=True)
log.info("Reading 'watl'")
rsws.read_scalar(sws_out.joinpath("watl.dat"))
log.info("Reading 'vel'")