Changeset 1029 in lmdz_wrf
- Timestamp:
- Aug 17, 2016, 1:10:00 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/tools/model_graphics.py ¶
r1026 r1029 125 125 for headerf in ftests.keys(): 126 126 filen=ftests[headerf] 127 vmod, vdiag = ncvar.computevar_model(var, idir + '/' + filen) 127 try: 128 with gen.Capturing() as output: 129 vmod, vdiag = ncvar.computevar_model(var, idir + '/' + filen) 130 except: 131 print 'ncvar.computevar_model(' + var + ', ' + idir + '/' + filen + ')' 132 for sout in output: print sout 133 quit(-1) 128 134 129 135 if vmod is None and vdiag is None: … … 298 304 globalP = pinterp_var(op) 299 305 if vcomp.model is not None: 300 Smodel = ':'.join(vcomp.model) 306 if type(vcomp.model) == type(list([1, 2])): 307 Smodel = ':'.join(vcomp.model) 308 elif type(vcomp.model) == type('A'): 309 Smodel = vcomp.model 301 310 else: 302 311 Smodel = 'None' 303 312 if vcomp.diag is not None: 304 Sdiag = ':'.join(vcomp.diag) 313 if type(vcomp.diag) == type(list([1, 2])): 314 Sdiag = ':'.join(vcomp.diag) 315 elif type(vcomp.diag) == type('A'): 316 Sdiag = vcomp.diag 305 317 else: 306 318 Sdiag = 'None' … … 1227 1239 fvarS = ','.join(vplot) 1228 1240 1229 plotins = "python "+pyH+"/drawing.py -f "+figfs+" -o draw_2D_shad_cont "+\ 1230 "-S '" + graphvals + "' -v " + fvarS 1241 drwins = 'draw_2D_shad_cont' 1242 plotins = "python " + pyH + "/drawing.py -f " + figfs + " -o " + drwins +\ 1243 " -S '" + graphvals + "' -v " + fvarS 1231 1244 try: 1232 1245 with gen.Capturing() as output: 1233 1246 sout0 = sub.call(plotins, shell=True) 1234 1247 except: 1235 print 'drawing.draw_2D_shad_cont(' + graphvals + ',' + figfs + ',' + \ 1236 fvarS + ')' 1248 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1237 1249 print sout0 1238 1250 for sout in output: print sout … … 1292 1304 sout0 = sub.call(plotins, shell=True) 1293 1305 except: 1294 print 'draw_2D_shad_cont_time(' + graphvals + ',' + figfs + ',' + \ 1295 fvarS + ')' 1306 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1307 print sout0 1308 for sout in output: print sout 1309 quit(-1) 1310 1311 sout = sub.call('mv 2Dfields_shadow-contour.'+kfig+' '+finame, shell=True) 1312 1313 # keeping all figures 1314 trkobjf.write('\n') 1315 trkobjf.write("#" + tfig.replace('!',' ') + '\n') 1316 trkobjf.write(plotins + '\n') 1317 1318 elif 'shadcont2Dzsec': 1319 figtit = tfig.replace('!','|') 1320 shdstdn = CFvplot[0] 1321 cntstdn = CFvplot[1] 1322 figfs = ','.join(fplot) 1323 1324 shad = pplot[0] 1325 srange = str(shad[0]) + ',' + str(shad[1]) 1326 cbar = shad[2] 1327 cnt = pplot[1] 1328 crange = str(cnt[0]) + ',' + str(cnt[1]) 1329 cfmt = cnt[3] 1330 cline = cnt[4] 1331 1332 # It is assumed that if the space variable is 'lon': is desired a 1333 # (lon, pres) plot it it is 'lat': then (pres, lat) plot 1334 if gen.searchInlist(dplot, 'lon'): 1335 spacedim='lon' 1336 figmid = 'long.|vert.|cross|sec.|of' 1337 figtit = '|'.join(tfig.split('!')[0:2]) + '|' + figmid + '|' + \ 1338 '|'.join(tfig.split('!')[2:]) 1339 dims= spacedim+'|-1,pres|-1:'+spacedim+'|-1,pres|-1:'+spacedim+':pres' 1340 else: 1341 spacedim='lat' 1342 figmid = 'mer.|vert.|cross|sec.|of' 1343 figtit = '|'.join(tfig.split('!')[0:2]) + '|' + figmid + '|' + \ 1344 '|'.join(tfig.split('!')[2:]) 1345 # NOT WORKING? dims= spacedim+'|-1,pres|-1:'+spacedim+'|-1,pres|-1:'+'pres:'+spacedim 1346 dims= spacedim+'|-1,pres|-1:'+spacedim+'|-1,pres|-1:'+spacedim+':pres' 1347 1348 reverse = 'flip@y' 1349 1350 graphvals = ','.join(CFvplot) 1351 graphvals = graphvals + ':' + dims + ':' + cbar + ':fixc,' + cline + \ 1352 ':' + cfmt + ':' + srange + ':' + crange + ',9:' + figtit + ':' + \ 1353 kfig + ':' + reverse + ':None' 1354 1355 fvarS = ','.join(vplot) 1356 1357 drwins = 'draw_2D_shad_cont' 1358 plotins = 'python ' + pyH + '/drawing.py -f ' + figfs + ' -o ' + drwins + \ 1359 " -S '" + graphvals + "' -v " + fvarS 1360 try: 1361 with gen.Capturing() as output: 1362 sout0 = sub.call(plotins, shell=True) 1363 except: 1364 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1296 1365 print sout0 1297 1366 for sout in output: print sout … … 1443 1512 gP = pinterpS(globalP) 1444 1513 1445 filen = vn + '_' + headf + gP + '_' + op + '.nc'1514 filen = vn + '_' + headf + gP + '_' + op.replace('+','_') + '.nc' 1446 1515 filesplot.append(filen) 1447 1516 # Do we have processed the given variable? -
TabularUnified trunk/tools/model_graphics_template.dat ¶
r1026 r1029 112 112 # Text as title for each operation 113 113 # as ':' separated list of [op]|[explanation '!' as spaces] 114 titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|p ressure!interpolation:tmean|temporal!mean:turb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum114 titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|pinterp:tmean|tmean:turb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum 115 115 116 116 # Pressure levels … … 139 139 DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last:wss|last#tas|last 140 140 DIRPLT_shadconthovmsfc = wss|xmean#tas|xmean 141 #DIRPLT_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean:hus|pinterp+tmean+xmean#ta|pinterp+tmean+xmean141 DIRPLT_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean:hus|pinterp+tmean+xmean#ta|pinterp+tmean+xmean 142 142 143 143 #pltshadcont2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last
Note: See TracChangeset
for help on using the changeset viewer.