Updates in data
This commit is contained in:
parent
1323a6b5fe
commit
8ff521ee0b
3 changed files with 14 additions and 31 deletions
1
data/.gitignore
vendored
Normal file
1
data/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/out
|
|
@ -1,7 +1,8 @@
|
|||
[bathy]
|
||||
inp=Database_20220224.xyz
|
||||
sub=bathy_sub.npy
|
||||
out=bathy.npy
|
||||
inp=data/Database_20220224.xyz
|
||||
sub=out/bathy_sub.npy
|
||||
out=out/bathy.npy
|
||||
step=1
|
||||
|
||||
[artha]
|
||||
lat=43.398450
|
||||
|
|
|
@ -32,7 +32,7 @@ bathy = np.stack(
|
|||
*projection.cartesian(bathy_curvi[:, 0], bathy_curvi[:, 1]),
|
||||
bathy_curvi[:, 2],
|
||||
),
|
||||
axis=1
|
||||
axis=1,
|
||||
)
|
||||
log.debug(f"Cartesian bathy: {bathy}")
|
||||
|
||||
|
@ -46,37 +46,18 @@ buoy_curvi = np.array(
|
|||
artha = np.asarray(projection.cartesian(*artha_curvi))
|
||||
buoy = np.asarray(projection.cartesian(*buoy_curvi))
|
||||
|
||||
|
||||
def display():
|
||||
x = np.linspace(bathy[:, 0].min(), bathy[:, 0].max())
|
||||
y = np.linspace(bathy[:, 1].min(), bathy[:, 1].max())
|
||||
|
||||
X, Y = np.meshgrid(x, y)
|
||||
|
||||
Z = interpolate.griddata(
|
||||
bathy[:, :2], bathy[:, 2], (X, Y), method="nearest"
|
||||
)
|
||||
|
||||
fix, ax = plt.subplots()
|
||||
ax.pcolormesh(X, Y, Z)
|
||||
ax.scatter(*artha, c="k")
|
||||
ax.scatter(*buoy, c="k")
|
||||
|
||||
ax.axis("equal")
|
||||
return ax
|
||||
|
||||
|
||||
D = np.diff(np.stack((artha, buoy)), axis=0)
|
||||
x = np.arange(-150, np.sqrt((D**2).sum()) + 150)
|
||||
x = np.arange(
|
||||
-150,
|
||||
np.sqrt((D**2).sum()) + 150,
|
||||
config.getfloat("bathy", "step", fallback=1),
|
||||
)
|
||||
theta = np.angle(D.dot((1, 1j)))
|
||||
|
||||
coords = artha + (x * np.stack((np.cos(theta), np.sin(theta)))).T
|
||||
|
||||
log.info("Interpolating bathymetry in 1D")
|
||||
z = interpolate.griddata(bathy[:, :2], bathy[:, 2], coords)
|
||||
log.debug(z)
|
||||
|
||||
ax = display()
|
||||
ax.scatter(*coords.T, c="k", marker=".")
|
||||
|
||||
fig_1d, ax_1d = plt.subplots()
|
||||
ax_1d.plot(x, z)
|
||||
plt.show(block=True)
|
||||
|
|
Loading…
Reference in a new issue