コード例 #1
0
def Wind_Coherence_Groupby_Aridity():

    cohere = []
    arid = []
    for ibasin in xrange(0, 10):
        cohere_basin = load('%s/coherence_obs_5var_good_station_%s' %
                            (workspace, basinlongs[ibasin]))
        cohere.append(cohere_basin)
        arid.append(
            load('%s/aridity_station_%s' % (workspace, basinlongs[ibasin])))
    arid = array(list(itertools.chain(*arid)))
    cohere = vstack(cohere)

    index_DI = msc_groupby_DI(arid)
    freq = Coherence_Frequency()

    fig = plt.figure(figsize=(6, 3.5))
    ax = fig.add_subplot(1, 1, 1)
    Plotting.CoherenceAridityPlot(ax, cohere[:, 2, :], index_DI,
                                  sampling_frequency, freq, '',
                                  r'$C_{Epan,u_2}$')

    fig.tight_layout()
    plt.show()
    # savefig('%s/fig5_coh_Epan_u2_aridity_good_station.tif' %figdir, dpi=300)

    return
コード例 #2
0
def Coherence_noVPDRn_Groupby_Aridity():
    "Figure 4, put the VPD, Rn, Tair, ea together "
    arid = []
    cohere_1 = []
    cohere_2 = []
    cohere_3 = []

    for ibasin in xrange(0, 10):
        cohere_basin_1 = load('%s/coherence_vpd_other_vars_good_station_%s' %
                              (workspace, basinlongs[ibasin]))
        cohere_basin_2 = load('%s/coherence_rn_other_vars_good_station_%s' %
                              (workspace, basinlongs[ibasin]))
        cohere_basin_3 = load('%s/coherence_tavg_other_vars_good_station_%s' %
                              (workspace, basinlongs[ibasin]))

        cohere_1.append(cohere_basin_1)
        cohere_2.append(cohere_basin_2)
        cohere_3.append(cohere_basin_3)

        arid.append(
            load('%s/aridity_station_%s' % (workspace, basinlongs[ibasin])))
    arid = array(list(itertools.chain(*arid)))
    cohere_1 = vstack(cohere_1)
    cohere_2 = vstack(cohere_2)
    cohere_3 = vstack(cohere_3)

    index_DI = msc_groupby_DI(arid)

    fig = plt.figure(figsize=(10, 8.5))
    drivername = [
        r'$C_{VPD,Tair}$', r'$C_{VPD,e_a}$', r'$C_{R_n,Tair}$',
        r'$C_{R_n,e_a}$', r'$C_{Tair,e_a}$'
    ]
    labels = ('a', 'b', 'c', 'd', 'e')
    freq = Coherence_Frequency()

    dataplot = [
        cohere_1[:, 1, :], cohere_1[:, 2, :], cohere_2[:, 0, :],
        cohere_2[:, 1, :], cohere_3[:, 0, :]
    ]

    for i, var in enumerate(drivername):
        ax = fig.add_subplot(3, 2, i + 1)

        Plotting.CoherenceAridityPlot(ax, dataplot[i], index_DI,
                                      sampling_frequency, freq, labels[i], var)
        if i == 4:
            ax.legend(bbox_to_anchor=(1.45, 0.5),
                      loc='center left',
                      fontsize=16)

    fig.tight_layout()
    plt.show()
    # savefig('%s/fig4_coh_inter_var_aridity_good_station.tif' %figdir, dpi=300)

    return
コード例 #3
0
def Epan_VPD_Rn_Partial_Coherence_Groupby_Aridity():
    "Figure 3, put the Epan, Rn-VPD and partial together into the same figure"

    pcoh = []
    arid = []
    Epan_cohere = []
    VPD_cohere = []

    for ibasin in xrange(0, 10):
        epan_cohere = load('%s/coherence_obs_5var_good_station_%s' %
                           (workspace, basinlongs[ibasin]))
        vpd_cohere = load('%s/coherence_vpd_other_vars_good_station_%s' %
                          (workspace, basinlongs[ibasin]))
        pcoh_basin = load('%s/pcoh_pan_vpd_rn_good_station_%s' %
                          (workspace, basinlongs[ibasin]))
        Epan_cohere.append(epan_cohere)
        VPD_cohere.append(vpd_cohere)
        pcoh.append(pcoh_basin)
        arid.append(
            load('%s/aridity_station_%s' % (workspace, basinlongs[ibasin])))
    arid = array(list(itertools.chain(*arid)))
    Epan_cohere = vstack(Epan_cohere)
    VPD_cohere = vstack(VPD_cohere)
    pcoh = vstack(pcoh)

    index_DI = msc_groupby_DI(arid)

    dataplot = [
        Epan_cohere[:, 4, :], Epan_cohere[:, 1, :], pcoh[:, 0, :],
        pcoh[:, 1, :], VPD_cohere[:, 0, :]
    ]
    freq = Coherence_Frequency()

    fig = plt.figure(figsize=(10, 8.5))
    drivername = [
        r'$C_{Epan,VPD}$', r'$C_{Epan,R_n}$', r'$C_{Epan,VPD/R_n}$',
        r'$C_{Epan,R_n/VPD}$', r'$C_{VPD,R_n}$'
    ]
    labels = ('a', 'b', 'c', 'd', 'e')
    positions = (1, 2, 3, 4, 5)

    for i, var in enumerate(drivername):
        ax = fig.add_subplot(3, 2, positions[i])
        Plotting.CoherenceAridityPlot(ax, dataplot[i], index_DI,
                                      sampling_frequency, freq, labels[i], var)
        if i == 4:
            ax.legend(bbox_to_anchor=(1.45, 0.5),
                      loc='center left',
                      fontsize=16)

    fig.tight_layout()
    plt.show()
    # savefig('%s/fig3_epan_vpd_rn_coh_pcoh_aridity_good_station.tif' %figdir, dpi=300)

    return