np.column_stack((dats[lmin_index:lmax_index, 0, 0], no_marginalized_ell)), header=header)
np.savetxt('data/{}/marginalized_ell_CMB_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(output_folder, lmin, lmax, N_det, fsky),
           np.column_stack((dats[lmin_index:lmax_index, 0, 0], marginalized_ell)), header=header)
np.save('data/{}/full_fisher_mat_CMB_lmin={}_lmax={}_ndet={}_fsky={}.npy'.format(output_folder, lmin, lmax, N_det, fsky),
        fisher_save)

np.savetxt('data/{}/ell_indeces_CMB_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(output_folder, lmin, lmax, N_det, fsky),
           dats[lmin_index:lmax_index, 0, 0], header=header)

# utils.study_prior_tau_on_N_eff(fid, fisher, 'data/' + output_folder, header)


print 'finally how much constraint on parameters without prior?'
print ''
fisher_single = fisher.copy()

fisher_inv = np.linalg.inv(fisher_single)

utils.save_cov_matrix(
    fisher_inv, 'data/{}/param_cov_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(output_folder, lmin, lmax, N_det, fsky))


np.savetxt('data/{}/invetered_sqrt_fisher_CMB_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(output_folder,
                                                                                            lmin, lmax, N_det, fsky), np.sqrt(fisher_inv), header=header)
np.savetxt('data/{}/fisher_mat_CMB_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(output_folder,
                                                                                 lmin, lmax, N_det, fsky), fisher_single, header=header)

print 'fisher=', fisher

utils.print_resume_stat(fisher_single, fid)
Beispiel #2
0
        'data/{}/fisher_mat_joint_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(
            output_folder, lmin, lmax, N_det, fsky),
        fisher_single,
        header=header)

    print 'finally how much constraint on parameters without external prior?'
    print ''

    fisher_inv = np.linalg.inv(fisher_single)

    utils.save_cov_matrix(
        fisher_inv,
        'data/{}/param_cov_lmin={}_lmax={}_ndet={}_fsky={}.txt'.format(
            output_folder, lmin, lmax, N_det, fsky))

    np.savetxt(
        'data/{}/invetered_sqrt_fisher_joint_lmin={}_lmax={}_ndet={}_fsky={}.txt'
        .format(output_folder, lmin, lmax, N_det, fsky),
        np.sqrt(fisher_inv),
        header=header)

    print 'fisher=', fisher
    no_lcdm_parameters = ['massless_neutrinos', 'w', 'omnuh2']
    plot_now = ['omnuh2']
    excluded_parameters = list(set(no_lcdm_parameters) - set(plot_now))

    par_gaps, values, fid, fisher_single = utils.exclude_parameters_from_fisher(
        excluded_parameters, par_gaps, values, fid, fisher_single)

    utils.print_resume_stat(fisher_single, fid)
label['scalar_amp(1)'] = 'A_{s}'
label['scalar_spectral_index(1)'] = 'n_{s}'
label['omnuh2'] = r'\Omega_{\nu}h^{2}'
label['re_optical_depth'] = r'\tau'
label['ombh2'] = '\Omega_{b}h^{2}'
label['ombch2'] = '\Omega_{m}h^{2}'
label['omch2'] = '\Omega_{c}h^{2}'
label['helium_fraction'] = 'Y_{p}'
label['w'] = 'w'
label['wa'] = 'w_a'
label['scalar_nrun(1)'] = r'\alpha_{s}'

fisher_inv = np.linalg.inv(fisher_mat)
fisher_inplace = fisher_mat.copy()

utils.print_resume_stat(fisher_mat, fid)
# CYCLE ON PARAMETERS (KEYS HERE)

for key_y in ['omnuh2']:
    print key_y

    sigma_just_CMB_y = (np.sqrt(fisher_inv[fid.keys().index(key_y),
                                           fid.keys().index(key_y)]))
    fg = plt.figure(figsize=fig_dims)
    ax1 = plt.subplot2grid((1, 1), (0, 0))
    ax1.set_color_cycle(Set1_9.mpl_colors)
    lines = ["-", "--", "-.", ":"]
    linecycler = cycle(lines)

    for i, key in enumerate(
        ['hubble', 'omch2', 'scalar_spectral_index(1)', 'scalar_amp(1)']):