Added support for const
This commit is contained in:
parent
c517ddaf68
commit
0f9841bff6
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
)
|
||||
|
|
|
@ -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'")
|
||||
|
|
Loading…
Reference in a new issue