diff --git a/GHA_triaxial/gha1_ES.py b/GHA_triaxial/gha1_ES.py index fc9a1e8..9651b66 100644 --- a/GHA_triaxial/gha1_ES.py +++ b/GHA_triaxial/gha1_ES.py @@ -209,8 +209,8 @@ def optimize_next_point(beta_i: float, omega_i: float, alpha_i: float, ds: float return beta_best, omega_best, P_best, alpha_end -def gha1_ES(ell: EllipsoidTriaxial, beta0: float, omega0: float, alpha0: float, s_total: float, maxSegLen: float = 1000)\ - -> Tuple[NDArray, float, NDArray]: +def gha1_ES(ell: EllipsoidTriaxial, beta0: float, omega0: float, alpha0: float, s_total: float, maxSegLen: float = 1000, all_points: boolean = False)\ + -> Tuple[NDArray, float, NDArray] | Tuple[NDArray, float]: """ Aufruf der 1. GHA mittels CMA-ES :param ell: Ellipsoid @@ -219,6 +219,7 @@ def gha1_ES(ell: EllipsoidTriaxial, beta0: float, omega0: float, alpha0: float, :param alpha0: Azimut Startkoordinate :param s_total: Gesamtstrecke :param maxSegLen: maximale Segmentlänge + :param all_points: Alle Punkte ausgeben? :return: Zielpunkt Pk, Azimut am Zielpunkt und Punktliste """ beta = float(beta0) @@ -236,7 +237,7 @@ def gha1_ES(ell: EllipsoidTriaxial, beta0: float, omega0: float, alpha0: float, while s_acc < s_total - 1e-9: step += 1 ds = min(maxSegLen, s_total - s_acc) - print(f"[GHA1-ES] Step {step}/{nsteps_est} ds={ds:.3f} m s_acc={s_acc:.3f} m beta={beta:.6f} omega={omega:.6f} alpha={alpha:.6f}") + # print(f"[GHA1-ES] Step {step}/{nsteps_est} ds={ds:.3f} m s_acc={s_acc:.3f} m beta={beta:.6f} omega={omega:.6f} alpha={alpha:.6f}") beta, omega, P, alpha = optimize_next_point(beta_i=beta, omega_i=omega, alpha_i=alpha, ds=ds, gamma0=gamma0, ell=ell, maxSegLen=maxSegLen) @@ -248,7 +249,10 @@ def gha1_ES(ell: EllipsoidTriaxial, beta0: float, omega0: float, alpha0: float, Pk = P_all[-1] alpha1 = float(alpha_end[-1]) - return Pk, alpha1, np.array(P_all) + if all_points: + return Pk, alpha1, np.array(P_all) + else: + return Pk, alpha1 if __name__ == "__main__": diff --git a/GHA_triaxial/gha1_ana.py b/GHA_triaxial/gha1_ana.py index b9bb16f..9ece368 100644 --- a/GHA_triaxial/gha1_ana.py +++ b/GHA_triaxial/gha1_ana.py @@ -1,10 +1,11 @@ +import math from math import comb from typing import Tuple import numpy as np from numpy import sin, cos, arctan2 from numpy._typing import NDArray -from scipy.special import factorial as fact +import winkelumrechnungen as wu from ellipsoide import EllipsoidTriaxial from GHA_triaxial.utils import pq_para @@ -64,7 +65,7 @@ def gha1_ana_step(ell: EllipsoidTriaxial, point: NDArray, alpha0: float, s: floa x_m.append(x_(m)) y_m.append(y_(m)) z_m.append(z_(m)) - fact_m = fact(m) + fact_m = math.factorial(m) # 22-24 a_m.append(x_m[m] / fact_m) @@ -112,7 +113,7 @@ def gha1_ana_step(ell: EllipsoidTriaxial, point: NDArray, alpha0: float, s: floa return p1, alpha1 -def gha1_ana(ell: EllipsoidTriaxial, point: NDArray, alpha0: float, s: float, maxM: int, maxPartCircum: int = 2) -> Tuple[NDArray, float]: +def gha1_ana(ell: EllipsoidTriaxial, point: NDArray, alpha0: float, s: float, maxM: int, maxPartCircum: int = 4) -> Tuple[NDArray, float]: """ :param ell: Ellipsoid :param point: Punkt in kartesischen Koordinaten @@ -134,3 +135,11 @@ def gha1_ana(ell: EllipsoidTriaxial, point: NDArray, alpha0: float, s: float, ma raise Exception("Analytische Methode ist explodiert, Punkt liegt nicht mehr auf dem Ellipsoid") return point_end, alpha_end + + +if __name__ == "__main__": + ell = EllipsoidTriaxial.init_name("BursaSima1980round") + p0 = ell.ell2cart(wu.deg2rad(10), wu.deg2rad(20)) + p1, alpha1 = gha1_ana(ell, p0, wu.deg2rad(36), 200000, 70) + print(p1, wu.rad2gms(alpha1)) + diff --git a/GHA_triaxial/gha2_ES.py b/GHA_triaxial/gha2_ES.py index b1e778f..6bbb4c4 100644 --- a/GHA_triaxial/gha2_ES.py +++ b/GHA_triaxial/gha2_ES.py @@ -8,8 +8,7 @@ from GHA_triaxial.gha2_num import gha2_num from GHA_triaxial.utils import sigma2alpha, pq_ell -P_left: NDArray = None -P_right: NDArray = None + def Sehne(P1: NDArray, P2: NDArray) -> float: @@ -25,34 +24,10 @@ def Sehne(P1: NDArray, P2: NDArray) -> float: return s -def midpoint_fitness(x: tuple) -> float: - """ - Fitness für einen Mittelpunkt P_middle zwischen P_left und P_right auf dem triaxialen Ellipsoid: - - Minimiert d(P_left, P_middle) + d(P_middle, P_right) - - Erzwingt d(P_left,P_middle) ≈ d(P_middle,P_right) (echter Mittelpunkt im Sinne der Polygonkette) - :param x: enthält die Startwerte von u und v - :return: Fitnesswert (f) - """ - global P_left, P_right - - u, v = x - P_middle = ell.para2cart(u, v) - d1 = Sehne(P_left, P_middle) - d2 = Sehne(P_middle, P_right) - base = d1 + d2 - - # midpoint penalty (dimensionslos) - # relative Differenz, skaliert über verschiedene Segmentlängen - denom = max(base, 1e-9) - pen_equal = ((d1 - d2) / denom) ** 2 - w_equal = 10.0 - - f = base + denom * w_equal * pen_equal - - return f -def gha2_ES(ell: EllipsoidTriaxial, P0: NDArray, Pk: NDArray, maxSegLen: float = None, all_points: bool = True) -> Tuple[float, float, float, NDArray]: + +def gha2_ES(ell: EllipsoidTriaxial, P0: NDArray, Pk: NDArray, maxSegLen: float = None, all_points: bool = False) -> Tuple[float, float, float, NDArray] | Tuple[float, float, float]: """ Berechnen der 2. GHA mithilfe der CMA-ES. Die CMA-ES optimiert sukzessive den Mittelpunkt zwischen Start- und Zielpunkt. Der Abbruch der Berechnung erfolgt, wenn alle Segmentlängen <= maxSegLen sind. @@ -64,6 +39,35 @@ def gha2_ES(ell: EllipsoidTriaxial, P0: NDArray, Pk: NDArray, maxSegLen: float = :param all_points: Ergebnisliste mit allen Punkte, die wahlweise mit ausgegeben wird :return: Richtungswinkel in RAD des Start- und Zielpunktes und Gesamtlänge """ + P_left: NDArray = None + P_right: NDArray = None + + def midpoint_fitness(x: tuple) -> float: + """ + Fitness für einen Mittelpunkt P_middle zwischen P_left und P_right auf dem triaxialen Ellipsoid: + - Minimiert d(P_left, P_middle) + d(P_middle, P_right) + - Erzwingt d(P_left,P_middle) ≈ d(P_middle,P_right) (echter Mittelpunkt im Sinne der Polygonkette) + :param x: enthält die Startwerte von u und v + :return: Fitnesswert (f) + """ + nonlocal P_left, P_right, ell + + u, v = x + P_middle = ell.para2cart(u, v) + d1 = Sehne(P_left, P_middle) + d2 = Sehne(P_middle, P_right) + base = d1 + d2 + + # midpoint penalty (dimensionslos) + # relative Differenz, skaliert über verschiedene Segmentlängen + denom = max(base, 1e-9) + pen_equal = ((d1 - d2) / denom) ** 2 + w_equal = 10.0 + + f = base + denom * w_equal * pen_equal + + return f + R0 = (ell.ax + ell.ay + ell.b) / 3 if maxSegLen is None: maxSegLen = R0 * 1 / (637.4*2) # 10km Segment bei mittleren Erdradius @@ -85,10 +89,10 @@ def gha2_ES(ell: EllipsoidTriaxial, P0: NDArray, Pk: NDArray, maxSegLen: float = A = points[i] B = points[i+1] dAB = Sehne(A, B) - print(dAB) + # print(dAB) if dAB > maxSegLen: - global P_left, P_right + # global P_left, P_right P_left, P_right = A, B Au, Av = ell.cart2para(A) Bu, Bv = ell.cart2para(B) @@ -109,7 +113,7 @@ def gha2_ES(ell: EllipsoidTriaxial, P0: NDArray, Pk: NDArray, maxSegLen: float = new_points.append(B) points = new_points - print(f"[Level {level}] Punkte: {len(points)} | max Segment: {max_len:.3f} m") + # print(f"[Level {level}] Punkte: {len(points)} | max Segment: {max_len:.3f} m") P_all = np.vstack(points) totalLen = float(np.sum(np.linalg.norm(P_all[1:] - P_all[:-1], axis=1))) diff --git a/Hansen_ES_CMA.py b/Hansen_ES_CMA.py index 055e3ee..ae2eed3 100644 --- a/Hansen_ES_CMA.py +++ b/Hansen_ES_CMA.py @@ -64,7 +64,7 @@ def escma(func, *, N=10, xmean=None, sigma=0.5, stopfitness=1e-14, stopeval=2000 gen = 0 - print(f' [CMA-ES] Start: lambda = {lambda_}, sigma ={round(sigma, 6)}, stopeval = {stopeval}') + # print(f' [CMA-ES] Start: lambda = {lambda_}, sigma ={round(sigma, 6)}, stopeval = {stopeval}') while counteval < stopeval: gen += 1 @@ -95,14 +95,15 @@ def escma(func, *, N=10, xmean=None, sigma=0.5, stopfitness=1e-14, stopeval=2000 if gen == 1 or gen%50==0: - print(f' [CMA-ES] Gen {gen}, best = {round(fbest, 6)}, sigma = {sigma:.3g}') + # print(f' [CMA-ES] Gen {gen}, best = {round(fbest, 6)}, sigma = {sigma:.3g}') + pass if noImproveGen >= maxNoImproveGen: - print(f' [CMA-ES] Abbruch: keine Verbesserung > {round(absTolImprove, 3)} in {maxNoImproveGen} Generationen.') + # print(f' [CMA-ES] Abbruch: keine Verbesserung > {round(absTolImprove, 3)} in {maxNoImproveGen} Generationen.') break if sigma < sigmaImprove: - print(f' [CMA-ES] Abbruch: sigma zu klein {sigma:.3g}') + # print(f' [CMA-ES] Abbruch: sigma zu klein {sigma:.3g}') break @@ -140,7 +141,7 @@ def escma(func, *, N=10, xmean=None, sigma=0.5, stopfitness=1e-14, stopeval=2000 # Escape flat fitness, or better terminate? if arfitness[0] == arfitness[int(np.ceil(0.7 * lambda_)) - 1]: sigma = sigma * np.exp(0.2 + cs / damps) - print(' [CMA-ES] stopfitness erreicht.') + # print(' [CMA-ES] stopfitness erreicht.') #print("warning: flat fitness, consider reformulating the objective") break @@ -150,7 +151,7 @@ def escma(func, *, N=10, xmean=None, sigma=0.5, stopfitness=1e-14, stopeval=2000 #print(f"{counteval}: {arfitness[0]}") xmin = arx[:, arindex[0]] bestValue = arfitness[0] - print(f' [CMA-ES] Ende: Gen = {gen}, best = {round(bestValue, 6)}') + # print(f' [CMA-ES] Ende: Gen = {gen}, best = {round(bestValue, 6)}') return xmin diff --git a/Tests/algorithms_test.ipynb b/Tests/algorithms_test.ipynb index 88bd2d5..05b2635 100644 --- a/Tests/algorithms_test.ipynb +++ b/Tests/algorithms_test.ipynb @@ -1,30 +1,21 @@ { "cells": [ { + "metadata": {}, "cell_type": "code", - "id": "initial_id", - "metadata": { - "collapsed": true, - "ExecuteTime": { - "end_time": "2026-02-04T17:56:25.185202Z", - "start_time": "2026-02-04T17:56:22.991833Z" - } - }, + "outputs": [], + "execution_count": null, "source": [ "%load_ext autoreload\n", "%autoreload 2" ], - "outputs": [], - "execution_count": 1 + "id": "89aa93e9dbedd113" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T17:56:35.920624Z", - "start_time": "2026-02-04T17:56:25.201916Z" - } - }, + "metadata": {}, "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "%reload_ext autoreload\n", "%autoreload 2\n", @@ -55,18 +46,13 @@ "from GHA_triaxial.numeric_examples_panou import get_tables as get_tables_panou\n", "from GHA_triaxial.numeric_examples_karney import get_random_examples as get_examples_karney" ], - "id": "961cb22764c5bcb9", - "outputs": [], - "execution_count": 2 + "id": "2005e5a8854eea1e" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T17:56:36.470974Z", - "start_time": "2026-02-04T17:56:35.937646Z" - } - }, + "metadata": {}, "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "@contextmanager\n", "def suppress_print():\n", @@ -74,18 +60,13 @@ " with redirect_stdout(fnull), redirect_stderr(fnull):\n", " yield" ], - "id": "e4740625a366ac13", - "outputs": [], - "execution_count": 3 + "id": "90f107a11ff0de7e" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T18:11:14.405810Z", - "start_time": "2026-02-04T18:11:14.169636Z" - } - }, + "metadata": {}, "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "# dsPart = [60, 125, 600, 1250, 6000, 60000] entspricht bei der Erde ca. 100km, 50km, 10km, 5km, 1km, 100m\n", "\n", @@ -99,22 +80,17 @@ "dsPart_gha2_ES = [60, 600, 1250]\n", "dsPart_gha2_approx = [600, 1250, 6000]" ], - "id": "96093cdde03f8d57", - "outputs": [], - "execution_count": 16 + "id": "fc6c39b8d358e54b" }, { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T18:11:15.988345Z", - "start_time": "2026-02-04T18:11:15.774321Z" - } - }, + "metadata": {}, "cell_type": "code", + "outputs": [], + "execution_count": null, "source": [ "# test = \"Karney\"\n", - "test = \"Panou\"\n", - "# test = \"Random\"\n", + "# test = \"Panou\"\n", + "test = \"Random\"\n", "if test == \"Karney\":\n", " ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"KarneyTest2024\")\n", " examples = get_examples_karney(4, seed=42)\n", @@ -131,7 +107,7 @@ " ell: EllipsoidTriaxial = EllipsoidTriaxial.init_name(\"BursaSima1980round\")\n", " examples = [] # beta0, lamb0, alpha0_ell, beta1, lamb1, alpha1_ell, s\n", " random.seed(42)\n", - " for _ in range(10):\n", + " for _ in range(30):\n", " beta0 = wu.deg2rad(random.randint(-90, 90))\n", " lamb0 = wu.deg2rad(random.randint(-179, 180))\n", " alpha0_ell = wu.deg2rad(random.randint(0, 359))\n", @@ -139,15 +115,16 @@ " examples.append([beta0, lamb0, alpha0_ell, s])\n", " pass" ], - "id": "6e384cc01c2dbe", - "outputs": [], - "execution_count": 17 + "id": "6770dbd57d475127" }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-06T14:13:16.909538Z", + "start_time": "2026-02-06T14:13:16.436261Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "if test != \"Random\":\n", " results = {}\n", @@ -277,13 +254,20 @@ "\n", " results[f\"beta0: {wu.rad2deg(beta0):.3f}, lamb0: {wu.rad2deg(lamb0):.3f}, alpha0: {wu.rad2deg(alpha0_ell):.3f}, s: {s}\"] = example_results" ], - "id": "2a87e028089a215" + "id": "fc45e0f618a0e4d8", + "outputs": [], + "execution_count": 53 }, { - "metadata": {}, + "metadata": { + "jupyter": { + "is_executing": true + }, + "ExecuteTime": { + "start_time": "2026-02-06T14:48:29.343679Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "if test == \"Random\":\n", " results = {}\n", @@ -293,8 +277,8 @@ "\n", " beta0, lamb0, alpha0_ell, s = example\n", " P0 = ell.ell2cart(beta0, lamb0)\n", - " _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n", "\n", + " # _, _, alpha0_para = alpha_ell2para(ell, beta0, lamb0, alpha0_ell)\n", " # P1_ana, alpha1_ana_para = gha1_ana(ell, P0, alpha0_para, s, maxM=60, maxPartCircum=4)\n", " # beta1_ana, lamb1_ana = ell.cart2ell(P1_ana)\n", " # _, _, alpha1_ana = alpha_para2ell(ell, beta1_ana, lamb1_ana, alpha1_ana_para)\n", @@ -335,37 +319,52 @@ " print(e)\n", " example_results[f\"GHA1_approx_{dsPart}\"] = (nan, nan, nan, nan)\n", "\n", - " # for steps in steps_gha2_num:\n", - " # start = time.perf_counter()\n", - " # try:\n", - " # with warnings.catch_warnings():\n", - " # warnings.simplefilter(\"ignore\", RuntimeWarning)\n", - " # alpha0_num, alpha1_num_2, s_num = gha2_num(ell, beta0, lamb0, beta1, lamb1, n=steps)\n", - " # end = time.perf_counter()\n", - " # d_alpha0 = abs(wu.rad2deg(alpha0_num - alpha0_ell)) / 3600\n", - " # d_alpha1 = abs(wu.rad2deg(alpha1_num_2 - alpha1_ell)) / 3600\n", - " # d_s = abs(s_num - s) / 1000\n", - " # d_time = end - start\n", - " # example_results[f\"GHA2_num_{steps}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n", - " # except Exception as e:\n", - " # print(e)\n", - " # example_results[f\"GHA2_num_{steps}\"] = (nan, nan, nan, nan)\n", - " #\n", - " # for dsPart in dsPart_gha2_ES:\n", - " # ds = ell.ax/dsPart\n", - " # start = time.perf_counter()\n", - " # try:\n", - " # with suppress_print():\n", - " # alpha0_ES, alpha1_ES, s_ES = gha2_ES(ell, P0, P1, maxSegLen=ds)\n", - " # end = time.perf_counter()\n", - " # d_alpha0 = abs(wu.rad2deg(alpha0_ES - alpha0_ell)) / 3600\n", - " # d_alpha1 = abs(wu.rad2deg(alpha1_ES - alpha1_ell)) / 3600\n", - " # d_s = abs(s_ES - s) / 1000\n", - " # d_time = end - start\n", - " # example_results[f\"GHA2_ES_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n", - " # except Exception as e:\n", - " # print(e)\n", - " # example_results[f\"GHA2_ES_{dsPart}\"] = (nan, nan, nan, nan)\n", + " for dsPart in dsPart_gha1_ES:\n", + " start = time.perf_counter()\n", + " try:\n", + " P1_ES, alpha1_ES = gha1_ES(ell, beta0, lamb0, alpha0_ell, s, maxSegLen=dsPart)\n", + " end = time.perf_counter()\n", + " beta1_ES, lamb1_ES = ell.cart2ell(P1_ES)\n", + " d_beta1 = abs(beta1_ES - beta1)\n", + " d_lamb1 = abs(lamb1_ES - lamb1)\n", + " d_alpha1 = abs(alpha1_ES - alpha1_ell)\n", + " d_time = end - start\n", + " example_results[f\"GHA1_ES_{dsPart}\"] = (d_beta1, d_lamb1, d_alpha1, d_time)\n", + " except Exception as e:\n", + " print(e)\n", + " example_results[f\"GHA1_ES_{dsPart}\"] = (nan, nan, nan, nan)\n", + "\n", + " for steps in steps_gha2_num:\n", + " start = time.perf_counter()\n", + " try:\n", + " with warnings.catch_warnings():\n", + " warnings.simplefilter(\"ignore\", RuntimeWarning)\n", + " alpha0_num, alpha1_num_2, s_num = gha2_num(ell, beta0, lamb0, beta1, lamb1, n=steps)\n", + " end = time.perf_counter()\n", + " d_alpha0 = abs(wu.rad2deg(alpha0_num - alpha0_ell)) / 3600\n", + " d_alpha1 = abs(wu.rad2deg(alpha1_num_2 - alpha1_ell)) / 3600\n", + " d_s = abs(s_num - s) / 1000\n", + " d_time = end - start\n", + " example_results[f\"GHA2_num_{steps}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n", + " except Exception as e:\n", + " print(e)\n", + " example_results[f\"GHA2_num_{steps}\"] = (nan, nan, nan, nan)\n", + "\n", + " for dsPart in dsPart_gha2_ES:\n", + " ds = ell.ax/dsPart\n", + " start = time.perf_counter()\n", + " try:\n", + " with suppress_print():\n", + " alpha0_ES, alpha1_ES, s_ES = gha2_ES(ell, P0, P1, maxSegLen=ds)\n", + " end = time.perf_counter()\n", + " d_alpha0 = abs(wu.rad2deg(alpha0_ES - alpha0_ell)) / 3600\n", + " d_alpha1 = abs(wu.rad2deg(alpha1_ES - alpha1_ell)) / 3600\n", + " d_s = abs(s_ES - s) / 1000\n", + " d_time = end - start\n", + " example_results[f\"GHA2_ES_{dsPart}\"] = (d_alpha0, d_alpha1, d_s, d_time)\n", + " except Exception as e:\n", + " print(e)\n", + " example_results[f\"GHA2_ES_{dsPart}\"] = (nan, nan, nan, nan)\n", "\n", " for dsPart in dsPart_gha2_approx:\n", " ds = ell.ax/dsPart\n", @@ -386,45 +385,49 @@ "\n", "\n" ], - "id": "d8868b5f0e6f9b42" - }, - { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T14:35:09.900827Z", - "start_time": "2026-02-04T14:35:09.690955Z" + "id": "6e20a077d522d5", + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "----- Beispiel 1/30\n", + "Fehler in der Umrechnung cart2ell\n" + ] } - }, - "cell_type": "code", - "source": [ - "# with open(f\"gha_results{test}.pkl\", \"wb\") as f:\n", - "# pickle.dump(results, f)" ], - "id": "664105ea35d50a7b", - "outputs": [], - "execution_count": 7 - }, - { - "metadata": { - "ExecuteTime": { - "end_time": "2026-02-04T14:35:10.113762Z", - "start_time": "2026-02-04T14:35:09.910687Z" - } - }, - "cell_type": "code", - "source": [ - "# with open(f\"gha_results{test}.pkl\", \"rb\") as f:\n", - "# results = pickle.load(f)" - ], - "id": "ad8aa9dcc8af4a05", - "outputs": [], - "execution_count": 8 + "execution_count": null }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, + "source": [ + "# with open(f\"gha_results{test}.pkl\", \"wb\") as f:\n", + "# pickle.dump(results, f)" + ], + "id": "74fbd4d33c288839" + }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": [ + "with open(f\"gha_results{test}_all.pkl\", \"rb\") as f:\n", + " results = pickle.load(f)" + ], + "id": "4c20a0579c0f7038" + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-06T14:29:13.359555Z", + "start_time": "2026-02-06T14:29:13.127178Z" + } + }, + "cell_type": "code", "source": [ "metrics_gha1 = ['dBeta [\"]', 'dLambda [\"]', 'dAlpha1 [\"]', 'time [s]']\n", "metrics_gha2 = ['dAlpha0 [\"]', 'dAlpha1 [\"]', 'dStrecke [m]', 'time [s]']\n", @@ -449,13 +452,18 @@ " listed_results[method][metrics_gha2[i]].append(metric)\n", " pass" ], - "id": "8fd6f220440f4494" + "id": "2086b5bcd8416e33", + "outputs": [], + "execution_count": 61 }, { - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-06T14:30:49.469820Z", + "start_time": "2026-02-06T14:30:49.058791Z" + } + }, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "def format_max(values, is_angle=False):\n", " arr = np.array(values, dtype=float)\n", @@ -483,6 +491,7 @@ " example_keys = [example_key for example_key in list(results.keys())]\n", " else:\n", " example_keys = [example_key for example_key, group_index in zip(results.keys(), table_indices) if group_index==group_value]\n", + " example_keys = example_keys[:14]\n", "\n", " algorithms = sorted({algorithm for example_key in example_keys for algorithm in results[example_key].keys() if algorithm.startswith(gha_prefix)})\n", "\n", @@ -523,28 +532,1842 @@ " return fig\n", "\n", "figs = []\n", - "if test == \"Panou\":\n", - " for table_index in sorted(set(table_indices)):\n", - " fig1 = build_max_table(\"GHA1\", f\"{test} - Gruppe {table_index} - GHA1\", table_index)\n", - " fig2 = build_max_table(\"GHA2\", f\"{test} - Gruppe {table_index} - GHA2\", table_index)\n", - " figs.append(fig1)\n", - " figs.append(fig2)\n", - "elif test == \"Karney\":\n", - " fig1 = build_max_table(\"GHA1\", f\"{test} - GHA1\")\n", - " fig2 = build_max_table(\"GHA2\", f\"{test} - GHA2\")\n", - " figs.append(fig1)\n", - " figs.append(fig2)\n", + "# if test == \"Panou\":\n", + "# for table_index in sorted(set(table_indices)):\n", + "# fig1 = build_max_table(\"GHA1\", f\"{test} - Gruppe {table_index} - GHA1\", table_index)\n", + "# fig2 = build_max_table(\"GHA2\", f\"{test} - Gruppe {table_index} - GHA2\", table_index)\n", + "# figs.append(fig1)\n", + "# figs.append(fig2)\n", + "# elif test == \"Karney\":\n", + "fig1 = build_max_table(\"GHA1\", f\"{test} - GHA1\")\n", + "fig2 = build_max_table(\"GHA2\", f\"{test} - GHA2\")\n", + "figs.append(fig1)\n", + "figs.append(fig2)\n", "\n", "for fig in figs:\n", " fig.show()" ], - "id": "f1fb73407f5b1c8a" + "id": "eeb5a204cc4bbf7d", + "outputs": [ + { + "data": { + "application/vnd.plotly.v1+json": { + "data": [ + { + "cells": { + "align": "center", + "values": [ + [], + [], + [], + [], + [], + [], + [] + ] + }, + "header": { + "align": "center", + "fill": { + "color": "lightgrey" + }, + "font": { + "size": 13 + }, + "values": [ + "Algorithmus", + "Parameter", + "NaN", + "dBeta [\"]", + "dLambda [\"]", + "dAlpha1 [\"]", + "time [s]" + ] + }, + "type": "table" + } + ], + "layout": { + "template": { + "data": { + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "contour" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scattermap": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermap" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0.0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1.0, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "margin": { + "l": 20, + "r": 20, + "t": 60, + "b": 20 + }, + "title": { + "text": "Random - GHA1" + }, + "width": 800, + "height": 280 + }, + "config": { + "plotlyServerURL": "https://plot.ly" + } + } + }, + "metadata": {}, + "output_type": "display_data", + "jetTransient": { + "display_id": null + } + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "data": [ + { + "cells": { + "align": "center", + "values": [ + [ + "ES", + "ES", + "ES", + "approx", + "approx", + "approx" + ], + [ + "1250", + "60", + "600", + "1250", + "600", + "6000" + ], + [ + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + "0.0284", + "0.0286", + "0.0285", + "0.0286", + "0.0286", + "0.0286" + ], + [ + "0.0279", + "0.0278", + "0.0278", + "0.0279", + "0.0279", + "0.0279" + ], + [ + "0.000192", + "0.0492", + "0.000769", + "0.000192", + "0.000769", + "2.81e-06" + ], + [ + "59.7", + "4.51", + "31", + "0.23", + "0.135", + "1.69" + ] + ] + }, + "header": { + "align": "center", + "fill": { + "color": "lightgrey" + }, + "font": { + "size": 13 + }, + "values": [ + "Algorithmus", + "Parameter", + "NaN", + "dAlpha0 [\"]", + "dAlpha1 [\"]", + "dStrecke [m]", + "time [s]" + ] + }, + "type": "table" + } + ], + "layout": { + "template": { + "data": { + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "contour" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scattermap": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermap" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatter": [ + { + "fillpattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + }, + "type": "scatter" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0.0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1.0, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0.0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1.0, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "margin": { + "l": 20, + "r": 20, + "t": 60, + "b": 20 + }, + "title": { + "text": "Random - GHA2" + }, + "width": 800, + "height": 280 + }, + "config": { + "plotlyServerURL": "https://plot.ly" + } + } + }, + "metadata": {}, + "output_type": "display_data", + "jetTransient": { + "display_id": null + } + } + ], + "execution_count": 64 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-02-04T18:08:09.603687Z", - "start_time": "2026-02-04T18:08:09.269698Z" + "end_time": "2026-02-06T14:37:24.303781Z", + "start_time": "2026-02-06T14:37:24.022319Z" } }, "cell_type": "code", @@ -583,7 +2406,7 @@ "def nan_count_for_algorithm(results, example_keys, algorithm):\n", " vals = []\n", " for k in example_keys:\n", - " vals.extend(results[k][algorithm])\n", + " vals.append(results[k][algorithm][0])\n", " return int(np.sum(np.isnan(np.array(vals, dtype=float))))\n", "\n", "\n", @@ -765,19 +2588,21 @@ "\n", "\n", "# --- Beispielaufruf ---\n", - "example_keys = list(key for i, key in enumerate(results.keys()) if table_indices[i] == 3) # oder gefiltert auf Panou Gruppe etc.\n", + "example_keys = list(key for i, key in enumerate(results.keys()))\n", + "example_keys = example_keys[:14]\n", + "# example_keys = list(key for i, key in enumerate(results.keys()) if table_indices[i] == 3) # gefiltert auf Panou Gruppe etc.\n", "latex = build_latex_table_from_results(\n", " results,\n", - " gha_prefix=\"GHA1\",\n", + " gha_prefix=\"GHA2\",\n", " example_keys=example_keys,\n", - " caption=r\"Ergebnisse der Lösungsmethoden der 1. \\gls{GHA} auf einem erdähnlichen Ellipsoid (Gruppe 3)\",\n", + " caption=r\"Ergebnisse der Lösungsmethoden der 2. GHA auf einem erdähnlichen Ellipsoid (Gruppe 3)\",\n", " label=\"tab:results_gha1_g1\",\n", - " include_nan_col=False, # True, wenn du NaN-Spalte willst\n", + " include_nan_col=True, # True, wenn du NaN-Spalte willst\n", " wu=wu # wichtig, falls Winkelwerte rad sind\n", ")\n", "print(latex)" ], - "id": "98de5e2a4f419483", + "id": "12591c3b707da905", "outputs": [ { "name": "stdout", @@ -785,33 +2610,26 @@ "text": [ "\\begin{table}[H]\n", "\\centering\n", - "\\caption{Ergebnisse der Lösungsmethoden der 1. \\gls{GHA} auf einem erdähnlichen Ellipsoid}\n", - "\\label{tab:results_algorithms}\n", + "\\caption{Ergebnisse der Lösungsmethoden der 2. \\gls{GHA} auf einem erdähnlichen Ellipsoid (Gruppe 3)}\n", + "\\label{tab:results_gha1_g1}\n", "\n", - "\\begin{tabular}{|c|c|c|c|c|c|}\n", + "\\begin{tabular}{|c|c|c|c|c|c|c|}\n", "\\hline\n", - "Methode & Parameterwerte & $\\max(|\\Delta \\alpha_0|)$ [$''$] & $\\max(|\\Delta \\alpha_1|)$ [$''$] & $\\max(|\\Delta s|)$ [m] & time [s] \\\\\n", + "Methode & Parameterwerte & NaN & $\\max(|\\Delta \\alpha_0|)$ [$''$] & $\\max(|\\Delta \\alpha_1|)$ [$''$] & $\\max(|\\Delta s|)$ [m] & time [s] \\\\\n", "\\Xhline{1.5pt}\n", - "numerisch & 2000 & nan & nan & nan & nan \\\\\\hline\n", - "approximiert & 600 & $9.95\\cdot10^{3}$ & $2.77\\cdot10^{3}$ & $0.000888$ & $0.108$ \\\\\\hline\n", - "ES & 20 & $1.07\\cdot10^{4}$ & $4.35\\cdot10^{3}$ & $0.000886$ & $1.47$ \\\\\\hline\n", + "\\multirow{3}{*}{approximiert} & 600 & 0 & $0.0286$ & $0.0279$ & $0.000769$ & $0.135$ \\\\\n", + " & 1250 & 0 & $0.0286$ & $0.0279$ & $0.000192$ & $0.23$ \\\\\n", + " & 6000 & 0 & $0.0286$ & $0.0279$ & $2.81\\cdot10^{-6}$ & $1.69$ \\\\\\hline\n", + "\\multirow{3}{*}{ES} & 60 & 0 & $0.0286$ & $0.0278$ & $0.0492$ & $4.51$ \\\\\n", + " & 600 & 0 & $0.0285$ & $0.0278$ & $0.000769$ & $31$ \\\\\n", + " & 1250 & 0 & $0.0284$ & $0.0279$ & $0.000192$ & $59.7$ \\\\\\hline\n", "\\end{tabular}\n", "\n", "\\end{table}\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\moell\\AppData\\Local\\Temp\\ipykernel_25588\\1918125892.py:53: RuntimeWarning:\n", - "\n", - "All-NaN slice encountered\n", - "\n" - ] } ], - "execution_count": 15 + "execution_count": 65 }, { "metadata": {}, @@ -819,7 +2637,7 @@ "outputs": [], "execution_count": null, "source": "", - "id": "a431f99070cdee3c" + "id": "44f20396e6c5493c" } ], "metadata": {