Changeset 2079 in lmdz_wrf for trunk/tools/drawing_tools.py


Ignore:
Timestamp:
Aug 10, 2018, 9:25:59 PM (7 years ago)
Author:
lfita
Message:

Starting to add draw_WRFeta_levels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r2031 r2079  
    1274212742    return
    1274312743
     12744def plot_draw_WRFeta_levels(ahgtsea, axhgt, ahgtxhgt, adhgtsea, adhgtxhgt, aetaw,    \
     12745     imgtit, labels, cols, marks, legvs, figtitle, kfig, close):
     12746    """ Function to plot different sets of WRF eta-levels
     12747      ahgtsea: all hegights of a point above sea
     12748      axhgt: all maximum hegights
     12749      ahgtxhgt: all hegights of the point above mximum height
     12750      adhgtsea: all relative heights of a point above sea
     12751      adhgtxhgt: all relative heights of the point above maximum topo
     12752      aetaw: all eta-full values
     12753      aetau: all eta-half values
     12754      labels: labels
     12755      cols: colors
     12756      marks: markers
     12757      legvs: [legloc, legfs] legend values
     12758      figtitle: title of figure
     12759      kfig: kind of file of graphical output
     12760      close: whether figure should be closed
     12761    """
     12762    fname = 'plot_draw_WRFeta_levels'
     12763
     12764
     12765    plt.rc('text', usetex=True)
     12766
     12767    fig = plt.subplots(2)
     12768
     12769    plt.subplot(1,1,2)
     12770    # Absolute heights
     12771    Nlabs = len(labels)
     12772    for ilab in range(Nlabs):
     12773        hgtsea = ahgtsea[ilab]
     12774        hgtxhgt = ahgtxhgt[ilab]
     12775        znw = aetaw[ilab]
     12776
     12777        plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \
     12778          label='$hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab])
     12779        if ilab == 0:
     12780            plt.plot(znw, hgtsxhgt,  '-.', marker=marks[ilab], linewidth=1.5,        \
     12781              markersize=4, label='$hgt_{hgtmax}^{'+labels[ilab]+'}$',               \
     12782              color=colors[ilab])
     12783        else:
     12784            plt.plot(znw, hgtsxhgt,  '-.', marker=marks[ilab], linewidth=1.5,        \
     12785              markersize=4, label=None, color=cols[ilab])
     12786
     12787    plt.xlabel('$\eta$-level', color='k')
     12788    plt.ylabel('absolute height ($m$)', color='black')
     12789    plt.yscale('log')
     12790
     12791    titleloc = (0.5,1.075)
     12792
     12793    plt.title('Absoulte Heights from sea \& highest grid point',position=titleloc)
     12794    plt.legend(loc=0, prop={'size':10})
     12795
     12796    plt.title(gen.latex_text(figtitle))
     12797
     12798    plt.subplot(2,1,2)
     12799    # Relative heights
     12800    Nlabs = len(labels)
     12801    for ilab in range(Nlabs):
     12802        hgtsea = adhgtsea[ilab]
     12803        hgtxhgt = adhgtxhgt[ilab]
     12804        znw = aetau[ilab]
     12805
     12806        plt.plot(znw, hgtssea, '-', marker=marks[ilab], linewidth=1.5, markersize=4, \
     12807          label='$\delta hgt_{sea}^{'+labels[ilab]+'}$', color=cols[ilab])
     12808        if ilab == 0:
     12809            plt.plot(znw, hgtsxhgt,  '-.', marker=marks[ilab], linewidth=1.5,        \
     12810              markersize=4, label='$\delta hgt_{hgtmax}^{'+labels[ilab]+'}$',        \
     12811              color=colors[ilab])
     12812        else:
     12813            plt.plot(znw, hgtsxhgt,  '-.', marker=marks[ilab], linewidth=1.5,        \
     12814              markersize=4, label=None, color=cols[ilab])
     12815
     12816    plt.xlabel('$\eta$-level', color='k')
     12817    plt.ylabel('$\delta height$ ($m$)', color='black')
     12818    plt.yscale('log')
     12819
     12820    titleloc = (0.5,1.075)
     12821
     12822    plt.title('Relative Heights from sea \& highest grid point',position=titleloc)
     12823    plt.legend(loc=0, prop={'size':10})
     12824
     12825    plt.title(gen.latex_text(figtitle))
     12826
     12827    fig.suptitle(imgtit)
     12828
     12829    figname = 'stations_map'
     12830    output_kind(kfig, figname, close)
     12831
     12832    return
     12833
Note: See TracChangeset for help on using the changeset viewer.