Skip to content

Commit 8ff3df5

Browse files
committed
Test OptogenSIM packaged data is peak-normalized to 1
1 parent 5bdc7b4 commit 8ff3df5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎tests/light/test_light.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ def test_OptogenSIM_warns_and_zeros_outside_range():
163163
assert np.all(T == 0)
164164

165165

166+
def test_OptogenSIM_data_peak_normalized():
167+
# the packaged Monte Carlo dataset is peak-normalized: transmittance
168+
# spans [0, 1] with peak exactly 1 (the explorer relies on this)
169+
from brian2 import um, nmeter
170+
171+
model = OptogenSIM(wavelength=473 * nmeter, beam_radius=100 * um)
172+
assert np.isclose(float(model.data.max()), 1.0)
173+
assert float(model.data.min()) >= 0
174+
175+
166176
@pytest.mark.parametrize(
167177
"model_fn, target, widths",
168178
[

0 commit comments

Comments
 (0)