Beispiel #1
0
def test_read_sofa_position_type_spherical(generate_sofa_postype_spherical,
                                           sofa_reference_coordinates):
    """Test to verify correct position type of sofa file"""
    _, s_coords, r_coords = io.read_sofa(generate_sofa_postype_spherical)
    npt.assert_allclose(s_coords.get_sph(convention='top_elev', unit='deg'),
                        sofa_reference_coordinates[0])
    npt.assert_allclose(r_coords.get_sph(convention='top_elev', unit='deg'),
                        sofa_reference_coordinates[1])
Beispiel #2
0
def test_read_sofa_sampling_rate_unit(generate_sofa_unit_error):
    """Test to verify correct sampling rate unit of sofa file"""
    with pytest.raises(ValueError):
        io.read_sofa(generate_sofa_unit_error)
Beispiel #3
0
def test_read_sofa_coordinates(generate_sofa_GeneralFIR,
                               sofa_reference_coordinates):
    """Test for reading coordinates in sofa file"""
    _, s_coords, r_coords, = io.read_sofa(generate_sofa_GeneralFIR)
    npt.assert_allclose(s_coords.get_cart(), sofa_reference_coordinates[0])
    npt.assert_allclose(r_coords.get_cart(), sofa_reference_coordinates[1])
Beispiel #4
0
def test_read_sofa_GeneralTF(generate_sofa_GeneralTF):
    """Test for sofa datatype GeneralTF"""
    with pytest.raises(ValueError):
        io.read_sofa(generate_sofa_GeneralTF)
Beispiel #5
0
def test_read_sofa_GeneralFIR(generate_sofa_GeneralFIR,
                              noise_two_by_three_channel):
    """Test for sofa datatype GeneralFIR"""
    signal = io.read_sofa(generate_sofa_GeneralFIR)[0]
    npt.assert_allclose(signal.time, noise_two_by_three_channel.time)
Beispiel #6
0
def test_read_sofa_position_type_unit(generate_sofa_postype_error):
    """Test to verify correct position type of sofa file"""
    with pytest.raises(ValueError):
        io.read_sofa(generate_sofa_postype_error)