Revert to single npz archive
This commit is contained in:
parent
2d1c5683f2
commit
405c0ca514
2 changed files with 28 additions and 14 deletions
|
@ -31,17 +31,28 @@ class ReadSwash:
|
|||
|
||||
def read_scalar(self, path, const=False):
|
||||
if const:
|
||||
return self.read_nohead(path).reshape((self._n_t, self._n_x))[0, :]
|
||||
return self.read_nohead(path).reshape((self._n_t, self._n_x))
|
||||
self._data[path.stem] = self.read_nohead(path).reshape(
|
||||
(self._n_t, self._n_x)
|
||||
)[0, :]
|
||||
return
|
||||
self._data[path.stem] = self.read_nohead(path).reshape(
|
||||
(self._n_t, self._n_x)
|
||||
)
|
||||
|
||||
def read_vector(self, path):
|
||||
return self.read_nohead(path).reshape((self._n_t, 2, self._n_x))
|
||||
self._data[path.stem] = self.read_nohead(path).reshape(
|
||||
(self._n_t, 2, self._n_x)
|
||||
)
|
||||
|
||||
def read_scalar_lay(self, path):
|
||||
return self.read_nohead(path).reshape((self._n_t, -1, self._n_x))
|
||||
self._data[path.stem] = self.read_nohead(path).reshape(
|
||||
(self._n_t, -1, self._n_x)
|
||||
)
|
||||
|
||||
def read_vector_lay(self, path):
|
||||
return self.read_nohead(path).reshape((self._n_t, 2, -1, self._n_x))
|
||||
self._data[path.stem] = self.read_nohead(path).reshape(
|
||||
(self._n_t, 2, -1, self._n_x)
|
||||
)
|
||||
|
||||
@property
|
||||
def t(self):
|
||||
|
@ -50,3 +61,7 @@ class ReadSwash:
|
|||
@property
|
||||
def x(self):
|
||||
return self._x
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
return self._data
|
||||
|
|
Reference in a new issue