1
Fork 0

Update pickling for U and graphUniform2

This commit is contained in:
Edgar P. Burkhart 2022-05-06 11:13:54 +02:00
parent 42e4cb4b45
commit 56c5e5c230
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 7 additions and 4 deletions

View file

@ -58,13 +58,13 @@ class OFModel:
)
_res_0 = np.loadtxt(_ft(self._t_dirs[0]))
_x = _res_0[:, 0]
_res = np.empty((self._t.size, _x.size))
_res[0] = _res_0[:, 1]
_res = np.empty((self._t.size, _x.size, _res_0.shape[1] - 1))
_res[0] = _res_0[:, 1:]
for _r, _dir in zip(_res[1:], self._t_dirs[1:]):
_r[:] = np.loadtxt(_ft(_dir))[:, 1]
_r[:] = np.loadtxt(_ft(_dir))[:, 1:]
_dict = {
f"x_{field}": _x,
field: _res,
field: np.squeeze(_res),
}
if func not in self._post_fields.keys():
self._post_fields[func] = {}

View file

@ -47,6 +47,9 @@ model.read_field_all("p_rgh")
model.read_field_all("U")
model.read_post("graphUniform", "alpha.water")
model.read_post("graphUniform", "U")
model.read_post("graphUniform2", "alpha.water")
model.read_post("graphUniform2", "U")
with (
gzip.open(out.joinpath("pickle.gz"), "wb")