Skip to content
Snippets Groups Projects
Commit d9f87ac5 authored by tomrink's avatar tomrink
Browse files

snapshot

parent ab2809cc
No related branches found
No related tags found
No related merge requests found
...@@ -291,7 +291,8 @@ def minimize_quadratic(xa, xb, xc, ya, yb, yc): ...@@ -291,7 +291,8 @@ def minimize_quadratic(xa, xb, xc, ya, yb, yc):
return x_m return x_m
# Return index of nda closest to value. nda must be 1d # Return index of nda closest to value. nda (numpy.ndarray) must be 1d. If multiple occurrences should arise,
# the first is returned according to NumPy's argmin/max function.
def value_to_index(nda, value): def value_to_index(nda, value):
diff = np.abs(nda - value) diff = np.abs(nda - value)
idx = np.argmin(diff) idx = np.argmin(diff)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment