for smooth in smooth_arr: k = kk.KappaAmara('.', fname, fname, '.', smooth, zs=1.1, zmin_s=0.1, zmax_s=1.1, zmin_g=0.1, zmax_g=1.1) k.delta_rho_3d(60, 60, 20) #k.true_values(g_to_k=True, e_sign = [-1,-1], col_names=['RA', 'DEC', 'Z', 'GAMMA1', 'GAMMA2', '', '', '']) k.true_values(g_to_k=True, e_sign = [-1,-1], col_names=['RA', 'DEC', 'Z', 'E1', 'E2', '', '', '']) kfg = k.kappa_true.copy() g1 = k.gamma1_true.copy() g2 = k.gamma2_true.copy() #This is just to average the true values in the simulation k.true_values(g_to_k=False) #Predicted from the galaxies k.kappa_predicted() k.gamma_predicted() bias, biase = kk.linear_bias_kappa(kfg, k.kappa_pred) b_k.append(bias) be_k.append(biase) bias, biase = kk.linear_bias_kappa(k.kappa_true, k.kappa_pred) b_kg.append(bias) be_kg.append(biase) #kk.linear_bias_kappa(k.kappa_true, k.kappa_pred_sm) mask = k.mask mask = where(k.gamma1_true == 0, 0, 1) mask = ndimage.morphology.binary_erosion(mask, iterations=5) g1p = k.gamma_p.real g2p = k.gamma_p.imag #g1t = -k.gamma1_true
cons = (gmr > -9999.0) #magnitude cutoff os.system('rm -f %s %s'%(fsource, flens)) write_fits_table(flens, ['RA', 'DEC', 'Z', 'KAPPA', 'GAMMA1', 'GAMMA2', 'E1', 'E2'], [ra[conl], dec[conl], pz[conl], kappa[conl], tg1[conl], tg2[conl], e1[conl], e2[conl]]) write_fits_table(fsource, ['RA', 'DEC', 'Z', 'KAPPA', 'GAMMA1', 'GAMMA2', 'E1', 'E2'], [ra[cons], dec[cons], pz[cons], kappa[cons], tg1[cons], tg2[cons], e1[cons], e2[cons]]) k = kk.KappaAmara('.', fsource, flens, '.', c.smooth, zs=c.zs, zmin_s=c.zmin_s, zmax_s=c.zmax_s, zmin_l=c.zmin_l, zmax_l=c.zmax_l) k.delta_rho_3d(c.bins, c.bins, c.zbins) k.true_values(g_to_k=False, e_sign = c.e_sign, col_names=['RA', 'DEC', 'Z', 'GAMMA1', 'GAMMA2', '', '', '']) g1 = k.gamma1_true.copy() g2 = k.gamma2_true.copy() k.kappa_predicted() k.gamma_predicted() kk.linear_bias_kappa(k.kappa_true[c.ig:-c.ig,c.ig:-c.ig], k.kappa_pred[c.ig:-c.ig,c.ig:-c.ig]) kk.linear_bias_kappa(k.kappa_true[c.ig:-c.ig,c.ig:-c.ig], k.kappa_pred_3d[c.ig:-c.ig,c.ig:-c.ig]) mask = k.mask[c.ig:-c.ig,c.ig:-c.ig] #mask = where(k.gamma1_true == 0, 0, 1) #mask = ndimage.morphology.binary_erosion(mask, iterations=5) rcParams.update({'figure.figsize' : [10.5, 2.8]}) figure(1) clf() subplot(131) imshow(k.kappa_true[c.ig:-c.ig,c.ig:-c.ig], origin='lower')#, vmin=-0.03, vmax=0.03) title(r'True $\kappa$') xlabel('arcmin') ylabel('arcmin') colorbar(shrink=0.8, format='%.2f')