Add no breakwater case
This commit is contained in:
parent
095964f7ae
commit
be4a18165f
2 changed files with 30 additions and 26 deletions
|
@ -8,6 +8,7 @@ psize=Psize.dat
|
|||
hires_step=0.5
|
||||
|
||||
[out]
|
||||
no_breakwater=True
|
||||
root=out
|
||||
sub=bathy_sub.npy
|
||||
out=bathy.npy
|
||||
|
|
|
@ -99,35 +99,38 @@ x_max_hires = x[z_crossing] + (
|
|||
log.debug(f"Replacing range: [{x_min_hires},{x_max_hires}]")
|
||||
|
||||
flt_x = (x > x_min_hires) & (x < x_max_hires)
|
||||
z[flt_x] = interpolate.griddata(
|
||||
hstru = np.zeros(z.shape)
|
||||
poro = np.zeros(z.shape)
|
||||
psize = np.zeros(z.shape)
|
||||
if config.getboolean("out", "no_breakwater", fallback=False):
|
||||
z[flt_x] = z[flt_x][-1]
|
||||
else:
|
||||
z[flt_x] = interpolate.griddata(
|
||||
(bathy_hires[:, 0],),
|
||||
bathy_hires[:, 1],
|
||||
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
|
||||
)
|
||||
)
|
||||
|
||||
hstru_in = np.loadtxt(hstru_inp)[::-1]
|
||||
hstru = np.zeros(z.shape)
|
||||
hstru[flt_x] = interpolate.griddata(
|
||||
hstru_in = np.loadtxt(hstru_inp)[::-1]
|
||||
hstru[flt_x] = interpolate.griddata(
|
||||
(bathy_hires[:,0],),
|
||||
hstru_in,
|
||||
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
|
||||
)
|
||||
)
|
||||
|
||||
poro_in = np.loadtxt(poro_inp)[::-1]
|
||||
poro = np.zeros(z.shape)
|
||||
poro[flt_x] = interpolate.griddata(
|
||||
poro_in = np.loadtxt(poro_inp)[::-1]
|
||||
poro[flt_x] = interpolate.griddata(
|
||||
(bathy_hires[:,0],),
|
||||
poro_in,
|
||||
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
|
||||
)
|
||||
)
|
||||
|
||||
psize_in = np.loadtxt(psize_inp)[::-1]
|
||||
psize = np.zeros(z.shape)
|
||||
psize[flt_x] = interpolate.griddata(
|
||||
psize_in = np.loadtxt(psize_inp)[::-1]
|
||||
psize[flt_x] = interpolate.griddata(
|
||||
(bathy_hires[:,0],),
|
||||
psize_in,
|
||||
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
|
||||
)
|
||||
)
|
||||
|
||||
np.savetxt(out_root.joinpath("bathy.dat"), z[::-1], newline=" ")
|
||||
np.savetxt(out_root.joinpath("hstru.dat"), hstru[::-1], newline=" ")
|
||||
|
|
Loading…
Reference in a new issue