Skip to content

Commit ba619dc

Browse files
TEST initial_time
1 parent eaa7522 commit ba619dc

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

surfer/tests/test_viz.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,26 @@ def test_meg_inverse():
191191
stc = io.read_stc(stc_fname)
192192
data = stc['data']
193193
vertices = stc['vertices']
194-
time = 1e3 * np.linspace(stc['tmin'],
195-
stc['tmin'] + data.shape[1] * stc['tstep'],
196-
data.shape[1])
194+
time = np.linspace(stc['tmin'], stc['tmin'] + data.shape[1] * stc['tstep'],
195+
data.shape[1])
197196
colormap = 'hot'
198-
time_label = 'time=%0.2f ms'
197+
198+
def time_label(t):
199+
return 'time=%0.2f ms' % (1e3 * t)
200+
199201
brain.add_data(data, colormap=colormap, vertices=vertices,
200202
smoothing_steps=10, time=time, time_label=time_label)
201-
brain.set_data_time_index(2)
202203
brain.scale_data_colormap(fmin=13, fmid=18, fmax=22, transparent=True)
204+
assert_equal(brain.data_dict['lh']['time_idx'], 0)
205+
206+
brain.set_time(.1)
207+
assert_equal(brain.data_dict['lh']['time_idx'], 2)
203208
# viewer = TimeViewer(brain)
209+
210+
brain.add_data(data, colormap=colormap, vertices=vertices,
211+
smoothing_steps=10, time=time, time_label=time_label,
212+
initial_time=.09, remove_existing=True)
213+
assert_equal(brain.data_dict['lh']['time_idx'], 1)
204214
brain.close()
205215

206216

0 commit comments

Comments
 (0)