Reorganised processing/read_swash
This commit is contained in:
parent
2092789aa2
commit
4540b53add
1 changed files with 9 additions and 11 deletions
|
@ -6,25 +6,23 @@ def read_nohead(path):
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_scalar(path, n):
|
def read_reshape(path, shape):
|
||||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
||||||
(-1, n)
|
shape
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def read_nohead_scalar(path, n):
|
||||||
|
return read_reshape(path, (-1, n))
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_k(path, n, k):
|
def read_nohead_k(path, n, k):
|
||||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
return read_reshape(path, (-1, n, k))
|
||||||
(-1, n, k)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_vect(path, n):
|
def read_nohead_vect(path, n):
|
||||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
return read_reshape(path, (-1, n, 2))
|
||||||
(-1, n, 2)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_vect_k(path, n):
|
def read_nohead_vect_k(path, n):
|
||||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
return read_reshape(path, (-1, n, 2, k))
|
||||||
(-1, n, 2, k)
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue