iblutil.tests.test_spacers

Classes

TestSpacer

TestSpacersFromFronts

Tests for Spacer.find_spacers_from_fronts

class TestSpacer(methodName='runTest')[source]

Bases: TestCase

test_spacer()[source]
test_find_spacers()[source]

Generates a fake signal with 2 spacers and finds them

class TestSpacersFromFronts(methodName='runTest')[source]

Bases: TestCase

Tests for Spacer.find_spacers_from_fronts

setUp() None[source]

Hook method for setting up the test fixture before exercising it.

test_extract_spacers()[source]

Test Spacer.find_spacers_from_fronts with usual spacer

test_empty()[source]

Test behaviour when a signal is passed in that doesn’t contain any spacers.

test_noise()[source]

Test whether it can deal with noise in the spacer signal.

NB: Currently any noise will result in no spacer detection.

test_custom_spacer_extract()[source]

Test is different spacer parameters

static to_fronts(signal)[source]

Detects Rising and Falling edges of a voltage signal, returns indices and polarities.

Parameters:

signal (numpy.array) – Array on which to compute RMS

Returns:

  • numpy.array – Array of indices

  • numpy.array – Array of polarities {1, -1}