- Timestamp:
- Aug 22, 2016, 12:00:16 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1039 r1041 29 29 mandatorykeys = ['pyHOME', 'cdoHOME', 'scratch', 'filescratch', 'figscratch', \ 30 30 'diffscratch', 'figdiffscratch', 'addfiles', 'addfigures', 'adddiffs', \ 31 ' debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', 'titleoperations',\32 ' kindfig', 'CFreftime', 'CFunitstime', 'mapval', 'timekind', 'timefmt',\33 'time label' ]31 'adddifffigures', 'debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', \ 32 'titleoperations', 'kindfig', 'CFreftime', 'CFunitstime', 'mapval', \ 33 'timekind', 'timefmt', 'timelabel' ] 34 34 35 35 # List with the optional keys … … 148 148 adddiffs = False 149 149 150 if config['adddifffigures'] == 'true': 151 adddifffigs = True 152 else: 153 adddifffigs = False 154 150 155 if config['debug'] == 'true': 151 156 debug = True … … 153 158 debug = False 154 159 155 return scr, filescr, figscr, difscr, figdifscr, addfils, addfigs, adddiffs, debug160 return scr, filescr, figscr, difscr, figdifscr, addfils, addfigs, adddiffs, adddifffigs, debug 156 161 157 162 def exp_headers(mod,config): … … 675 680 pinterp: pressure interpolation (to the given $plevels) 676 681 tmean: temporal mean values 682 tstd: temporal standard deviation values 677 683 turb: Taylor's turbulence decomposition value 678 684 xmean: x-axis mean values … … 915 921 varkeep.append('timestats') 916 922 923 elif op == 'tstd': 924 # temporal standard deviation values 925 vals='time|-1,time,std,' + ':'.join(varnCFs) + ':' + vdnz 926 dims = gen.dictvar_listS(varnCFs,CFdimvardict,',','@') + dnz+'@'+vdnz 927 if dofile: 928 try: 929 with gen.Capturing() as output: 930 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 931 except: 932 print errmsg 933 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 934 for sout in output: print sout 935 quit(-1) 936 937 if db: 938 for sout in output: print sout 939 940 sout = sub.call('mv file_oper_alongdims_std.nc '+fileon, shell=True) 941 942 # Keeping the operations 943 pyins=pyH + "/nc_var.py -o file_oper_alongdims -S '" + vals + \ 944 "' -f " + prevfile + " -v " + CFvarnp 945 otrackf.write("\n") 946 otrackf.write("# " + CFvarn + " " + Fopers + "\n") 947 otrackf.write(pyins + "\n") 948 949 # removing dimension variable-dimension 'time' 950 varnCFs.remove('time') 951 952 varkeep.append('timestats') 953 917 954 # elif op == 'turb': 918 955 # # turbulence values … … 2007 2044 pinterp: pressure interpolation (to the given $plevels) 2008 2045 tmean: temporal mean values 2046 tstd: temporal standard deviation values 2009 2047 turb: Taylor's turbulence decomposition value 2010 2048 xmean: x-axis mean values … … 2167 2205 varkeep.append('timestats') 2168 2206 2207 elif op == 'tstd': 2208 # temporal standard deviation values 2209 vals='time|-1,time,std,' + ':'.join(varnCFs) + ':' + vdnz 2210 dims = gen.dictvar_listS(varnCFs,CFdimvardict,',','@') + dnz+'@'+vdnz 2211 if dofile: 2212 try: 2213 with gen.Capturing() as output: 2214 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 2215 except: 2216 print errmsg 2217 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 2218 for sout in output: print sout 2219 quit(-1) 2220 2221 if db: 2222 for sout in output: print sout 2223 2224 sout = sub.call('mv file_oper_alongdims_std.nc '+fileon, shell=True) 2225 2226 # Keeping the operations 2227 pyins=pyH + "/nc_var.py -o file_oper_alongdims -S '" + vals + \ 2228 "' -f " + prevfile + " -v " + CFvarnp 2229 otrackf.write("\n") 2230 otrackf.write("# " + varn + " " + Fopers + "\n") 2231 otrackf.write(pyins + "\n") 2232 2233 # removing dimension variable-dimension 'time' 2234 varnCFs.remove('time') 2235 2236 varkeep.append('timestats') 2237 2169 2238 # elif op == 'turb': 2170 2239 # # turbulence values … … 2680 2749 # scratches 2681 2750 scratch, filescratch, figscratch, diffscratch, figdiffscratch, addfiles, addfigures, \ 2682 adddiffs, dbg = scratches(cnf)2751 adddiffs, adddifffigures, dbg = scratches(cnf) 2683 2752 2684 2753 # Getting models … … 2921 2990 objf.close() 2922 2991 2923 if add figures:2992 if adddifffigures: 2924 2993 sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True) 2925 2994 -
trunk/tools/model_graphics_template.dat
r1039 r1041 36 36 37 37 # Have new files been added and do they need to be processed? 38 addfiles = false38 addfiles = true 39 39 40 40 # Have new figures been added and do they need to be drawn? 41 addfigures = false41 addfigures = true 42 42 43 43 # Have new differences been added and do they need to be processed and drawn? 44 adddiffs = false 44 adddiffs = true 45 46 # Have new difference figures been added and do they need to be drawn? 47 adddifffigures = true 45 48 46 49 # Debug … … 88 91 # pinterp: pressure interpolation (to the given $plevels, see below) 89 92 # tmean: temporal mean values 93 # tstd: temporal standard deviation values 90 94 # turb: Taylor's turbulence decomposition value 91 95 # xmean: x-axis mean values … … 101 105 VAR_last = uas:vas:hfss:hfls 102 106 VAR_tmean = uas:vas:hfss:hfls 107 VAR_tstd = tas:wss 103 108 VAR_xmean = uas:vas:hfss:hfls 104 109 #VAR_last+pinterp+xmean = ua:va:hur:hus:turb … … 122 127 DIFFOP_xmean = uas:vas 123 128 DIFFOP_tmean = hfss:hfls 129 DIFFOP_tstd = tas:wss 124 130 DIFFOP_pinterp+tmean+xmean = ua:va 125 131 … … 127 133 DIFFVAR_xmean = uas:vas 128 134 DIFFVAR_tmean = hfss:hfls 135 DIFFVAR_tstd = tas:wss 129 136 DIFFVAR_pinterp+tmean+xmean = ua:va 130 137 … … 134 141 # once 'tmean', or 'xmean' are computed, variable [varn] will become [varn]mean 135 142 opsur_mean = Lmean:lmean:tmean:xmean:ymean 143 opsur_std = tstd 136 144 137 145 # Text as title for each operation 138 146 # as ':' separated list of [op]|[explanation '!' as spaces] 139 titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|pinterp:tmean|tmean:t urb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum147 titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|pinterp:tmean|tmean:tstd|tstd:turb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum 140 148 141 149 # Pressure levels … … 162 170 # DIRPLT_: Figures which can be made directly without another model/experiment output 163 171 164 DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last 172 DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last:tas|tstd#wss|tstd 165 173 DIRPLT_shadconthovmsfc = hfls|xmean#hfss|xmean 166 174 DIRPLT_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean … … 170 178 #pltshadcont2Dzsec = ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean:ws|pinterp@turb@xmean#hus|pinterp@turb@xmean 171 179 172 PLOTDIFFOP_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean 180 PLOTDIFFOP_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean:tas|tstd#wss|tstd 173 181 PLOTDIFFOP_shadconthovmsfc = uas|xmean#vas|xmean 174 182 PLOTDIFFOP_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean 175 183 176 PLOTDIFFVAR_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean 184 PLOTDIFFVAR_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean:tas|tstd#wss|tstd 177 185 PLOTDIFFVAR_shadconthovmsfc = uas|xmean#vas|xmean 178 186 PLOTDIFFVAR_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean … … 189 197 # [cntformat]: format of the contour labels 190 198 # [colorcnt]: color for the countor lines 191 specificvarplot = cll|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:clh|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:husturbmean|pinterp@turb@xmean|shadcont2Dzsec|0.|1.e-6|Blues|%g|black 192 specificdiffopplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black 193 specificdiffvarplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black 199 specificvarplot = cll|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:clh|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:husturbmean|pinterp@turb@xmean|shadcont2Dzsec|0.|1.e-6|Blues|%g|black:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black 200 specificdiffopplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black 201 specificdiffvarplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black 194 202 195 203 # Figures output kind
Note: See TracChangeset
for help on using the changeset viewer.