Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MarliesA committed Mar 8, 2024
2 parents 054cc5c + 5e928c1 commit d9a8b2a
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 55 deletions.
100 changes: 61 additions & 39 deletions examples/xbeach-setup-1D.ipynb

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions examples/xbeach-setup-2D.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='xbTools',
version='1.0.0',
version='1.0.2',
description='Toolbox to analyse and setup xbeach models',
url='https://github.com/openearth/xbeach-toolbox',
# Authors: Menno de Ridder (menno.deridder@deltares.nl), Cas van Bemmelen (cas.van.bemmelen@witteveenbos.com)
Expand Down
4 changes: 2 additions & 2 deletions xbTools/grid/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def seaward_extend(x,y,z,slope=1/20,depth=-20):
## dummy array
x_dummy = np.arange(x[0, 0]-distance, x[0, 0], dx_grid)
# prevent very small grid sizes when floating point zero goes wrong for computing var distance!
if (x_dummy[-1]-x[0, 0])< 0.01:
x_dummy = x_dummy[:-1]
#if (x_dummy[-1]-x[0, 0])< 0.01:
# x_dummy = x_dummy[:-1]

x_extend = np.ones((x.shape[0], len(x_dummy) ))
x_extend = x_extend * x_dummy
Expand Down
6 changes: 3 additions & 3 deletions xbTools/xbeachtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ def _plotdomain(self,save_path=None):
thetamin_uv, thetamax_uv = self._make_theta_vectors()
if self.fast1D==True:
plt.subplot(2,1,1)
plt.plot(np.squeeze(self.xgr),np.squeeze(self.zgr)*self.posdwn)
plt.plot(np.squeeze(self.xgr),np.squeeze(self.zgr)*-self.posdwn)
plt.ylabel('z')
plt.subplot(2,1,2)
plt.plot(np.squeeze(self.xgr)[1:],np.diff(np.squeeze(self.xgr)))
plt.xlabel('x')
plt.ylabel('dx')
else:
plt.subplot(2,2,1)
plt.pcolor(self.xgr,self.ygr,self.zgr*self.posdwn)
plt.pcolor(self.xgr,self.ygr,self.zgr*-self.posdwn)
plt.ylabel('y')
plt.colorbar()
plt.axis('equal')
Expand All @@ -585,7 +585,7 @@ def _plotdomain(self,save_path=None):

plt.subplot(2,2,3)
[X_world,Y_world] = rotate_grid(self.xgr,self.ygr,np.deg2rad(self.alfa))
plt.pcolor(X_world+self.xori,Y_world+self.yori,self.zgr*self.posdwn)
plt.pcolor(X_world+self.xori,Y_world+self.yori,self.zgr*-self.posdwn)
plt.xlabel('x')
plt.ylabel('y')
plt.axis('equal')
Expand Down

0 comments on commit d9a8b2a

Please sign in to comment.