diff --git a/swash/config-nb.ini b/swash/config-nb.ini index 66c13c0..fd56912 100644 --- a/swash/config-nb.ini +++ b/swash/config-nb.ini @@ -3,18 +3,15 @@ out=../data/out_nb [swash] input=sws/SPEC_buoy_nb.sws -path=/opt/swash +path=/data/code/swash out=out/spec_nb mpi=8 [post] -inp=inp_post +inp=inp_post/spec_nb compare=inp_post_nb out=out_post #nperseg=1024 dt=0.25 x0=-1250 t0=180 - -[plot] -out=out_plt diff --git a/swash/config.ini b/swash/config.ini index 39792c7..1a58cea 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -3,18 +3,15 @@ out=../data/out [swash] input=sws/SPEC_buoy.sws -path=/opt/swash +path=/data/code/swash out=out/spec mpi=8 [post] -inp=inp_post +inp=inp_post/spec compare=inp_post_nb out=out_post #nperseg=1024 dt=0.25 x0=-1250 t0=180 - -[plot] -out=out_plt diff --git a/swash/processing/animate.py b/swash/processing/animate.py index 1162399..cad5361 100644 --- a/swash/processing/animate.py +++ b/swash/processing/animate.py @@ -21,8 +21,8 @@ config.read(args.config) inp = pathlib.Path(config.get("post", "inp")) root = pathlib.Path(config.get("swash", "out")) -out = pathlib.Path(config.get("plot", "out")) -out.mkdir(exist_ok=True) +out = pathlib.Path(config.get("post", "out")) +out.mkdir(parents=True, exist_ok=True) def data(var): diff --git a/swash/processing/layers.py b/swash/processing/layers.py index e2d2f05..7b7fac1 100644 --- a/swash/processing/layers.py +++ b/swash/processing/layers.py @@ -21,8 +21,8 @@ config.read(args.config) inp = pathlib.Path(config.get("post", "inp")) root = pathlib.Path(config.get("swash", "out")) -out = pathlib.Path(config.get("plot", "out")) -out.mkdir(exist_ok=True) +out = pathlib.Path(config.get("post", "out")) +out.mkdir(parents=True, exist_ok=True) def data(var): diff --git a/swash/processing/read_swash.py b/swash/processing/read_swash.py index 8a983b7..8197bca 100644 --- a/swash/processing/read_swash.py +++ b/swash/processing/read_swash.py @@ -13,7 +13,7 @@ class ReadSwash: @classmethod def read_nohead(cls, path): - subprocess.run(("sed", "-i", r"s/ /\n/g", path)) + subprocess.run(("sed", "-i", r"s/\s\+/\n/g", path)) return np.loadtxt(path) def read_time(self, path): diff --git a/swash/processing/sws_npz.py b/swash/processing/sws_npz.py index 3c971ab..54eba2b 100644 --- a/swash/processing/sws_npz.py +++ b/swash/processing/sws_npz.py @@ -22,6 +22,7 @@ config.read(args.config) sws_out = pathlib.Path(config.get("swash", "out")) inp = pathlib.Path(config.get("post", "inp")) +inp.mkdir(parents=True, exist_ok=True) log.info(f"Reading swash output from '{sws_out}'") rsws = ReadSwash() @@ -32,15 +33,14 @@ var = { "dep": rsws.read_scalar, "botl": rsws.read_const, "watl": rsws.read_scalar, - "vel": rsws.read_vector, - "press": rsws.read_scalar, + "pressk": rsws.read_scalar_lay, + "nhprsk": rsws.read_scalar_lay, "zk": rsws.read_scalar_lay, "velk": rsws.read_vector_lay, "vz": rsws.read_scalar_lay, } -inp.mkdir(exist_ok=True) -with ThreadPool() as pool: +with ThreadPool(len(var)) as pool: log.info("Converting all data") pool.map( lambda x: np.save(