Exceptions einheitlich
This commit is contained in:
@@ -43,8 +43,8 @@ def alpha_para2ell(ell: EllipsoidTriaxial, u: float, v: float, alpha_para: float
|
||||
alpha_ell = arctan2(p_ell @ sigma_para, q_ell @ sigma_para)
|
||||
sigma_ell = p_ell * sin(alpha_ell) + q_ell * cos(alpha_ell)
|
||||
|
||||
if np.linalg.norm(sigma_para - sigma_ell) > 1e-12:
|
||||
raise Exception("Alpha Umrechnung fehlgeschlagen")
|
||||
if np.linalg.norm(sigma_para - sigma_ell) > 1e-9:
|
||||
raise Exception("alpha_para2ell: Differenz in den Richtungsableitungen")
|
||||
|
||||
return beta, lamb, alpha_ell
|
||||
|
||||
@@ -69,7 +69,7 @@ def alpha_ell2para(ell: EllipsoidTriaxial, beta: float, lamb: float, alpha_ell:
|
||||
sigma_para = p_para * sin(alpha_para) + q_para * cos(alpha_para)
|
||||
|
||||
if np.linalg.norm(sigma_para - sigma_ell) > 1e-9:
|
||||
raise Exception("Alpha Umrechnung fehlgeschlagen")
|
||||
raise Exception("alpha_ell2para: Differenz in den Richtungsableitungen")
|
||||
|
||||
return u, v, alpha_para
|
||||
|
||||
@@ -171,12 +171,6 @@ def pq_para(ell: EllipsoidTriaxial, point: NDArray) -> Tuple[NDArray, NDArray]:
|
||||
q[2] * n[0] - q[0] * n[2],
|
||||
q[0] * n[1] - q[1] * n[0]])
|
||||
|
||||
t1 = np.dot(n, q)
|
||||
t2 = np.dot(n, p)
|
||||
t3 = np.dot(p, q)
|
||||
if not (t1 < 1e-10 or t1 > 1-1e-10) and not (t2 < 1e-10 or t2 > 1-1e-10) and not (t3 < 1e-10 or t3 > 1-1e-10):
|
||||
raise Exception("Fehler in den normierten Vektoren")
|
||||
|
||||
p = p / np.linalg.norm(p)
|
||||
q = q / np.linalg.norm(q)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user