'Test that the different modes are producing the correct results using
a 3x3 uniform kernel. This version includes a NaN value in the
original array.'

@pytest.mark.parametrize(u'boundary', BOUNDARY_OPTIONS)
def test_uniform_3x3x3_withnan_interped(self, boundary):

    x = np.array([[[1.0, 2.0, 1.0], [2.0, 3.0, 1.0], [3.0, 2.0, 5.0]], [[4.0, 3.0, 1.0], [5.0, np.nan, 2.0], [6.0, 1.0, 1.0]], [[7.0, 0.0, 2.0], [8.0, 2.0, 3.0], [9.0, 2.0, 2.0]]], dtype=u'>f8')
    y = np.ones((3, 3, 3), dtype=u'>f8')
    z = convolve(x, y, boundary=boundary, nan_treatment=u'interpolate', normalize_kernel=True)
    kernsum = (y.sum() - 1)
    mid = (x[np.isfinite(x)].sum() / kernsum)
    if (boundary is None):
        assert_array_almost_equal_nulp(z, (np.array([[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0], [0.0, 78.0, 0.0], [0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]], dtype=u'>f8') / kernsum), 10)
    elif (boundary == u'fill'):
        assert_array_almost_equal_nulp(z, (np.array([[[20.0, 25.0, 13.0], [32.0, 43.0, 22.0], [22.0, 31.0, 15.0]], [[37.0, 47.0, 20.0], [60.0, 78.0, 33.0], [43.0, 57.0, 24.0]], [[29.0, 37.0, 13.0], [47.0, 58.0, 19.0], [33.0, 41.0, 13.0]]], dtype=u'>f8') / kernsum), 10)
    elif (boundary == u'wrap'):
        assert_array_almost_equal_nulp(z, np.tile(mid.astype(u'>f8'), [3, 3, 3]), 10)
    elif (boundary == u'extend'):
        assert_array_almost_equal_nulp(z, (np.array([[[62.0, 51.0, 40.0], [72.0, 63.0, 54.0], [82.0, 75.0, 68.0]], [[93.0, 68.0, 43.0], [105.0, 78.0, 51.0], [117.0, 88.0, 59.0]], [[124.0, 85.0, 46.0], [138.0, 93.0, 48.0], [152.0, 101.0, 50.0]]], dtype=u'>f8') / kernsum), 10)
    else:
        raise ValueError(u'Invalid    Boundary    Option')
