Koordinatenart für den Plot wählbar
This commit is contained in:
34
dashboard.py
34
dashboard.py
@@ -13,7 +13,7 @@ from GHA_triaxial.approx_gha1 import gha1_approx
|
|||||||
|
|
||||||
from GHA_triaxial.panou_2013_2GHA_num import gha2_num
|
from GHA_triaxial.panou_2013_2GHA_num import gha2_num
|
||||||
from GHA_triaxial.ES_gha2 import gha2_ES
|
from GHA_triaxial.ES_gha2 import gha2_ES
|
||||||
from GHA_triaxial.approx_gha2 import gha2
|
from GHA_triaxial.approx_gha2 import gha2_approx
|
||||||
|
|
||||||
|
|
||||||
app = Dash(__name__, suppress_callback_exceptions=True)
|
app = Dash(__name__, suppress_callback_exceptions=True)
|
||||||
@@ -194,7 +194,9 @@ app.layout = html.Div(
|
|||||||
{"label": "Bursa1972", "value": "Bursa1972"},
|
{"label": "Bursa1972", "value": "Bursa1972"},
|
||||||
{"label": "Bursa1970", "value": "Bursa1970"},
|
{"label": "Bursa1970", "value": "Bursa1970"},
|
||||||
{"label": "BesselBiaxial", "value": "BesselBiaxial"},
|
{"label": "BesselBiaxial", "value": "BesselBiaxial"},
|
||||||
|
{"label": "KarneyTest2024", "value": "KarneyTest2024"},
|
||||||
{"label": "Fiction", "value": "Fiction"},
|
{"label": "Fiction", "value": "Fiction"},
|
||||||
|
|
||||||
],
|
],
|
||||||
value="",
|
value="",
|
||||||
style={"width": "300px", "marginBottom": "16px"},
|
style={"width": "300px", "marginBottom": "16px"},
|
||||||
@@ -241,12 +243,25 @@ app.layout = html.Div(
|
|||||||
"minWidth": "520px",
|
"minWidth": "520px",
|
||||||
"position": "sticky",
|
"position": "sticky",
|
||||||
"top": "0",
|
"top": "0",
|
||||||
"marginTop": "-150px",
|
"marginTop": "-50px",
|
||||||
},
|
},
|
||||||
children=[
|
children=[
|
||||||
|
html.Label("Koordinatenart wählen:"),
|
||||||
|
dcc.Dropdown(
|
||||||
|
id="dropdown-coors-type",
|
||||||
|
options=[
|
||||||
|
{"label": "Ellipsoidisch", "value": "ell"},
|
||||||
|
{"label": "Parametrisch", "value": "para"},
|
||||||
|
{"label": "Geodätisch", "value": "geod"},
|
||||||
|
|
||||||
|
],
|
||||||
|
value="ell",
|
||||||
|
clearable=False,
|
||||||
|
style={"width": "300px"},
|
||||||
|
),
|
||||||
dcc.Graph(
|
dcc.Graph(
|
||||||
id="ellipsoid-plot",
|
id="ellipsoid-plot",
|
||||||
style={"height": "90vh", "width": "100%"},
|
style={"height": "85vh", "width": "100%"},
|
||||||
config={"responsive": True}
|
config={"responsive": True}
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -297,7 +312,7 @@ def render_content(tab):
|
|||||||
options=[
|
options=[
|
||||||
{"label": "Analytisch", "value": "analytisch"},
|
{"label": "Analytisch", "value": "analytisch"},
|
||||||
{"label": "Numerisch", "value": "numerisch"},
|
{"label": "Numerisch", "value": "numerisch"},
|
||||||
{"label": "Stochastisch (ES)", "value": "stochastisch"},
|
#{"label": "Stochastisch (ES)", "value": "stochastisch"},
|
||||||
{"label": "Approximiert", "value": "approx"},
|
{"label": "Approximiert", "value": "approx"},
|
||||||
],
|
],
|
||||||
value=[],
|
value=[],
|
||||||
@@ -602,7 +617,7 @@ def compute_gha2_num(n2, beta0, lamb0, beta1, lamb1, ax, ay, b, method2):
|
|||||||
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
||||||
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
||||||
|
|
||||||
a0_num, a1_num, s_num, beta_arr, lamb_arr = gha2_num(ell, beta0_rad, lamb0_rad, beta1_rad, lamb1_rad, all_points=True)
|
a0_num, a1_num, s_num, beta_arr, lamb_arr = gha2_num(ell, beta0_rad, lamb0_rad, beta1_rad, lamb1_rad, all_points=True, n=3000)
|
||||||
|
|
||||||
polyline = []
|
polyline = []
|
||||||
for b_rad, l_rad in zip(beta_arr, lamb_arr):
|
for b_rad, l_rad in zip(beta_arr, lamb_arr):
|
||||||
@@ -652,7 +667,7 @@ def compute_gha2_stoch(n2, beta0, lamb0, beta1, lamb1, ax, ay, b, method2):
|
|||||||
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
||||||
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
||||||
|
|
||||||
a0_stoch, a1_stoch, s_stoch, points = gha2_ES(ell, P0, P1, all_points=True, sigmaStep=1e-5)
|
a0_stoch, a1_stoch, s_stoch, points = gha2_ES(ell, P0, P1, all_points=True)
|
||||||
|
|
||||||
out = html.Div([
|
out = html.Div([
|
||||||
html.Strong("Stochastisch (ES): "),
|
html.Strong("Stochastisch (ES): "),
|
||||||
@@ -691,7 +706,7 @@ def compute_gha2_approx(n2, beta0, lamb0, beta1, lamb1, ax, ay, b, method2):
|
|||||||
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
P0 = ell.ell2cart(beta0_rad, lamb0_rad)
|
||||||
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
P1 = ell.ell2cart(beta1_rad, lamb1_rad)
|
||||||
|
|
||||||
a0_app, a1_app, s_app, points = gha2(ell, P0, P1, ds=1e-4, all_points=True)
|
a0_app, a1_app, s_app, points = gha2_approx(ell, P0, P1, ds=1e-4, all_points=True)
|
||||||
|
|
||||||
out = html.Div([
|
out = html.Div([
|
||||||
html.Strong("Approximiert: "),
|
html.Strong("Approximiert: "),
|
||||||
@@ -706,6 +721,7 @@ def compute_gha2_approx(n2, beta0, lamb0, beta1, lamb1, ax, ay, b, method2):
|
|||||||
Input("input-ax", "value"),
|
Input("input-ax", "value"),
|
||||||
Input("input-ay", "value"),
|
Input("input-ay", "value"),
|
||||||
Input("input-b", "value"),
|
Input("input-b", "value"),
|
||||||
|
Input("dropdown-coors-type", "value"),
|
||||||
Input("store-gha1-ana", "data"),
|
Input("store-gha1-ana", "data"),
|
||||||
Input("store-gha1-num", "data"),
|
Input("store-gha1-num", "data"),
|
||||||
Input("store-gha1-stoch", "data"),
|
Input("store-gha1-stoch", "data"),
|
||||||
@@ -714,13 +730,13 @@ def compute_gha2_approx(n2, beta0, lamb0, beta1, lamb1, ax, ay, b, method2):
|
|||||||
Input("store-gha2-stoch", "data"),
|
Input("store-gha2-stoch", "data"),
|
||||||
Input("store-gha2-approx", "data"),
|
Input("store-gha2-approx", "data"),
|
||||||
)
|
)
|
||||||
def render_all(ax, ay, b, store_gha1_ana, store_gha1_num, store_gha1_stoch, store_gha1_approx, store_gha2_num, store_gha2_stoch, store_gha2_approx):
|
def render_all(ax, ay, b, coords_type, store_gha1_ana, store_gha1_num, store_gha1_stoch, store_gha1_approx, store_gha2_num, store_gha2_stoch, store_gha2_approx):
|
||||||
if None in (ax, ay, b):
|
if None in (ax, ay, b):
|
||||||
return go.Figure()
|
return go.Figure()
|
||||||
|
|
||||||
ell = EllipsoidTriaxial(ax, ay, b)
|
ell = EllipsoidTriaxial(ax, ay, b)
|
||||||
fig = ellipsoid_figure(ell, title="")
|
fig = ellipsoid_figure(ell, title="")
|
||||||
fig = figure_constant_lines(fig, ell, "ell")
|
fig = figure_constant_lines(fig, ell, coords_type)
|
||||||
|
|
||||||
def add_from_store(fig, store):
|
def add_from_store(fig, store):
|
||||||
if not store:
|
if not store:
|
||||||
|
|||||||
Reference in New Issue
Block a user