예제 #1
0
def test_as_trials(signal):
    signal.epochs = signal.trial_epochs_from_occurrences(occurrences=10)
    result = signal.extract_epoch('trial')
    assert result.shape == (10, 3, 20)

    with pytest.raises(ValueError):
        signal.epochs = signal.trial_epochs_from_occurrences(occurrences=11)
예제 #2
0
def test_rasterized_signal_subset(signal):
    subset = signal.select_times([(0, 0.2), (0.3, 2)])
    assert subset.as_continuous().shape == (3, 95)
    epoch_subset = subset.extract_epoch('pupil_closed')
    assert epoch_subset.shape == (1, 3, 45)
    assert np.all(epoch_subset[0] == signal.extract_epoch('pupil_closed')[0])
    with pytest.raises(IndexError):
        epoch_subset = subset.extract_epoch('trial')
    assert subset.average_epoch('pupil_closed').shape == (3, 45)
예제 #3
0
def test_extract_epoch(signal):
    result = signal.extract_epoch('pupil_closed')
    assert result.shape == (2, 3, 45)