Example #1
0
def simple_test_nfft_1d():
    """
    Reproduce and check the 1d case from examples/nfft/simple_test.c.
    """
    N=14
    M=19
    for data_file in ('simple_test_nfft_1d_32.txt',
                      'simple_test_nfft_1d_64.txt'):
        # init a one dimensional plan
        pw = NfftPlanWrapper.nfft_init_1d(N, M)
        assert_equal(pw.M_total, M)
        assert_equal(pw.N_total, N)
        assert_equal(pw.d, 1)
        read_and_check(pw, data_file)
Example #2
0
def simple_test_nfft_1d():
    """
    Reproduce and check the 1d case from examples/nfft/simple_test.c.
    """
    N = 14
    M = 19
    for data_file in ('simple_test_nfft_1d_32.txt',
                      'simple_test_nfft_1d_64.txt'):
        # init a one dimensional plan
        pw = NfftPlanWrapper.nfft_init_1d(N, M)
        assert_equal(pw.M_total, M)
        assert_equal(pw.N_total, N)
        assert_equal(pw.d, 1)
        read_and_check(pw, data_file)
Example #3
0
def simple_test_nfft_2d():
    """
    Reproduce and check the 2d case from examples/nfft/simple_test.c.
    """
    N = np.array([32, 14], dtype=dtype_int)
    n = np.array([64, 32], dtype=dtype_int)
    M=N.prod()
    for data_file in ('simple_test_nfft_2d_32.txt',
                      'simple_test_nfft_2d_64.txt'):

        # init a two dimensional plan
        pw = NfftPlanWrapper.nfft_init_guru(2, N, M, n, 7,
                PRE_PHI_HUT| PRE_FULL_PSI| MALLOC_F_HAT| MALLOC_X| MALLOC_F |
                FFTW_INIT| FFT_OUT_OF_PLACE,
                FFTW_ESTIMATE| FFTW_DESTROY_INPUT)

        assert_equal(pw.M_total, M)
        assert_equal(pw.N_total, M)  # ???? True in this case, but why ????
        assert_equal(pw.d, 2)
        read_and_check(pw, data_file)
Example #4
0
def simple_test_nfft_2d():
    """
    Reproduce and check the 2d case from examples/nfft/simple_test.c.
    """
    N = np.array([32, 14], dtype=dtype_int)
    n = np.array([64, 32], dtype=dtype_int)
    M = N.prod()
    for data_file in ('simple_test_nfft_2d_32.txt',
                      'simple_test_nfft_2d_64.txt'):

        # init a two dimensional plan
        pw = NfftPlanWrapper.nfft_init_guru(
            2, N, M, n, 7, PRE_PHI_HUT | PRE_FULL_PSI | MALLOC_F_HAT | MALLOC_X
            | MALLOC_F | FFTW_INIT | FFT_OUT_OF_PLACE,
            FFTW_ESTIMATE | FFTW_DESTROY_INPUT)

        assert_equal(pw.M_total, M)
        assert_equal(pw.N_total, M)  # ???? True in this case, but why ????
        assert_equal(pw.d, 2)
        read_and_check(pw, data_file)