예제 #1
0
        RA = 315.2279713
        Dec = -17.25608967

    fov_image = fitsFile[1].data # check the back grounp
    data_process = DataProcess(fov_image = fov_image, target_pos = [RA, Dec], pos_type = 'wcs', header = header,
                          rm_bkglight = True, exptime = exp_map, if_plot=False, zp = 25.9463)  #!!! zp use F160W for now
    data_process.generate_target_materials(radius=20, cut_kernel = 'center_bright', create_mask = False, 
                                           # detect_tool = 'sep', if_select_obj= True, nsigma=2.5, thresh = 2.5, exp_sz= 1.2, npixels = 15, 
                                           if_plot=False)
    
    #Lines used to find PSF and set the PSF_loc_dic.
    data_process.find_PSF(radius = 30, user_option = True, if_filter=True, psf_edge =30)
    # data_process.profiles_compare(norm_pix = 5, if_annuli=False, y_log = False,
    #               prf_name_list = (['target'] + ['PSF{0}'.format(i) for i in range(len(data_process.PSF_list))]) )
    # PSF_loc = PSF_loc_dic[str(i)]
    data_process.plot_overview(label = ID, target_label = None)
    # data_process.find_PSF(radius = 30, PSF_pos_list = [PSF_loc])
    data_process.checkout()
    #Start to produce the class and params for lens fitting.
    # data_process.apertures = []
    print(ID, i)
    fit_sepc = FittingSpecify(data_process)
    fit_sepc.prepare_fitting_seq(point_source_num = 1) #, fix_n_list= [[0,4],[1,1]])
    # psf_error_map = np.ones_like(data_process.PSF_list[data_process.psf_id_for_fitting]) *0.01 # It is in the variance unit (std^2).
    # fit_sepc.prepare_fitting_seq(point_source_num = 1, psf_error_map = psf_error_map)
    fit_sepc.build_fitting_seq()
    #Plot the initial settings for fittings. 
    fit_sepc.plot_fitting_sets()

    # fit_run = FittingProcess(fit_sepc, savename = 'pkl_files/'+ ID+'_'+str(i), fitting_level='deep')
    # fit_run.run(algorithm_list = ['PSO'], setting_list=[None])
예제 #2
0
                           target_pos=[1170., 940.],
                           pos_type='pixel',
                           header=header,
                           rm_bkglight=False,
                           exptime=np.ones_like(data) * exptime,
                           if_plot=False,
                           zp=zp)  #Gain value assuming as 1
data_process.generate_target_materials(radius=65,
                                       create_mask=False,
                                       nsigma=2.8,
                                       if_select_obj=False,
                                       exp_sz=1.2,
                                       npixels=15,
                                       if_plot=True)
data_process.find_PSF(radius=30, user_option=True)
data_process.plot_overview(label='Example', target_label=None)

#Start to produce the class and params for lens fitting.
from galight.fitting_specify import FittingSpecify

# data_process.apertures = []
fit_sepc = FittingSpecify(data_process)
fit_sepc.prepare_fitting_seq(point_source_num=1)  #, fix_n_list= [[0,4],[1,1]])
fit_sepc.build_fitting_seq()

#Plot the initial settings for fittings.
fit_sepc.plot_fitting_sets()

#Setting the fitting method and run.
from galight.fitting_process import FittingProcess
fit_run = FittingProcess(fit_sepc, savename='savename', fitting_level='norm')
예제 #3
0
                            pos_type='pixel',
                            header=header,
                            rm_bkglight=True,
                            exptime=np.ones_like(data_sb) * exptime,
                            if_plot=False,
                            zp=zp)  #Gain value assuming as 1
 data_process.generate_target_materials(radius=rad * 0.8,
                                        create_mask=False,
                                        nsigma=2.8,
                                        if_select_obj=False,
                                        exp_sz=1.2,
                                        npixels=15,
                                        if_plot=False)
 data_process.plot_overview(label=filt + '_' + str(fov_cut_idx) + '_FOV',
                            target_label=name[:7],
                            ifsave=True,
                            filename=filename + '_FOV',
                            if_plot=if_plot)
 # data_process.find_PSF(radius = 50, user_option = True, psf_edge=10)
 data_process.apertures = [data_process.apertures[0]]
 info = {}
 for psf, name in [[psf_true, 'same_psf'], [psf_model, 'diff_psf']]:
     # for psf, name in [[psf_model,'diff_psf']]:
     plot_fit_name = filename + name + '_fit'
     data_process.PSF_list = [psf]
     #Start to produce the class and params for lens fitting.
     fit_sepc = FittingSpecify(data_process)
     fit_sepc.prepare_fitting_seq(
         point_source_num=1)  #, fix_n_list= [[0,4],[1,1]])
     fit_sepc.build_fitting_seq()
     #Plot the initial settings for fittings.