working on implementing the cubic interpolation. need to split that routine out of the run_baker method
This commit is contained in:
+8
-8
@@ -27,8 +27,8 @@ def get_phis(X, R):
|
||||
])
|
||||
try:
|
||||
phi = np.linalg.solve(A,b)
|
||||
except:
|
||||
print >> sys.stderr, "warning: get_phis: calculation of phis yielded a linearly dependant system"
|
||||
except LinAlgError as e:
|
||||
print >> sys.stderr, "warning: get_phis: calculation of phis yielded a linearly dependant system", e
|
||||
raise smberror('get_phis')
|
||||
phi = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
@@ -65,8 +65,8 @@ def get_phis_3D(X, r):
|
||||
])
|
||||
try:
|
||||
phi = np.linalg.solve(A,b)
|
||||
except:
|
||||
print >> sys.stderr, "warning: get_phis_3D: calculation of phis yielded a linearly dependant system"
|
||||
except LinAlgError as e:
|
||||
print >> sys.stderr, "warning: get_phis_3D: calculation of phis yielded a linearly dependant system", e
|
||||
phi = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
return phi
|
||||
@@ -152,8 +152,8 @@ def run_baker(X, R, S):
|
||||
# baker solve eq 10
|
||||
try:
|
||||
(a, b, c) = np.linalg.solve(A,b)
|
||||
except:
|
||||
print >> sys.stderr, "warning: run_baker: linear calculation went bad, resorting to np.linalg.pinv"
|
||||
except LinAlgError as e:
|
||||
print >> sys.stderr, "warning: run_baker: linear calculation went bad, resorting to np.linalg.pinv", e
|
||||
(a, b, c) = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
error_term = a * phi[0] * phi[1]\
|
||||
@@ -230,8 +230,8 @@ def run_baker_3D(X, R, S):
|
||||
# baker solve eq 10
|
||||
try:
|
||||
(a, b, c, d, e, f) = np.linalg.solve(A,b)
|
||||
except:
|
||||
print >> sys.stderr, "warning: run_baker: linear calculation went bad, resorting to np.linalg.pinv"
|
||||
except np.linalg.LinAlgError as e:
|
||||
print >> sys.stderr, "warning: run_baker: linear calculation went bad, resorting to np.linalg.pinv", e
|
||||
(a, b, c, d, e, f) = np.dot(np.linalg.pinv(A), b)
|
||||
|
||||
error_term = a * phi[0] * phi[1]\
|
||||
|
||||
Reference in New Issue
Block a user