Ejemplo n.º 1
0
def test_recon():
    a, diff_v = make_synthetic_data()
    total_n = 10
    sup_radius = 20

    # inital phase and support
    init_phase = generate_random_phase_field(diff_v)
    sup = generate_box_support(sup_radius, diff_v.shape)
    # run reconstruction
    outv1, error_dict = cdi_recon(diff_v, init_phase, sup, sw_flag=False,
                                  n_iterations=total_n, sw_step=2)
    outv1 = np.abs(outv1)

    outv2, error_dict = cdi_recon(diff_v, init_phase, sup, pi_modulus_flag='Real',
                                  sw_flag=True, n_iterations=total_n, sw_step=2)
    outv2 = np.abs(outv2)
    # compare the area of supports
    assert_array_equal(outv1.shape, outv2.shape)
Ejemplo n.º 2
0
def test_cdi_plotter():
    a, diff_v = make_synthetic_data()
    total_n = 10
    sup_radius = 20

    # inital phase and support
    init_phase = generate_random_phase_field(diff_v)
    sup = generate_box_support(sup_radius, diff_v.shape)

    # assign wrong plot_function
    outv, error_d = cdi_recon(diff_v, init_phase, sup, sw_flag=True,
                              n_iterations=total_n, sw_step=2, cb_function=10)