示例#1
0
    # idx = detect_num < 1
    # detect_num[idx] = 1
    # result_stack = result_stack/detect_num
    # result_stack[idx] = -1000
    # print(result_stack)

    numpy.savez("./imgs/stack_result.npz", shears, result_stack,
                error_bar_stack, pk_pool, mag_auto_pool, snr_pool, snr_stack)

    # plot
    # matplotlib.style.use('default')
    img = Image_Plot(fig_x=6, fig_y=4, ypad=0.22, xpad=0)
    img.subplots(2, 2)
    # img.set_style_default()
    img.set_style()
    img.axis_type(0, "major")
    img.axis_type(1, "major")
    markers = ['o', 'v', 's', 'h', 'd', 'p', "4", "*", "X", "^", ">", "+"]
    colors = ["C%d" % i for i in range(10)]
    plot_data = [
        result_stack[:flux_num], result_stack[flux_num:2 * flux_num],
        result_stack[2 * flux_num:3 * flux_num],
        result_stack[3 * flux_num:4 * flux_num]
    ]
    plot_data_err = [
        error_bar_stack[:flux_num], error_bar_stack[flux_num:2 * flux_num],
        error_bar_stack[2 * flux_num:3 * flux_num],
        error_bar_stack[3 * flux_num:4 * flux_num]
    ]
    labels = ["$\\nu_{F}$", "MAG_AUTO", "SNR", "Resolution factor"]
示例#2
0
    "/cuts_pi_all_sample_w_maxpkfit_sq/sym/sex2_1.5/flux2_ex3/total.hdf5", "r")
mc1_mpk_pk_fit = h5f["/mc1"][()][:, ch]
mc2_mpk_pk_fit = h5f["/mc2"][()][:, ch]
h5f.close()

h5f = h5py.File(
    data_path +
    "/cuts_pi_all_sample_w_maxpkfit_sq/sym/sex2_1.5/mag_true/total.hdf5", "r")
mc1_mpk_tmag = h5f["/mc1"][()][:, ch]
mc2_mpk_tmag = h5f["/mc2"][()][:, ch]
h5f.close()

matplotlib.rcParams["font.family"] = "serif"
img = Image_Plot(fig_x=6, fig_y=4, xpad=0.2, ypad=0.2, legend_size=13)
img.subplots(1, 1)
img.axis_type(0, "major", tick_len=6, tick_width=1.5)
img.axis_type(1, "major", tick_len=6, tick_width=1.5)

img.axs[0][0].errorbar(x_coord,
                       100 * mc1_tf_pk_fit[0],
                       100 * mc1_tf_pk_fit[1],
                       linewidth=img.plt_line_width - 0.5,
                       capsize=img.cap_size,
                       marker="o",
                       fillstyle="none",
                       c="C2",
                       label="$m_1$, weight=$F^{-2}$")
img.axs[0][0].errorbar(x_coord,
                       100 * mc2_tf_pk_fit[0],
                       100 * mc2_tf_pk_fit[1],
                       linewidth=img.plt_line_width - 0.5,
示例#3
0
# total_path = "/mnt/ddnfs/data_users/hkli/selection_bias/paper_data/galsim_dimmer/"
total_path = "/mnt/ddnfs/data_users/hkli/selection_bias/paper_data/pts_dimmer/"

pic_nm = "chisq_pts.pdf"
pic_nm_png = "chisq_pts.png"

sex_filter_name = "sex2_1.5"

shear_cata = total_path + "parameters/shear.npz"
shear = numpy.load(shear_cata)

fmt = '%2.f%%'

img = Image_Plot(fig_x=5, fig_y=4, xpad=0.45, ypad=0.22)
img.subplots(2, 2)
img.axis_type(0, "major", tick_len=8, tick_width=2)
img.axis_type(1, "major", tick_len=8, tick_width=2)

locs = ["upper left", "upper left", "upper left", "upper left"]
legend_loc = [(0.02, 0.95), (0.02, 0.95), (0.02, 0.95), (0.02, 0.66)]
legend_loc_share_ax = [(0.02, 0.62), (0.02, 0.62), (0.02, 0.62), (0.02, 0.35)]
ylims = [(-9, 85), (-24, 285), (-9, 85), (-850, 85)]
for m in range(1):
    source = sources[m]
    g1 = shear["arr_0"][source]
    g2 = shear["arr_1"][source]

    # point source
    fourier_path = total_path + "result/data/data_%d.hdf5" % source
    f_h5 = h5py.File(fourier_path, "r")
    es_data = f_h5["/data"].value