for j in range(i + 1, 6): print(titles[i], titles[j]) data_2 = all_para_2[:, j][idx1] chisq = chisq_2[idx] norm = img.figure.Normalize(vmin=numpy.min(chisq), vmax=numpy.max(chisq)) cmap = img.figure.get_cmap('YlOrRd') img.axs[i][j - i - 1].scatter(data_2, data_1, s=10) img.set_label(i, j - i - 1, 0, titles[i]) img.set_label(i, j - i - 1, 1, titles[j]) for i in range(5): for j in range(4, 4 - i, -1): print(i, j) img.del_tick(i, j, [0, 1], [0, 1, 2, 3]) img.subimg_adjust(0.27, 0.27) img.save_img(total_path + "para_contour_.png") img.show_img() # print(idx1.sum(), idx2.sum()) # print(chisq_1[idx1].min(), chisq_1[idx1].max()) # print(chisq_1[idx2].min(), chisq_1[idx2].max()) # print(chisq_2.min()) # idx1 = chisq_2 <= 0.03 # idx21 = chisq_2 > 0.03 # idx22 = chisq_2 < 0.2 # idx2 = idx21 & idx22 # idx3 = chisq_2 > 10 # img = Image_Plot() # img.subplots(1, 1) # img.axs[0][0].hist(chisq_2[idx1], 2)
select_data[j].append([ras[data_tag[i]][idx_t], decs[data_tag[i]][idx_t], zs[data_tag[i]][idx_t]]) img.tick_label(j, i, 1, "R.A.") img.tick_label(j, i, 0, "DEC.") img.axs[j][i].set_title(" Total BOSS galaxy: %d" % num) img.axs[j][i].legend() plt.colorbar(sm, ax=img.axs[j][i]) # print(shape, block_scale) # print(dec_bin.min(), dec_bin.max(), dec_bin.shape) # print(ra_bin.min(), ra_bin.max(), ra_bin.shape) # print(dec_min, dec_max) # print(ra_min, ra_max, ra.shape, idx.sum()) # print("\n") img.subimg_adjust(0.3, 0.2) img.save_img("/mnt/ddnfs/data_users/hkli/CFHT/gg_lensing/result/pic/areas.pdf") plt.close() h5f.close() # The foreground # write to the final hdf5 file for calculation # the CMASS catalog h5f = h5py.File("/mnt/ddnfs/data_users/hkli/CFHT/gg_lensing/data/redshift.hdf5","r") redshift = h5f["/redshift"].value distance = h5f["/distance"].value h5f.close()
img.subplots(1, 2) img.axs[0][0].plot(x, signals, color='k', label="True") img.axs[0][0].errorbar(x, mcmc_shear, mcmc_sig, label="MCMC Recovered") img.axs[0][0].errorbar(x, fq_shear[0], fq_shear[1], label="FQ Recovered") img.set_label(0, 0, 0, "g") img.set_label(0, 0, 1, "X") img.axs[0][0].legend() img.axs[0][1].plot(x, 100 * (signals[:, 0] - mcmc_shear[:, 0]), label="MCMC: True - Recovered") img.axs[0][1].plot(x, 100 * (signals[:, 0] - fq_shear[0]), label="FQ: True - Recovered") img.set_label(0, 1, 0, "$10^2 \\times\Delta g$") img.set_label(0, 1, 1, "X") img.axs[0][1].legend() img.subimg_adjust(0, 0.25) img.save_img("./pic/mcmc_recover_nw_%d_stp_%d.png" % (nwalkers, step)) img.close_img() # for i in range(ndim): # img = Image_Plot() # img.subplots(1, 1) # img.axs[0][0].hist(sampler.flatchain[:, 0], 100, histtype="step", color='k') # img.save_img("mcmc_chisq.png") # # img.show_img() # img.close_img() # pool.close()