Skip to content

Commit 77cd1d2

Browse files
Adjusting test sim params #258
1 parent c5cc439 commit 77cd1d2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_sim.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def test_run_simulation_runs():
99
"""Test that run_simulation can run and outputs something of the correct type."""
1010

11-
transducer = openlifu.Transducer.gen_matrix_array(nx=2, ny=2, pitch=4, kerf=.5, units="mm", impulse_response=1e5)
11+
transducer = openlifu.Transducer.gen_matrix_array(nx=2, ny=2, pitch=2, kerf=.5, units="mm", impulse_response=1e5)
1212
dt = 2e-7
1313
sim_setup = openlifu.SimSetup(
1414
dt=dt,
@@ -17,7 +17,7 @@ def test_run_simulation_runs():
1717
y_extent=(-10,10),
1818
z_extent=(-2,10),
1919
)
20-
pulse = openlifu.Pulse(frequency=400e3, duration=3/400e3)
20+
pulse = openlifu.Pulse(frequency=400e3, duration=1/400e3)
2121
protocol = openlifu.Protocol(
2222
pulse=pulse,
2323
sequence=openlifu.Sequence(),
@@ -26,15 +26,18 @@ def test_run_simulation_runs():
2626
coords = sim_setup.get_coords()
2727
default_seg_method = openlifu.seg.seg_methods.seg_method.SegmentationMethod()
2828
params = default_seg_method.ref_params(coords)
29-
delays, apod = protocol.beamform(arr=transducer, target=openlifu.Point(position=(0,0,5)), params=params)
29+
delays, apod = protocol.beamform(arr=transducer, target=openlifu.Point(position=(0,0,50)), params=params)
30+
delays[:] = 0.0
31+
apod[:] = 1.0
32+
3033

3134
dataset, _ = openlifu.sim.run_simulation(
3235
arr=transducer,
3336
params=params,
3437
delays=delays,
3538
apod= apod,
3639
freq = pulse.frequency,
37-
cycles = 5,
40+
cycles = 1,
3841
dt=protocol.sim_setup.dt,
3942
t_end=protocol.sim_setup.t_end,
4043
amplitude = 1,

0 commit comments

Comments
 (0)