diff --git a/dashboard.py b/dashboard.py index 5c23018..5314d5b 100644 --- a/dashboard.py +++ b/dashboard.py @@ -537,11 +537,12 @@ def toggle_ds(v): Input("button-calc-gha1", "n_clicks"), State("cb-ana-1", "value"), State("cb-num-1", "value"), + State("cb-stoch-1", "value"), State("cb-approx-1", "value"), prevent_initial_call=True, ) -def gha1_method_hint(n, a, nu, ap): - any_on = any("on" in (v or []) for v in (a, nu, ap)) +def gha1_method_hint(n, a, nu, st, ap): + any_on = any("on" in (v or []) for v in (a, nu, st, ap)) return "" if any_on else html.Span("Bitte Berechnungsverfahren wählen.", style={"color": "red"}) # -- GHA 1 --- @@ -670,16 +671,15 @@ def compute_gha1_num(n1, cb_num, n_in, beta0, lamb0, s, a0, ax, ay, b): State("input-ax", "value"), State("input-ay", "value"), State("input-b", "value"), - State("method-checklist-1", "value"), prevent_initial_call=True, ) -def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b, method1): +def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b): if not n1: return no_update, no_update if "on" not in (cb_stoch or []): return "", None - n_in = int(n_in) if n_in else 100 + n_in = int(n_in) if n_in else 1000 ell = EllipsoidTriaxial(ax, ay, b) beta_rad = wu.deg2rad(float(beta0)) @@ -687,17 +687,10 @@ def compute_gha1_stoch(n1, cb_stoch, n_in, beta0, lamb0, s, a0, ax, ay, b, metho alpha_rad = wu.deg2rad(float(a0)) s_val = float(s) - betas, lambs, alphas, S_real = gha1_ES( - beta_rad, lamb_rad, alpha_rad, - s_val, - 10000, - ell - ) - beta1_stoch = betas[-1] - lamb1_stoch = lambs[-1] + P1_stoch, alpha = gha1_ES(ell, beta0=beta_rad, omega0=lamb_rad, alpha0=alpha_rad, s_total=s_val, maxSegLen=n_in) P0 = ell.ell2cart(beta_rad, lamb_rad) - P1_stoch = ell.ell2cart(beta1_stoch, lamb1_stoch) + beta1_stoch, lamb1_stoch = ell.cart2ell(P1_stoch) out = html.Div([ html.Strong("Stochastisch: "),