Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-Lim authored Apr 5, 2024
1 parent 3c8d22e commit 4925f2d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/IHSetDean/IHSetDean.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def __init__(self, path):

self.Ymin = cfg['Ymin'].values
self.Ymax = cfg['Ymax'].values
self.Dmin = cfg['Dmin'].values
self.Dmax = cfg['Dmax'].values
self.dY = cfg['dy'].values
self.D50 = ens['D50'].values
self.dp = ens['d'].values
Expand All @@ -29,7 +31,7 @@ def calibrate(self):
self.d = self.dp - self.dp[0]

# Profile with equidistant points
dp = np.linspace(0, self.dp[-1], 500).reshape(-1, 1)
dp = np.linspace(self.Dmin, self.Dmax, 500).reshape(-1, 1)
interp_func = interp1d(self.d, self.zp, kind="linear", fill_value="extrapolate")
zp = interp_func(dp)
zp = zp[1:]
Expand Down
Binary file modified src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions src/IHSetDean/tests/test_dean.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import matplotlib.pyplot as plt

config = xr.Dataset(coords={'dy': 0.001, # Calibrate
'Ymin': -20, # Calibrate the minimum value
'Ymax': 0, # Calibrate the maximum value
'Ymin': -20, # Calibrate the minimum initial distance value
'Ymax': 20, # Calibrate the maximum initial distance value
'Dmin': 0, # Calibrate the minimum observed distnace value
'Dmax': 20, # Calibrate the maximum observed distance value
})

wrkDir = os.getcwd()
Expand Down

0 comments on commit 4925f2d

Please sign in to comment.