'probe_type': 'gaussian',
                    'probe_mag_sigma': 6,
                    'probe_phase_sigma': 6,
                    'probe_phase_max': 0.5,
                    'forward_algorithm': 'fresnel',
                    'object_type': 'phase_only',
                    'probe_pos': [(y, x) for y in (np.arange(66) * 5) - 36 for x in (np.arange(68) * 5) - 36],
                    'finite_support_mask': None,
                    'free_prop_cm': 'inf',
                    'optimizer': 'adam',
                    'two_d_mode': True,
                    'shared_file_object': False,
                    'use_checkpoint': False
                    }

params = params_2d_cell

# n_ls = ['nonoise', 'n1e9', 'n1e8', 'n1e7', 'n1e6', 'n1e5', 'n1e4']
n_ls = ['comp_n1e4', 'comp_n4e4', 'comp_n1e5', 'comp_n4e5', 'comp_n1e6', 'comp_n1.75e6', 'comp_n4e6', 'comp_n1e7', 'comp_n1.75e7', 'comp_n4e7', 'comp_n1e8', 'comp_n1.75e8', 'comp_n4e8']
# n_ls = ['nonoise', 'dss_comp_n1e4', 'dss_comp_n4e4', 'dss_comp_n1e5', 'dss_comp_n4e5', 'dss_comp_n1e6', 'dss_comp_n1.75e6', 'dss_comp_n4e6', 'dss_comp_n1e7', 'dss_comp_n1.75e7', 'dss_comp_n4e7', 'dss_comp_n1e8', 'dss_comp_n1.75e8', 'dss_comp_n4e8']
# n_ls = ['nonoise', 'mix_comp_n1e4', 'mix_comp_n4e4', 'mix_comp_n1e5', 'mix_comp_n4e5', 'mix_comp_n1e6', 'mix_comp_n1.75e6', 'mix_comp_n4e6', 'mix_comp_n1e7', 'mix_comp_n1.75e7', 'mix_comp_n4e7', 'mix_comp_n1e8', 'mix_comp_n1.75e8', 'mix_comp_n4e8']
n_ls = [x + '_ref' for x in n_ls]

for n_ph in n_ls:
    if 'nonoise' in n_ph:
        params['fname'] = 'data_cell_phase.h5'
    else:
        params['fname'] = 'data_cell_phase_{}.h5'.format(n_ph)
    params['output_folder'] = n_ph
    reconstruct_ptychography(**params)
示例#2
0
reconstruct_ptychography(fname=params['fname'],
                         probe_pos=params['probe_pos'],
                         probe_size=params['probe_size'],
                         theta_st=0,
                         theta_end=params['theta_end'],
                         theta_downsample=params['theta_downsample'],
                         obj_size=params['obj_size'],
                         n_epochs=params['n_epochs'],
                         crit_conv_rate=0.03,
                         max_nepochs=200,
                         alpha_d=params['alpha_d'],
                         alpha_b=params['alpha_b'],
                         gamma=params['gamma'],
                         learning_rate=params['learning_rate'],
                         output_folder=params['output_folder'],
                         minibatch_size=params['batch_size'],
                         save_intermediate=params['save_intermediate'],
                         full_intermediate=params['full_intermediate'],
                         energy_ev=params['energy_ev'],
                         psize_cm=params['psize_cm'],
                         cpu_only=params['cpu_only'],
                         save_path=params['save_folder'],
                         phantom_path=params['phantom_path'],
                         multiscale_level=params['multiscale_level'],
                         n_epoch_final_pass=params['n_epoch_final_pass'],
                         initial_guess=params['initial_guess'],
                         n_batch_per_update=params['n_batch_per_update'],
                         dynamic_rate=True,
                         probe_type=params['probe_type'],
                         probe_initial=None,
                         probe_learning_rate=1e-3,
                         pupil_function=None,
                         probe_circ_mask=None,
                         n_dp_batch=params['n_dp_batch'],
                         finite_support_mask=params['finite_support_mask'],
                         forward_algorithm=params['forward_algorithm'],
                         object_type=params['object_type'],
                         **params['probe_options'])