Skip to content

Commit a78a8de

Browse files
committed
fix: fourier series should use fitted params
1 parent 4771c1b commit a78a8de

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

LoopStructural/modelling/features/fold/_fold_rotation_angle.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,19 @@ def fit_fourier_series(
8989
# otherwise set the fourier series parameters to 0
9090
popt = guess
9191
logger.error("Could not fit curve to S-Plot, check the wavelength")
92+
self.fitted_params = popt
9293
logger.info(f"Fitted: {popt[0]} {popt[1]} {popt[2]} {popt[3]}")
9394
self.fold_rotation_function = lambda x: np.rad2deg(
94-
np.arctan(fourier_series(x, popt[0], popt[1], popt[2], popt[3]))
95+
np.arctan(
96+
fourier_series(
97+
x,
98+
self.fitted_params[0],
99+
self.fitted_params[1],
100+
self.fitted_params[2],
101+
self.fitted_params[3],
102+
)
103+
)
95104
)
96-
self.fitted_params = popt
97105

98106
def __call__(self, fold_frame_coordinate):
99107
"""

0 commit comments

Comments
 (0)