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

snapshot...

parent 3d43e61a
No related branches found
No related tags found
No related merge requests found
...@@ -114,4 +114,10 @@ def pressure_to_altitude(pres, temp, prof_pres, prof_temp, sfc_pres, sfc_temp, s ...@@ -114,4 +114,10 @@ def pressure_to_altitude(pres, temp, prof_pres, prof_temp, sfc_pres, sfc_temp, s
# http://fourier.eng.hmc.edu/e176/lectures/NM/node25.html # http://fourier.eng.hmc.edu/e176/lectures/NM/node25.html
def minimize_quadratic(xa, xb, xc, ya, yb, yc): def minimize_quadratic(xa, xb, xc, ya, yb, yc):
x_m = xb + 0.5*(((ya-yb)*(xc-xb)*(xc-xb) - (yc-yb)*(xb-xa)*(xb-xa)) / ((ya-yb)*(xc-xb) + (yc-yb)*(xb-xa))) x_m = xb + 0.5*(((ya-yb)*(xc-xb)*(xc-xb) - (yc-yb)*(xb-xa)*(xb-xa)) / ((ya-yb)*(xc-xb) + (yc-yb)*(xb-xa)))
return x_m return x_m
\ No newline at end of file
def value_to_index(nda, value):
diff = np.abs(nda - value)
idx = np.argmin(diff)
return idx
\ No newline at end of file
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