예제 #1
0
        if key == key_y:
            continue
            # DO NOT TEST PRIOR ON ONE PARMS IN ITSELF; TRIVIAL
        # ERROR ON Y IN THE CMB S4
        # RELATIVE ERROR ON X IN THE CMB S4 we need relative cause this is how prior are used
        sigma_just_CMB_x = (np.sqrt(fisher_inv[fid.keys().index(key),
                                               fid.keys().index(key)]) /
                            np.abs(fid[key]))
        # the abs value abbove is taken to deal with the negative fiducial value of w
        prior_value = np.linspace(sigma_just_CMB_x / 10.,
                                  sigma_just_CMB_x * 4.5, 900)
        # print sigma_just_CMB_x
        # sigma_just_CMB_y_percent =sigma_just_CMB_y_percent /fid[key_y]
        normalize_x = prior_value / sigma_just_CMB_x  # prior respect to actual error
        # compute the new sigma on y given the prior
        new_sigma = utils.return_simgax_y_prior(fid, fisher_mat, key_y, key,
                                                prior_value)
        normalize_y = new_sigma / sigma_just_CMB_y  # make the new sigma y relative.
        # plot

        line_plot = ax1.plot(normalize_x,
                             new_sigma * 94. * 1000.,
                             label=r'$\sigma({0})={1:.1f}\%$'.format(
                                 str(label[key]),
                                 np.abs(sigma_just_CMB_x * 100.)),
                             linestyle=next(linecycler))

    new_sigma_all = utils.return_simgax_all_prior(fid, fisher_mat, key_y)

    plt.plot(normalize_x,
             new_sigma_all * 94. * 1000.,
             label=r'All',
    for i, key in enumerate(['re_optical_depth']):

        if key == key_y:
            continue
            # DO NOT TEST PRIOR ON ONE PARMS IN ITSELF; TRIVIAL
        # ERROR ON Y IN THE CMB S4
        # RELATIVE ERROR ON X IN THE CMB S4 we need relative cause this is how prior are used
        sigma_just_CMB_x = (np.sqrt(fisher_inv[fid.keys().index(key), fid.keys().index(key)]) / np.abs(fid[key]))
        # the abs value abbove is taken to deal with the negative fiducial value of w
        prior_value = np.linspace(0.001, 0.08, 900)
        # print sigma_just_CMB_x
        # sigma_just_CMB_y_percent =sigma_just_CMB_y_percent /fid[key_y]
        # normalize_x = prior_value / sigma_just_CMB_x  # prior respect to actual error
        # compute the new sigma on y given the prior
        new_sigma = utils.return_simgax_y_prior(fid, fisher_mat, key_y, key, prior_value)
        # normalize_y = new_sigma / sigma_just_CMB_y  # make the new sigma y relative.
        # plot
        # *93.14 * 1000. to go to M_nu
        # line_plot = ax1.plot(prior_value*100., new_sigma * 94. * 1000., label=r'$\sigma_{{\rm{{pipeline}}}}({0})={1:.1f}\%$'.format(
        #     str(label[key]), np.abs(sigma_just_CMB_x * 100.)), linestyle=next(linecycler))
        line_plot = ax1.plot(prior_value*100., new_sigma * 94. * 1000., label=r'$\sigma_{{\rm{{pipeline}}}}({0})/{0}$'.format(
            str(label[key]), np.abs(sigma_just_CMB_x * 100.)), linestyle=next(linecycler))

    ax1.minorticks_on()
    # low_lim = np.min(0.8 * np.amin(new_sigma),0.8 * 23.24  / 100. * fid['omnuh2'])
    # print 'lowlim', low_lim
    print ax1.get_ylim()
    ax1.set_ylim((18, 32))
    # ax1.set_ylim(0,1)
    print ax1.get_ylim()