Changeset 1573 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
May 12, 2017, 9:25:55 PM (8 years ago)
Author:
lfita
Message:

Adding use of 'auto'
Changing example

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/documentation/plotting/gallery.html

    r1559 r1573  
    3838      <A HREF="subbasin.html"><IMG SRC="figs/Caceres_subbasin.png" ALT="plot sub-basin from ORCHIDEE's routing" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>     
    3939      <A HREF="Taylor.html"><IMG SRC="figs/Taylor.png" ALT="Taylor diagram" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    40       <A HREF="time_lag.html"><IMG SRC="figs/mon1_timelag_pr-evap_SACZ.png" ALT="Time lag" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
     40      <A HREF="time_lag.html"><IMG SRC="figs/seas1_timelag_pr-evap_SESA_anom.png" ALT="Time lag" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    4141      <A HREF="time_lag.html"><IMG SRC="figs/mon6_timelag_pr-evap_SACZ_shadline.png" ALT="Time lag" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    4242      <A HREF="time_lag.html"><IMG SRC="figs/mon1_timelag_pr-evap_SACZ_repeatPeriod.png" ALT="Time lag" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
  • trunk/tools/documentation/plotting/time_lag.html

    r1569 r1573  
    1313      Plot a time-lag figure with multiple sources (x, previous values; y, future values)
    1414      <TABLE>
    15         <TD><TR><IMG WIDTH="100%" SRC="figs/mon1_timelag_pr-evap_SACZ.png"></IMG></TR></TD>
     15        <TD><TR><IMG WIDTH="100%" SRC="figs/seas1_timelag_pr-evap_SESA_anom.png"></IMG></TR></TD>
    1616        <TD><TR><IMG WIDTH="100%" SRC="figs/mon6_timelag_pr-evap_SACZ_shadline.png"></IMG></TR></TD>
    1717        <TD><TR><IMG WIDTH="100%" SRC="figs/mon1_timelag_pr-evap_SACZ_repeatPeriod.png"></IMG></TR></TD>
     
    117117    </DIV>
    118118    <DIV CLASS="valins">
    119       * Plotting with cloud of points <BR>
    120       &nbsp;&nbsp;$ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_SESA_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SESA_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm#Forcing_rainstats_OKstomate_SACZ_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SACZ_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm' -S 'auto;centered;pr;1;evap;1;-5,5;-2,2;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA,SACZ;simplepts,1,#AA0000@#0000AA,x,2.;1-month!time-lag!at!SACZ!between!pr!&!evap!normalized!by!mean/stddev;0|12;png;mon1_timelag_pr-evap_SACZ;yes' <BR>
     119      * Plotting with cloud of points seasonal time-lag<BR>
     120      &nbsp;&nbsp;$ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_seasmean_anom.nc;time_centered,0@-9@4;time_centered;rainanom%DiPolo_evapstats_OKstomate_CRUNCEP_SESA_seasmean_anom.nc;time_centered,0@-9@4;time_centered;evapanom#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_seasmean_anom.nc;time_centered,1@-9@4;time_centered;rainanom%DiPolo_evapstats_OKstomate_CRUNCEP_SESA_seasmean_anom.nc;time_centered,1@-9@4;time_centered;evapanom#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_seasmean_anom.nc;time_centered,2@-9@4;time_centered;rainanom%DiPolo_evapstats_OKstomate_CRUNCEP_SESA_seasmean_anom.nc;time_centered,2@-9@4;time_centered;evapanom#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_seasmean_anom.nc;time_centered,3@-9@4;time_centered;rainanom%DiPolo_evapstats_OKstomate_CRUNCEP_SESA_seasmean_anom.nc;time_centered,3@-9@4;time_centered;evapanom' -S 'auto;centered;pr;mm/d;evap;mm/d;extremescentered;extremescentered;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;DJF,MAM,JJA,SON;simplepts,1,#AA0000@#0000AA@#00AA00@#AAAA00,x,2.;1-seas!time-lag!at!SESA!between!pr!&!evap!;0|12;png;seas1_timelag_pr-evap_SESA_anom;yes' <BR>
    121121      * Plotting with connected lines <BR>
    122122      &nbsp;&nbsp;$ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_SESA_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SESA_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm#Forcing_rainstats_OKstomate_SACZ_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SACZ_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm' -S 'auto;centered;pr;1;evap;1;-5,5;-2,2;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA,SACZ;shadTline,1,spectral,%s,horizontal,-@-.,2.,x,2.;6-month!time-lag!at!SACZ!between!pr!&!evap!normalized!by!mean/stddev;0|12;png;mon6_timelag_pr-evap_SACZ_shadline;yes' <BR>
  • trunk/tools/drawing_tools.py

    r1559 r1573  
    98979897      ifclose= whether figure should be closed
    98989898    """
     9899    from scipy import stats as sts
    98999900    fname = 'plot_time_lag'
    99009901
    99019902    Nvalues = len(prevals)
    99029903
    9903     dxn = gen.fillValue
    9904     dxx = -gen.fillValue
    9905     dyn = gen.fillValue
    9906     dyx = -gen.fillValue
    9907 
    9908     for iv in range(Nvalues):
    9909         minv = np.min(prevals[iv])
    9910         maxv = np.max(prevals[iv])
    9911         if minv < dxn: dxn = minv
    9912         if maxv > dxx: dxx = maxv
    9913         minv = np.min(futvals[iv])
    9914         maxv = np.max(futvals[iv])
    9915         if minv < dyn: dyn = minv
    9916         if maxv > dyx: dyx = maxv
     9904    dxn = prerange[0]
     9905    dxx = prerange[1]
     9906    dyn = futrange[0]
     9907    dyx = futrange[1]
    99179908
    99189909    axstyles = ['pretty', 'Nfix', 'Stringlist', 'Vfix']
     
    1007310064
    1007410065            Nlag = int(figv[1])
    10075             col = gen.str_list_rep(figv[2],'@',Nvalues)
     10066            if figv[2] == 'auto':
     10067                col = colorsauto
     10068            else:
     10069                col = gen.str_list_rep(figv[2],'@',Nvalues)
    1007610070            mark = gen.str_list_rep(figv[3],'@',Nvalues)
    1007710071            size = gen.str_list_rep(figv[4],'@',Nvalues)
     
    1008310077                plt.plot(xvs[0:dimt-Nlag], yvs[Nlag:dimt], ',', color=col[iv],       \
    1008410078                  marker=mark[iv], markersize=size[iv])
     10079            # Computing correlation
     10080            corr, p_value = sts.pearsonr(xvs[0:dimt-Nlag], yvs[Nlag:dimt])
     10081            txt='corr= ' + '{0:.3g}'.format(corr) + ' p: ' + '{0:.2g}'.format(p_value)
     10082            plt.annotate(txt,xy=(0.95,0.05*(Nvalues-iv)), xycoords='figure fraction',\
     10083              color=col[iv], fontsize=lsiz, horizontalalignment='right')
    1008510084        else:
    1008610085            print errormsg
Note: See TracChangeset for help on using the changeset viewer.