Added postprocessing script
This commit is contained in:
parent
dca8114bb9
commit
a9570bf333
4 changed files with 60 additions and 0 deletions
30
swash/processing/read_swash.py
Normal file
30
swash/processing/read_swash.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import numpy as np
|
||||
|
||||
|
||||
def read_nohead(path):
|
||||
with open(path) as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
def read_nohead_scalar(path, n):
|
||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
||||
(-1, n)
|
||||
)
|
||||
|
||||
|
||||
def read_nohead_k(path, n, k):
|
||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
||||
(-1, n, k)
|
||||
)
|
||||
|
||||
|
||||
def read_nohead_vect(path, n):
|
||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
||||
(-1, n, 2)
|
||||
)
|
||||
|
||||
|
||||
def read_nohead_vect_k(path, n):
|
||||
return np.asarray(read_nohead(path).split(), dtype=np.float64).reshape(
|
||||
(-1, n, 2, k)
|
||||
)
|
Reference in a new issue