Skip to content

Commit c104468

Browse files
committed
Move cumulative sum into specific cases to fix problem with timelines with single reference state
1 parent 9fefaf0 commit c104468

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

saenopy/solver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,14 +1077,15 @@ def load_results(filename: str) -> List[Result]:
10771077

10781078
def subtract_reference_state(mesh_piv, mode):
10791079
U = [M.displacements_measured for M in mesh_piv]
1080-
# correct for the median position
1081-
if len(U) > 2:
1082-
xpos2 = np.cumsum(U, axis=0)
1080+
# correct for the different modes
1081+
if len(U) > 2:
10831082
if mode == "cumul.":
1084-
xpos2 = xpos2
1083+
xpos2 = np.cumsum(U, axis=0)
10851084
elif mode == "median":
1085+
xpos2 = np.cumsum(U, axis=0)
10861086
xpos2 -= np.nanmedian(xpos2, axis=0)
10871087
elif mode == "last":
1088+
xpos2 = np.cumsum(U, axis=0)
10881089
xpos2 -= xpos2[-1]
10891090
elif mode == "next":
10901091
xpos2 = U

0 commit comments

Comments
 (0)