Changeset 1573 in lmdz_wrf for trunk/tools
- Timestamp:
- May 12, 2017, 9:25:55 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/documentation/plotting/gallery.html
r1559 r1573 38 38 <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> 39 39 <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> 41 41 <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> 42 42 <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 13 13 Plot a time-lag figure with multiple sources (x, previous values; y, future values) 14 14 <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> 16 16 <TD><TR><IMG WIDTH="100%" SRC="figs/mon6_timelag_pr-evap_SACZ_shadline.png"></IMG></TR></TD> 17 17 <TD><TR><IMG WIDTH="100%" SRC="figs/mon1_timelag_pr-evap_SACZ_repeatPeriod.png"></IMG></TR></TD> … … 117 117 </DIV> 118 118 <DIV CLASS="valins"> 119 * Plotting with cloud of points <BR>120 $ 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 $ 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> 121 121 * Plotting with connected lines <BR> 122 122 $ 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 9897 9897 ifclose= whether figure should be closed 9898 9898 """ 9899 from scipy import stats as sts 9899 9900 fname = 'plot_time_lag' 9900 9901 9901 9902 Nvalues = len(prevals) 9902 9903 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] 9917 9908 9918 9909 axstyles = ['pretty', 'Nfix', 'Stringlist', 'Vfix'] … … 10073 10064 10074 10065 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) 10076 10070 mark = gen.str_list_rep(figv[3],'@',Nvalues) 10077 10071 size = gen.str_list_rep(figv[4],'@',Nvalues) … … 10083 10077 plt.plot(xvs[0:dimt-Nlag], yvs[Nlag:dimt], ',', color=col[iv], \ 10084 10078 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') 10085 10084 else: 10086 10085 print errormsg
Note: See TracChangeset
for help on using the changeset viewer.