diff --git a/src/IHSetDean/IHSetDean.py b/src/IHSetDean/IHSetDean.py index 74b9c6c..1d54c93 100644 --- a/src/IHSetDean/IHSetDean.py +++ b/src/IHSetDean/IHSetDean.py @@ -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 @@ -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:] diff --git a/src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc b/src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc index 5e28647..f7ea3f6 100644 Binary files a/src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc and b/src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc differ diff --git a/src/IHSetDean/tests/__pycache__/test_dean.cpython-312-pytest-8.0.2.pyc b/src/IHSetDean/tests/__pycache__/test_dean.cpython-312-pytest-8.0.2.pyc index cd368b1..8776f99 100644 Binary files a/src/IHSetDean/tests/__pycache__/test_dean.cpython-312-pytest-8.0.2.pyc and b/src/IHSetDean/tests/__pycache__/test_dean.cpython-312-pytest-8.0.2.pyc differ diff --git a/src/IHSetDean/tests/test_dean.py b/src/IHSetDean/tests/test_dean.py index 53bf09e..87cd556 100644 --- a/src/IHSetDean/tests/test_dean.py +++ b/src/IHSetDean/tests/test_dean.py @@ -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()