Changeset 2031 in lmdz_wrf


Ignore:
Timestamp:
Aug 6, 2018, 5:10:39 PM (7 years ago)
Author:
lfita
Message:

Introducing selection of frequency of markers in `draw_multiWindRose'

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r2024 r2031  
    99189918          'linepoint': consecutive (time, height, level, ...) line-point angle and speed values. Three different species
    99199919            'multicol': line-marker color changing according to a third variable [extravarn]
    9920                values: [extravarn];[lines];[markers];[colbar];[Nang]
     9920               values: [extravarn];[lines];[markers];[freqmarkers];[colbar];[Nang]
    99219921            'multicoltime': line-marker color changing according to a temporal variable [extravarn]
    99229922               values: [extravarn];[lines];[markers];[colbar];[Nang];[timekind];[timefmt];[timelabel]
     
    99349934             [lines]: '@' separated list of type of lines (matplotlib ref)
    99359935             [markers]: '@' separated list of type of markers to use (matplotlib ref)
     9936             [freqmarkers]: '@' separated list of frequency of drawing markers ('auto' for every 10)
    99369937             [cols] = '@' separated list of colors ('#[RR][GG][BB])
    99379938             [colbar]: name of the colorbar ('auto' for 'spectral_r')
     
    99979998    if lpvals[0] == 'linepoint':
    99989999        if lkind == 'multicol':
    9999             if len(lpvals) != 7:
     10000            if len(lpvals) != 8:
    1000010001                print errormsg
    1000110002                print '  ' + fname + ": line-point kind '" + lkind + "' requires " + \
    1000210003                  "6 values !!"
    10003                 print "    'multiecol';[extravarn];[line];[marker];[colbar];[Nang]"
     10004                print "    'multiecol';[extravarn];[line];[marker];[freqmarker];" +  \
     10005                  "[colbar];[Nang]"
    1000410006                print '    provided:', lpvals
    1000510007                quit(-1)     
  • trunk/tools/drawing_tools.py

    r2014 r2031  
    88558855        lpvals[>=2]: specific values for the specie Wind Rose
    88568856        'linepoint';[kind];[val1];[...;[valN]]: consecutive (time, height, level, ...) line-point angle and speed values
    8857           'multicol';[extravarn];[lines];[markers];[colbar]
     8857          'multicol';[extravarn];[lines];[markers];[freqmarkers];[colbar]
    88588858          'multicoltime';[extravarn];[lines];[markers];[colbar];[timekind];[timefmt];[timelabel]
    88598859          'singlecol';[lines];[markers];[cols]
     
    88968896    if lpvals[0] == 'linepoint':
    88978897        if lkind == 'multicol':
    8898             colbar = gen.auto_val(lpvals[5],'spectral_r')
    8899             Nang = gen.auto_val(lpvals[6],8)
     8898            colbar = gen.auto_val(lpvals[6],'spectral_r')
     8899            Nang = gen.auto_val(lpvals[7],8)
    89008900            # Setting up colors for each label
    89018901            #   From: http://stackoverflow.com/questions/15235630/matplotlib-pick-up-one-color-associated-to-one-value-in-a-colorbar
     
    89148914            ltyps = gen.auto_val_list(lpvals[3].split('@'), Nsnds, linekindsauto)
    89158915            lmrks = gen.auto_val_list(lpvals[4].split('@'), Nsnds, pointkindsauto)
     8916            lfrqs = gen.auto_val_list(lpvals[5].split('@'), Nsnds,                   \
     8917              np.ones((Nsnds), dtype=int)*10)
    89168918
    89178919            for isnds in range(Nsnds):
     
    89218923                ltyp = ltyps[isnds]
    89228924                lmrk = lmrks[isnds]
     8925                lfrq = lfrqs[isnds]
    89238926
    89248927                sndS = labs[isnds]
     
    89308933                        plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]],     \
    89318934                          ltyp, marker=lmrk, color=labcol, label=gen.latex_text(sndS))
     8935
     8936                    if np.mod(ie,lfrq) == 0:
     8937                        plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]],     \
     8938                          ltyp, marker=lmrk, color=labcol)
    89328939                    else:
    89338940                        plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]],     \
    8934                           ltyp, marker=lmrk, color=labcol)
     8941                          ltyp, color=labcol)
    89358942
    89368943                ie = dime-1
  • trunk/tools/obs-sim_Comparison.bash

    r2028 r2031  
    913913    figheader=`echo ${valuesfig} | tr '%' ' ' | awk '{print $9}'`
    914914
    915     values='linepoint;multicol;pres;-;'${lmark}';spectral;auto:'${labs}':'
     915    values='linepoint;multicol;pres;-;'${lmark}';auto;spectral;auto:'${labs}':'
    916916    values=${values}'WindRose!obs!,!sim!comparison!at!'${stid}'!on!'${timeS}'!UTC:'
    917917    values=${values}${kfig}':auto:''True'
     
    932932      echo "* "${ofign} >> ${ofilefigs}
    933933      echo python ${pyHOME}/drawing.py -o draw_multiWindRose -f "'"${files}"'"       \
    934         -S "'"${values}"'" -v ${sfcv} >> ${ofilefigs}
     934        -S "'"${values}"'" >> ${ofilefigs}
    935935      echo " "${ofign} >> ${ofilefigs}
    936936    fi
     
    14651465          fstats=`python $pyHOME/nc_var.py -o field_stats -S full,1.e+20,None        \
    14661466            -f ${simsndptf} -v pres | grep MAT | grep pres`
    1467           nsimpres=`echo ${fstats} | awk '{printf ("%d",$3*1000)}'`
     1467          nsimpres=`echo ${fstats} | awk '{printf ("%d",$3)}'`
    14681468        fi
    14691469
     
    14711471        obspres=`python $pyHOME/nc_var.py -o varout -f ${obsuavaf} -S time:${it}     \
    14721472          -v pres | awk '{print $2}' | tr '\n' ':'`
    1473         vals=${obspres}',threshold,:,'${nsimpres}
     1473        Lobspres1=`expr length ${obspres} | awk '{print $1-1}'`
     1474        vals=${obspres:0:${Lobspres1}}',threshold,:,'${nsimpres}
    14741475        kobs=`python ${pyHOME}/generic.py -o inf_operSlist -S ${vals}`
    14751476        if test $? -ne 0; then
     
    14791480            exit
    14801481        fi
    1481         echo "      obs level of sim npres "${nsimpres}": "${kobs}
     1482        vals=${obspres:0:${Lobspres1}}',getvalue,:,'${kobs}
     1483        onpres=`python ${pyHOME}/generic.py -o inf_operSlist -S ${vals}`
     1484        echo "      obs level of sim npres "${nsimpres}": "${kobs}" "${onpres}
    14821485
    14831486        mWRcomplabs='obs,'${expn}
Note: See TracChangeset for help on using the changeset viewer.