This commit is contained in:
2025-11-15 21:40:43 +01:00
parent 03602bd816
commit f1b9eb01c9
9 changed files with 791 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ def main():
i += 2
ranges[f"beta{i:02}"] = np.linspace(-np.abs(b) * 10, np.abs(b) * 10, 3000)
wl0 = 1550e-9
wl0 = 835e-9
dt = 1.6e-15
t_num = 4096
t = sc.math.tspace(t_num=t_num, dt=dt)
@@ -34,7 +34,7 @@ def main():
w = w_c + sc.units.m_rads(wl0)
wl = sc.units.m_rads(w)
wl, ind, _ = sc.PlotRange(500, 3500, "nm").sort_axis(wl)
wl, ind, _ = sc.PlotRange(wl0 * 0.5e9, wl0 * 3e9, "nm").sort_axis(wl)
disp0 = get_disp(w_c, wl, ind, beta2_coefficients)
with PlotApp(**ranges) as app:
@@ -48,6 +48,10 @@ def main():
values = [app.params[k].value for k in keys]
print("[\n" + ",\n".join(format(v, "g") for v in values) + "\n]")
def set_zero():
for i, r in enumerate(app.params.values()):
r.value = 0.0
print_beta()
app[0].set_line_data("original", wl, disp0)
@@ -59,10 +63,14 @@ def main():
app.params_layout.addWidget(reset_btn, *divmod(len(app.params), 2))
reset()
print_btn = QtWidgets.QPushButton("Reset")
print_btn = QtWidgets.QPushButton("Print")
print_btn.clicked.connect(print_beta)
app.params_layout.addWidget(print_btn, *divmod(len(app.params) + 1, 2))
zero_btn = QtWidgets.QPushButton("Zero")
zero_btn.clicked.connect(set_zero)
app.params_layout.addWidget(zero_btn, *divmod(len(app.params) + 2, 2))
@app.update
def draw(
beta02,