Skip to content

Commit 5bad925

Browse files
klapomtezzele
authored andcommitted
Restore storing the window time means
- Should hopefully fix the failing tests by allowing COSTS to accurately reconstruct the data by saving the window time means.
1 parent 4d896cc commit 5bad925

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pydmd/costs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ def fit(
485485
time_window = original_time_window - t_start
486486

487487
# Subtract off the time mean before rounding corners.
488+
c = np.mean(data_window, 1, keepdims=True)
489+
data_window = data_window - c
488490
data_window -= np.mean(data_window, 1, keepdims=True)
489491

490492
# Round the corners of the window.
@@ -515,9 +517,7 @@ def fit(
515517
self._amplitudes_array[
516518
k, : optdmd.eigs.shape[0]
517519
] = optdmd.amplitudes
518-
self._window_means_array[k] = np.mean(
519-
data_window, 1, keepdims=True
520-
).flatten()
520+
self._window_means_array[k] = c.flatten()
521521
self._time_array[k] = original_time_window
522522

523523
# Reset optdmd between iterations

0 commit comments

Comments
 (0)