Compare commits
2 Commits
020d282420
...
19887e4ac5
| Author | SHA1 | Date | |
|---|---|---|---|
| 19887e4ac5 | |||
| 737e4730aa |
@@ -1,7 +1,9 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
from numpy import sin, cos
|
||||||
|
from numpy.typing import NDArray
|
||||||
from ellipsoide import EllipsoidTriaxial
|
from ellipsoide import EllipsoidTriaxial
|
||||||
from GHA_triaxial.gha1_ana import gha1_ana
|
from GHA_triaxial.gha1_ana import gha1_ana
|
||||||
from GHA_triaxial.utils import func_sigma_ell, louville_constant
|
from GHA_triaxial.utils import func_sigma_ell, louville_constant, pq_ell
|
||||||
import plotly.graph_objects as go
|
import plotly.graph_objects as go
|
||||||
import winkelumrechnungen as wu
|
import winkelumrechnungen as wu
|
||||||
|
|
||||||
|
|||||||
@@ -97,58 +97,35 @@ def get_random_examples_umbilics_end(num: int, seed: int = None) -> List:
|
|||||||
|
|
||||||
def get_random_examples_gamma(group: str, num: int, seed: int = None, length: str = None) -> List:
|
def get_random_examples_gamma(group: str, num: int, seed: int = None, length: str = None) -> List:
|
||||||
eps = 1e-20
|
eps = 1e-20
|
||||||
long_short = 1.5
|
long_short = 2
|
||||||
if seed is not None:
|
if seed is not None:
|
||||||
random.seed(seed)
|
random.seed(seed)
|
||||||
with open(r"C:\Users\moell\OneDrive\Desktop\Vorlesungen\Master-Projekt\Python_Masterprojekt\GHA_triaxial\Karney_2024_Testset.txt") as datei:
|
with open(r"C:\Users\moell\OneDrive\Desktop\Vorlesungen\Master-Projekt\Python_Masterprojekt\GHA_triaxial\Karney_2024_Testset.txt") as datei:
|
||||||
lines = datei.readlines()
|
lines = datei.readlines()
|
||||||
examples = []
|
examples = []
|
||||||
while len(examples) < num:
|
i = 0
|
||||||
|
while len(examples) < num and i < len(lines):
|
||||||
example = line2example(lines[random.randint(0, len(lines) - 1)])
|
example = line2example(lines[random.randint(0, len(lines) - 1)])
|
||||||
|
if example in examples:
|
||||||
|
continue
|
||||||
|
i += 1
|
||||||
|
|
||||||
beta0, lamb0, alpha0_ell, beta1, lamb1, alpha1_ell, s = example
|
beta0, lamb0, alpha0_ell, beta1, lamb1, alpha1_ell, s = example
|
||||||
gamma = jacobi_konstante(beta0, lamb0, alpha0_ell, ell)
|
gamma = jacobi_konstante(beta0, lamb0, alpha0_ell, ell)
|
||||||
if group == "a":
|
|
||||||
if 1 >= gamma >= 0.1:
|
if group not in ["a", "b", "c", "d", "e"]:
|
||||||
if length == "short":
|
break
|
||||||
if example[6] < long_short:
|
elif group == "a" and not 1 >= gamma >= 0.01:
|
||||||
examples.append(example)
|
continue
|
||||||
elif length == "long":
|
elif group == "b" and not 0.01 > gamma > eps:
|
||||||
if example[6] >= long_short:
|
continue
|
||||||
examples.append(example)
|
elif group == "c" and not abs(gamma) <= eps:
|
||||||
else:
|
continue
|
||||||
examples.append(example)
|
elif group == "d" and not -eps > gamma > -1e-17:
|
||||||
if group == "b":
|
continue
|
||||||
if 0.1 > gamma > eps:
|
elif group == "e" and not -1e-17 >= gamma >= -1:
|
||||||
if length == "short":
|
continue
|
||||||
if example[6] < long_short:
|
|
||||||
examples.append(example)
|
|
||||||
elif length == "long":
|
|
||||||
if example[6] >= long_short:
|
|
||||||
examples.append(example)
|
|
||||||
else:
|
|
||||||
examples.append(example)
|
|
||||||
if group == "c":
|
|
||||||
if abs(gamma) <= eps:
|
|
||||||
if length == "short":
|
|
||||||
if example[6] < long_short:
|
|
||||||
examples.append(example)
|
|
||||||
elif length == "long":
|
|
||||||
if example[6] >= long_short:
|
|
||||||
examples.append(example)
|
|
||||||
else:
|
|
||||||
examples.append(example)
|
|
||||||
if group == "de":
|
|
||||||
if eps > gamma > -1e-17:
|
|
||||||
if length == "short":
|
|
||||||
if example[6] < long_short:
|
|
||||||
examples.append(example)
|
|
||||||
elif length == "long":
|
|
||||||
if example[6] >= long_short:
|
|
||||||
examples.append(example)
|
|
||||||
else:
|
|
||||||
examples.append(example)
|
|
||||||
if group == "e":
|
|
||||||
if -1e-17 >= gamma >= -1:
|
|
||||||
if length == "short":
|
if length == "short":
|
||||||
if example[6] < long_short:
|
if example[6] < long_short:
|
||||||
examples.append(example)
|
examples.append(example)
|
||||||
@@ -157,6 +134,7 @@ def get_random_examples_gamma(group: str, num: int, seed: int = None, length: st
|
|||||||
examples.append(example)
|
examples.append(example)
|
||||||
else:
|
else:
|
||||||
examples.append(example)
|
examples.append(example)
|
||||||
|
|
||||||
return examples
|
return examples
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
BIN
Tests/gha_resultsKarney.pkl
Normal file
BIN
Tests/gha_resultsKarney.pkl
Normal file
Binary file not shown.
BIN
Tests/gha_resultsPanou.pkl
Normal file
BIN
Tests/gha_resultsPanou.pkl
Normal file
Binary file not shown.
BIN
Tests/gha_resultsRandom.pkl
Normal file
BIN
Tests/gha_resultsRandom.pkl
Normal file
Binary file not shown.
@@ -783,7 +783,7 @@ def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b):
|
|||||||
if "on" not in (cb_stoch or []):
|
if "on" not in (cb_stoch or []):
|
||||||
return "", None
|
return "", None
|
||||||
|
|
||||||
n_in = int(n_in) if n_in else 1000
|
n_in = float(n_in) if n_in else 1000
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ell = EllipsoidTriaxial(ax, ay, b)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
@@ -837,7 +837,7 @@ def compute_gha1_approx(n1, cb_approx, ds_in, beta0, lamb0, s, a0, ax, ay, b):
|
|||||||
if not n1 or "on" not in (cb_approx or []):
|
if not n1 or "on" not in (cb_approx or []):
|
||||||
return "", None
|
return "", None
|
||||||
|
|
||||||
ds_in = int(ds_in) if ds_in else 1000
|
ds_in = float(ds_in) if ds_in else 1000
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ell = EllipsoidTriaxial(ax, ay, b)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
@@ -950,7 +950,7 @@ def compute_gha2_stoch(n2, cb_stoch, n_in, beta0, lamb0, beta1, lamb1, ax, ay, b
|
|||||||
if "on" not in (cb_stoch or []):
|
if "on" not in (cb_stoch or []):
|
||||||
return "", None
|
return "", None
|
||||||
|
|
||||||
n_in = int(n_in) if n_in else 1000
|
n_in = float(n_in) if n_in else 1000
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ell = EllipsoidTriaxial(ax, ay, b)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
@@ -1003,7 +1003,7 @@ def compute_gha2_approx(n2, cb_approx, ds_in, beta0, lamb0, beta1, lamb1, ax, ay
|
|||||||
if "on" not in (cb_approx or []):
|
if "on" not in (cb_approx or []):
|
||||||
return "", None
|
return "", None
|
||||||
|
|
||||||
ds_in = int(ds_in) if ds_in else 1000
|
ds_in = float(ds_in) if ds_in else 1000
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ell = EllipsoidTriaxial(ax, ay, b)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class EllipsoidBiaxial:
|
|||||||
|
|
||||||
phi2p = lambda self, phi: self.N(phi) * cos(phi)
|
phi2p = lambda self, phi: self.N(phi) * cos(phi)
|
||||||
|
|
||||||
def bi_cart2ell(self, point: NDArrayself, Eh: float = 0.001, Ephi: float = wu.gms2rad([0, 0, 0.001])) -> Tuple[float, float, float]:
|
def bi_cart2ell(self, point: NDArray, Eh: float = 0.001, Ephi: float = wu.gms2rad([0, 0, 0.001])) -> Tuple[float, float, float]:
|
||||||
"""
|
"""
|
||||||
Umrechnung von kartesischen in ellipsoidische Koordinaten auf einem Rotationsellipsoid
|
Umrechnung von kartesischen in ellipsoidische Koordinaten auf einem Rotationsellipsoid
|
||||||
# TODO: Quelle
|
# TODO: Quelle
|
||||||
|
|||||||
Reference in New Issue
Block a user