Esempio n. 1
0
                           pos_type='pixel',
                           exptime=100,
                           rm_bkglight=False,
                           if_plot=False,
                           zp=25)

data_process.PSF_list = [psf_class.kernel_pixel]

data_process.generate_target_materials(radius=25,
                                       create_mask=False,
                                       nsigma=2.8,
                                       exp_sz=1,
                                       npixels=10,
                                       if_plot=True,
                                       bkg_std=background_rms)
data_process.deltaPix = 1
data_process.checkout()  #Check if all the materials is known.
fit_sepc = FittingSpecify(data_process)
fit_sepc.prepare_fitting_seq(
    point_source_num=0, sersic_major_axis=False
)  #, fix_n_list= [[0,4]], fix_center_list = [[0,0]])
fit_sepc.plot_fitting_sets()
fit_sepc.build_fitting_seq()
#Setting the fitting method and run.
fit_run = FittingProcess(fit_sepc)
fit_run.run(algorithm_list=['PSO', 'PSO'],
            setting_list=[{
                'sigma_scale': 1.,
                'n_particles': 50,
                'n_iterations': 50
            }] * 2)
Esempio n. 2
0
    from galight.data_process import DataProcess
    from galight.fitting_specify import FittingSpecify
    from galight.fitting_process import FittingProcess

    save_name = 'sim_result_bulge_n{1}_/round0_ID{0}_'.format(j, bulge_n)
    data_process_0 = DataProcess(
        fov_image=sim_image_noise,
        fov_noise_map=rms,
        target_pos=[len(sim_image_noise) / 2,
                    len(sim_image_noise) / 2],
        pos_type='pixel',
        header=None,
        rm_bkglight=False,
        if_plot=False,
        zp=zp)
    data_process_0.deltaPix = deltaPix
    data_process_0.generate_target_materials(radius=None,
                                             create_mask=False,
                                             nsigma=2.8,
                                             exp_sz=1.2,
                                             npixels=15,
                                             if_plot=False)

    data_process_0.PSF_list = [psf_data]
    data_process_0.checkout()  #Check if all the materials is known.
    #%%Start to produce the class and params for lens fitting.
    # #Manually input another component:
    # apertures_0 = copy.deepcopy(data_process_0.apertures)
    # add_aperture1 = copy.deepcopy(apertures_0[0])
    # add_pos = [60, 60]   #The position of the component.
    # if isinstance(add_aperture1.positions[0],float):