'center_y': obj[i][0][1] * pix_scale + 0.5 }) source_params_3 = [ kwargs_source_init, kwargs_source_sigma, fixed_source, kwargs_lower_source, kwargs_upper_source ] print("fitting the QSO as {0} small Sersic + Sersic".format( len(arr_x))) source_result_3, image_host_3, error_map_3, reduced_Chisq_3 = fit_galaxy( QSO_img, psf_ave=psf, psf_std=None, background_rms=background_rms_list[k], source_params=source_params_3, galaxy_msk=None, pix_sz=pix_scale, no_MCMC=True, galaxy_std=QSO_std, tag=tag, deep_seed='very_deep', pltshow=pltshow, return_Chisq=True) # host_mag = -2.5*np.log10(image_host_3[len(arr_x)+1].sum()) + zp_list[k] host_mag = -2.5 * np.log10( image_host_3[len(arr_x)].sum()) + zp_list[k] AGN_mags = [ -2.5 * np.log10(image_host_3[i].sum()) + zp_list[k] for i in range(len(arr_x)) ] if len(arr_x) == 2: c_miss = np.sqrt((source_result_3[0]['center_x'] -
galaxy_msk = None if fitting_strategy == 'boost_galaxy_center_rms': galaxy_std[galaxy_img == galaxy_img[img_c - 3:img_c + 4, img_c - 3:img_c + 4].max()] = 10**6 elif fitting_strategy == 'add_galaxy_center_mask': galaxy_msk = np.ones_like(galaxy_img) galaxy_msk[galaxy_img == galaxy_img[img_c - 3:img_c + 4, img_c - 3:img_c + 4].max()] = 0 tag = 'RESULTS/fit_image_{0}'.format(filename_list[k].split('.fits')[0]) source_result, image_host, error_map, reduced_Chisq = fit_galaxy( galaxy_img, psf_ave=psf, psf_std=None, background_rms=background_rms_list[k], source_params=source_params, galaxy_msk=galaxy_msk, pix_sz=pix_scale, no_MCMC=True, galaxy_std=galaxy_std, tag=tag, deep_seed=deep_seed, pltshow=pltshow, return_Chisq=True) if band_seq[k] == 'I': Iband_inf = source_result # in order to save the I band source_reslt to fix Reff and n for other band. if pltshow == 0: plot_compare = False fits_plot = False else: plot_compare = True fits_plot = True