Added output of bathy and hstru to preprocess
This commit is contained in:
parent
2b6c561104
commit
f329690c3d
3 changed files with 19 additions and 5 deletions
1
swash/.gitignore
vendored
1
swash/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/cache
|
||||
/swash_buoytoartha
|
||||
|
|
|
@ -8,3 +8,6 @@ bathy=buoyarthabathy.dat
|
|||
hstru=Hstru.dat
|
||||
poro=Poro.dat
|
||||
psize=Psize.dat
|
||||
|
||||
[out]
|
||||
root=cache
|
||||
|
|
|
@ -31,10 +31,20 @@ x_hstru = np.arange(-0.5 * hstru.size, 0, 0.5)
|
|||
bathy_hires_pd = pd.Series(bathy_hires.copy(), index=x_hires)
|
||||
bathy_lores_pd = pd.Series(bathy_lores.copy(), index=x_lores)
|
||||
|
||||
bathy = bathy_lores_pd.reindex(
|
||||
bathy_lores_pd.index.union(bathy_hires_pd.index)
|
||||
bathy = pd.DataFrame(
|
||||
index=bathy_lores_pd.index.union(bathy_hires_pd.index),
|
||||
columns=("z", "hstru"),
|
||||
)
|
||||
bathy[bathy_hires_pd.index] = bathy_hires_pd
|
||||
bathy.z[bathy_lores_pd.index] = bathy_lores_pd
|
||||
bathy.z[bathy_hires_pd.index] = bathy_hires_pd
|
||||
|
||||
bathy.hstru = 0
|
||||
bathy.loc[x_hstru, "hstru"] = hstru
|
||||
|
||||
if config.has_section("out"):
|
||||
out = pathlib.Path(config.get("out", "root"))
|
||||
np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ")
|
||||
np.savetxt(out.joinpath("hstru.dat"), bathy.hstru, newline=" ")
|
||||
|
||||
if config.getboolean("proc", "plot", fallback=False):
|
||||
if plt is None:
|
||||
|
@ -44,8 +54,8 @@ if config.getboolean("proc", "plot", fallback=False):
|
|||
fig, ax = plt.subplots()
|
||||
ax.plot(x_hires, bathy_hires, label="High-res")
|
||||
ax.plot(x_lores, bathy_lores, label="Low-res")
|
||||
ax.plot(x_hstru, bathy[x_hstru]+hstru, label="H stru")
|
||||
ax.plot(bathy.index, bathy, ls="-.", c="k", label="Combined")
|
||||
ax.plot(bathy.index, bathy.z, ls="-.", c="k", label="Combined")
|
||||
ax.plot(bathy.index, bathy.hstru, label="H stru")
|
||||
|
||||
ax.grid()
|
||||
ax.legend()
|
||||
|
|
Loading…
Reference in a new issue