Ejemplo n.º 1
0
        hr_calc_v2 = npl.hr_from_xi(xis2_unif, atm, cco2, all_coeffs = all_coeffs, atm_pt = atm_pt, allatms = allatms, n_alts = n_alts)
        # hr_ab_orig = npl.hr_atm_calc(atm, cco2)[:n_alts]

        hr_calc_var = np.zeros(n_alts)
        for ialt in range(n_alts):#range(n_alts_lte):
            xis_var = best_var[(cco2, ialt)]
            hr_calc_var[ialt] = npl.hr_from_xi_at_x0(xis_var, atm, cco2, ialt)

        tit = 'co2: {} - atm: {}'.format(cco2, atm)
        xlab = 'CR (K/day)'
        ylab = 'Alt (km)'
        # hrs = [hr_ref, hr_calc, hr_calc_v2, hr_calc_var]
        # labels = ['ref', 'fit unif 1', 'fit unif 2', 'fit var']
        hrs = [hr_ref, hr_calc_v2, hr_calc_var]
        labels = ['ref', 'fit unif', 'fit var']
        fig, a0, a1 = npl.manuel_plot(alts, hrs, labels, xlabel = xlab, ylabel = ylab, title = tit, xlimdiff = (-2., 2.))
        # fig = plt.figure()
        # plt.plot(hr_ref, alts, label = 'ref')
        # plt.plot(hr_calc, alts, label = 'calc')
        # plt.plot(hr_calc-hr_ref, alts, label = 'diff')
        # plt.legend()
        # plt.grid()
        # plt.title('co2: {} - atm: {}'.format(cco2, atm))
        figs.append(fig)
        a0s.append(a0)
        a1s.append(a1)

npl.adjust_ax_scale(a0s)
npl.adjust_ax_scale(a1s)
npl.plot_pdfpages(cart_out + 'check_newparam_LTE_unifit2_vs_varfit.pdf', figs)
Ejemplo n.º 2
0
        ylab = 'Alt (km)'
        # labels = ['nlte_ref', 'new_param', 'np_wutop', 'np_all_wutop', 'np_aw_extended', 'np_noalpha', 'old param']
        # hrs = [hr_ref, hr_calc, hr_calc_wutop, hr_calc_all, hr_calc_extended, hr_calc_alpha1, hr_fomi]
        labels = [
            'nlte_ref', 'np_all_wutop', 'np_aw_extended', 'np_w_lfomi',
            'old param'
        ]
        hrs = [hr_ref, hr_calc_all, hr_calc_extended, hr_calc_fom, hr_fomi]

        colors = np.array(npl.color_set(6))[np.arange(6) != 4]
        fig, a0, a1 = npl.manuel_plot(
            alts,
            hrs,
            labels,
            xlabel=xlab,
            ylabel=ylab,
            title=tit,
            xlimdiff=(-15, 15),
            xlim=(-70, 10),
            linestyles=['-', '--', '-', '--', '-', ':', ':'],
            colors=colors,
            orizlines=[70., alts[n_alts_trlo], alts[n_alts_trhi]])

        figs.append(fig)
        a0s.append(a0)
        a1s.append(a1)

        npl.adjust_ax_scale(a0s)
        npl.adjust_ax_scale(a1s)

npl.plot_pdfpages(cart_out_3 + 'check_uppertrans_all_checkLfomi.pdf', figs)
Ejemplo n.º 3
0
                            surf_temp,
                            max_alts=51)[:n_alts]

    hr_ref = all_coeffs_nlte[(atm, cco2, 'hr_ref')][:n_alts]

    labels = ['ref', 'veof', 'vf5']
    hrs = [hr_ref, hr_new, hr_vf5]
    tit = 'co2: {} - atm: {}'.format(cco2, atm)
    xlab = 'CR (K/day)'
    ylab = 'Alt (km)'
    #labels = ['ref'] + alltips + ['fomi rescale (no fit)', 'old param']
    fig, a0, a1 = npl.manuel_plot(alts,
                                  hrs,
                                  labels,
                                  xlabel=xlab,
                                  ylabel=ylab,
                                  title=tit,
                                  xlimdiff=(-3, 3),
                                  xlim=(-40, 10),
                                  ylim=(10, 90),
                                  linestyles=['-', '--', ':'])

    figs.append(fig)
    a0s.append(a0)
    a1s.append(a1)

npl.adjust_ax_scale(a0s)
npl.adjust_ax_scale(a1s)
npl.plot_pdfpages(cart_out_rep + 'check_reparam_low.pdf', figs)

# c, m for all coeffs
# acoeff
Ejemplo n.º 4
0
                 np.arange(alt1, alt2),
                 color=col,
                 label=atm)

        labels = ['ref', 'veof', 'veof2', 'vf5']
        hrs = [hr_ref, hr_new, hr_new_v2, hr_vf5]
        tit = 'co2: {} - atm: {}'.format(cco2, atm)
        xlab = 'CR (K/day)'
        ylab = 'index'
        #labels = ['ref'] + alltips + ['fomi rescale (no fit)', 'old param']
        fig, a0, a1 = npl.manuel_plot(np.arange(66),
                                      hrs,
                                      labels,
                                      xlabel=xlab,
                                      ylabel=ylab,
                                      title=tit,
                                      xlimdiff=(-2, 2),
                                      xlim=(-40, 10),
                                      ylim=(10, 90),
                                      linestyles=['-', '--', '--', ':'],
                                      colors=colors)

        figs.append(fig)
        a0s.append(a0)
        a1s.append(a1)

    ax2.set_title(str(cco2))
    figs2.append(fig2)

    npl.adjust_ax_scale(a0s)
    npl.adjust_ax_scale(a1s)
Ejemplo n.º 5
0
            xlab = 'CR (K/day)'
            ylab = 'Alt (km)'

            hr_ref = all_coeffs[(atm, cco2, 'hr_ref')][:n_alts]
            hr_calc_step5 = npl.hr_from_ab(acoeff, bcoeff, asurf, bsurf, temp,
                                           surf_temp)[:n_alts]
            hr_calc_step4 = npl.hr_from_ab(acoeff_cco2, bcoeff_cco2,
                                           asurf_cco2, bsurf_cco2, temp,
                                           surf_temp)[:n_alts]

            hrs = [hr_ref, hr_calc_step4, hr_calc_step5]
            labels = ['ref', 'step 4', 'step 5']
            fig, a0, a1 = npl.manuel_plot(alts,
                                          hrs,
                                          labels,
                                          xlabel=xlab,
                                          ylabel=ylab,
                                          title=tit,
                                          xlimdiff=(-2.5, 2.5))

            figs.append(fig)
            a0s.append(a0)
            a1s.append(a1)

    npl.adjust_ax_scale(a0s)
    npl.adjust_ax_scale(a1s)
    npl.plot_pdfpages(
        cart_out + 'check_newparam_LTE_final_{}_correcto.pdf'.format(tip),
        figs)

#pickle.dump(interp_coeffs, open(cart_out + 'interp_coeffs_v1_LTE.p', 'w'))
Ejemplo n.º 6
0
alt_fomi, hr_fomi = npl.old_param(alts, temp, pres, co2vmr)
oldco = spline(alt_fomi, hr_fomi)
hr_fomi = oldco(alts)

tit = 'co2: {} - atm: {}'.format(cco2, atm)
xlab = 'CR (K/day)'
ylab = 'Alt (km)'
labels = ['nlte_ref', 'new_param', 'old param']
hrs = [hr_ref, hr_calc, hr_fomi]
#labels = ['ref'] + alltips + ['fomi rescale (no fit)', 'old param']
fig, a0, a1 = npl.manuel_plot(
    alts,
    hrs,
    labels,
    xlabel=xlab,
    ylabel=ylab,
    title=tit,
    xlimdiff=(-8, 8),
    xlim=(-40, 10),
    linestyles=['-', '-', ':'],
    orizlines=[70., alts[n_alts_trlo], alts[n_alts_trhi]])

fig.savefig(cart_out_3 + 'check_upper_NOalpha_mle_3_samestart.pdf')

# figs.append(fig)
# a0s.append(a0)
# a1s.append(a1)
#
# npl.adjust_ax_scale(a0s)
# npl.adjust_ax_scale(a1s)
#