change: grid and units improvements

This commit is contained in:
Benoît Sierro
2023-09-05 09:05:39 +02:00
parent a599f55cdb
commit ff7e78b1b5
7 changed files with 66 additions and 30 deletions

View File

@@ -20,3 +20,10 @@ def test_wl_dispersion():
wl = sc.units.m.inv(w + sc.units.nm(1546))
wl_disp, ind_disp = sc.fiber.lambda_for_envelope_dispersion(wl, (950e-9, 4000e-9))
assert all(np.diff(wl_disp) > 0)
def test_iwspace():
t = sc.tspace(dt=15.6, t_num=512)
assert sc.math.iwspace(sc.wspace(t)) == pytest.approx(t)
assert sc.math.iwspace(sc.wspace(t) + 4564568456.4) != pytest.approx(t)
assert sc.math.iwspace(sc.wspace(t) + 4564568456.4) == pytest.approx(t, rel=1e-3)