- Timestamp:
- Aug 21, 2016, 10:06:35 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1036 r1039 20 20 warnmsg = ncvar.warnmsg 21 21 22 def verify_configuration(ExpConf, debug): 23 """ Function to verify mandatory keys from experiment configuration 24 ExpConf= dictionary with the configuration 25 """ 26 fname = 'verify_configuration' 27 28 # List with the mandatory keys 29 mandatorykeys = ['pyHOME', 'cdoHOME', 'scratch', 'filescratch', 'figscratch', \ 30 'diffscratch', 'figdiffscratch', 'addfiles', 'addfigures', 'adddiffs', \ 31 'debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', 'titleoperations', \ 32 'kindfig', 'CFreftime', 'CFunitstime', 'mapval', 'timekind', 'timefmt', \ 33 'timelabel' ] 34 35 # List with the optional keys 36 optionalkeys = ['specificvarplot', 'specificdiffopplot', 'specificdiffvarplot'] 37 38 # Dictionary with the mandatory keys which are required as function of a given value from the dictionary 39 ifkeys = {'WRFexps': ['models','WRF'], 'LMDZexps': ['models','LMDZ'], \ 40 'WRF_LMDZexps': ['models','WRF_LMDZ'], 'WRFheaders': ['models','WRF'], \ 41 'WRF_LMDZheaders': ['models','WRF_LMDZ'], 'LMDZheaders': ['models','LMDZ']} 42 43 for kdict in mandatorykeys: 44 if not ExpConf.has_key(kdict): 45 print errmsg 46 print ' ' + fname + "' configuration without required '" + kdict + "' !!" 47 quit(-1) 48 if debug: 49 print ExpConf[kdict] 50 51 for kdict in ifkeys.keys(): 52 vals = ifkeys[kdict] 53 keyn = vals[0] 54 keyv = vals[1] 55 if type(ExpConf[keyn]) == type('A'): 56 if not ExpConf.has_key(kdict) and ExpConf[keyn] == keyv: 57 print errmsg 58 print ' ' + fname + "' configuration without '" + kdict + \ 59 "' when it is required with configuration '" + keyn + '=' + keyv + \ 60 "' !!" 61 quit(-1) 62 elif type(ExpConf[keyn]) == type(['A', 'B']): 63 keyvals = ExpConf[keyn] 64 if not ExpConf.has_key(kdict) and gen.searchInlist(keyvals, keyv): 65 print errmsg 66 print ' ' + fname + "' configuration without '" + kdict + \ 67 "' when it is required with configuration '" + keyn + '= [..., ' + \ 68 keyv + ", ...]' !!" 69 quit(-1) 70 else: 71 print errmsg 72 print ' ' +fname+ 'dictionary type ', type(ExpConf[keyn]), ' not ready!!' 73 quit(-1) 74 if debug: 75 print ExpConf[kdict] 76 77 print fname + ': configuration seems to be fine' 78 79 return 80 22 81 def scratches(config): 23 82 """ Function to set-up if it is needed to start from the scratch … … 34 93 figscr = True 35 94 difscr = True 95 figdifscr = True 36 96 tim.sleep(10) 37 97 else: … … 64 124 difscr = False 65 125 126 if config['figdiffscratch'] == 'true': 127 figdifscr = True 128 print warnmsg 129 print " " + main + ": figures differences starting from the SCRATCH !!" 130 print " 5 seconds left!!" 131 tim.sleep(5) 132 else: 133 figdifscr = False 134 66 135 if config['addfiles'] == 'true': 67 136 addfils = True … … 84 153 debug = False 85 154 86 return scr, filescr, figscr, difscr, addfils, addfigs, adddiffs, debug155 return scr, filescr, figscr, difscr, figdifscr, addfils, addfigs, adddiffs, debug 87 156 88 157 def exp_headers(mod,config): … … 144 213 vmod, vdiag = ncvar.computevar_model(var, idir + '/' + filen) 145 214 except: 215 print errmsg 146 216 print 'ncvar.computevar_model(' + var + ', ' + idir + '/' + filen + ')' 147 217 for sout in output: print sout … … 516 586 shell=True) 517 587 except: 588 print errmsg 518 589 print 'python ' + pyH + '/diagnostics.py ' + values 519 590 for sout in output: print sout … … 541 612 ncvar.fvaradd(idir+'/'+cf+','+rqv,ifilen) 542 613 except: 614 print errmsg 543 615 print 'fvaradd('+idir+'/'+cf+','+rqv+','+ifilen+')' 544 616 for sout in output: print sout … … 566 638 SgP+'_,-,.nc', 'all') 567 639 except: 640 print errmsg 568 641 print 'netcdf_fold_concatenation_HMT(./time, '+CFvarn+'_'+headerf+SgP+ \ 569 642 '_,-,.nc, all)' … … 739 812 ncvar.DataSetSection(vals,prevfile) 740 813 except: 814 print errmsg 741 815 print 'DataSetSection('+vals+',', prevfile, ')' 742 816 for sout in output: print sout … … 784 858 ncvar.pinterp(vals,prevfile,vninF) 785 859 except: 860 print errmsg 786 861 print 'pinterp('+vals+',', prevfile, ','+vninF+')' 787 862 for sout in output: print sout … … 818 893 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 819 894 except: 895 print errmsg 820 896 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 821 897 for sout in output: print sout … … 863 939 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 864 940 except: 941 print errmsg 865 942 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 866 943 for sout in output: print sout … … 890 967 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 891 968 except: 969 print errmsg 892 970 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 893 971 for sout in output: print sout … … 940 1018 varinfile = ncvar.ivars(fileon) 941 1019 except: 1020 print errmsg 942 1021 print 'ivars('+fileon+')' 943 1022 for sout in output: print sout … … 952 1031 ncvar.fvaradd(prevfile+','+CFvn, fileon) 953 1032 except: 1033 print errmsg 954 1034 print 'fvaradd(', prevfile, ','+CFvn+','+fileon+')' 955 1035 for sout in output: print sout … … 964 1044 oclean = ncvar.cleaning_varsfile(totalvarkeeps,fileon) 965 1045 except: 1046 print errmsg 966 1047 print 'cleaning_varsfile('+totalvarkeeps+','+fileon+')' 967 1048 for sout in output: print sout … … 1103 1184 return doplots, plotsvar, indivplotsvar, varplotp 1104 1185 1105 def plots_listconstruct(config, odir, debug):1186 def plots_listconstruct(config, pkind, finf, odir, debug): 1106 1187 """ Function to create the list of plots to draw 1107 1188 config= Configuration of the experiment 1189 pkind= kind of plots ('DIRPLT', 'DIFFPLT') 1190 finf= file with the instructions of the plots 1108 1191 odir= output experiment folder 1109 1192 """ 1110 1193 fname='plots_listconstruct' 1111 1194 1112 dirplot = gen.get_specdictionary_HMT(config, H= 'DIRPLT_')1195 dirplot = gen.get_specdictionary_HMT(config, H=pkind+'_') 1113 1196 1114 1197 if debug: 1115 print ' direct plots to draw ________'1198 print " '" + pkind + "' plots to draw ________" 1116 1199 gen.printing_dictionary(dirplot) 1117 1200 1118 1201 # Getting plots by variable 1119 plots, varplot, indivarplot, plotp = get_plots_var(dirplot, 'DIRPLT_',debug)1202 plots, varplot, indivarplot, plotp = get_plots_var(dirplot, pkind+'_', debug) 1120 1203 1121 1204 Svarplot = gen.dictKeysVals_stringList(plots,cV=':') … … 1126 1209 1127 1210 # Outwritting the varcompute to avoid next time (if it is not filescratch!) 1128 objf = open( odir + '/directplotsdraw.inf', 'w')1211 objf = open(finf, 'w') 1129 1212 objf.write('plots: ' + Svarplot + '\n') 1130 1213 objf.write('itotp: ' + str(Nplots) + '\n') … … 1272 1355 sout0 = sub.call(plotins, shell=True) 1273 1356 except: 1357 print errmsg 1274 1358 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1275 1359 print sout0 … … 1330 1414 sout0 = sub.call(plotins, shell=True) 1331 1415 except: 1416 print errmsg 1332 1417 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1333 print sout01334 1418 for sout in output: print sout 1335 1419 quit(-1) … … 1388 1472 sout0 = sub.call(plotins, shell=True) 1389 1473 except: 1474 print errmsg 1390 1475 print drwins + '(' + graphvals + ',' + figfs + ',' + fvarS + ')' 1391 print sout01392 1476 for sout in output: print sout 1393 1477 quit(-1) … … 1461 1545 1462 1546 # Dictionary of plot specificities 1463 # [minval]: minimum value 1464 # [maxval]: minimum value 1465 # [colorbar]: name of the colorbar (from matplotlib) to use 1466 # [cntformat]: format of the contour labels 1467 # [colorcnt]: color for the countor lines 1547 specplotkeyn = 'specificvarplot' 1468 1548 plotspecifics = {} 1469 plotspecs = config['specificvarplot'].split(':') 1470 for pltspc in plotspecs: 1471 pltvls = pltspc.split('|') 1472 vn = pltvls[0] 1473 op = pltvls[1] 1474 fn = pltvls[2] 1475 plotspecifics[fn + '_' + vn + '_' + op] = pltvls[3:] 1476 if debug: 1477 print 'Specific values for plots _______' 1478 gen.printing_dictionary(plotspecifics) 1549 if config.has_key(specplotkeyn): 1550 # [minval]: minimum value 1551 # [maxval]: minimum value 1552 # [colorbar]: name of the colorbar (from matplotlib) to use 1553 # [cntformat]: format of the contour labels 1554 # [colorcnt]: color for the countor lines 1555 plotspecs = config[specplotkeyn].split(':') 1556 for pltspc in plotspecs: 1557 pltvls = pltspc.split('|') 1558 vn = pltvls[0] 1559 op = pltvls[1] 1560 fn = pltvls[2] 1561 plotspecifics[fn + '_' + vn + '_' + op] = pltvls[3:] 1562 if debug: 1563 print 'Specific values for plots _______' 1564 gen.printing_dictionary(plotspecifics) 1479 1565 1480 1566 # Kind of figures … … 1556 1642 dims = ncvar.idims(filen) 1557 1643 except: 1644 print errmsg 1558 1645 print 'ncvar.idims('+filen+')' 1559 1646 for sout in output: print sout … … 1934 2021 # CF dimension-variables name 1935 2022 OpersS = '+'.join(Opers) 1936 if OpersS.find('pinterp') != -1 :2023 if OpersS.find('pinterp') != -1 or filen.find('pinterp') != -1: 1937 2024 varnCFs = ['lon', 'lat', 'pres', 'time'] 1938 2025 else: … … 2009 2096 ncvar.DataSetSection(vals,prevfile) 2010 2097 except: 2098 print errmsg 2011 2099 print 'DataSetSection('+vals+',', prevfile, ')' 2012 2100 for sout in output: print sout … … 2057 2145 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 2058 2146 except: 2147 print errmsg 2059 2148 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 2060 2149 for sout in output: print sout … … 2102 2191 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 2103 2192 except: 2193 print errmsg 2104 2194 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 2105 2195 for sout in output: print sout … … 2129 2219 ncvar.file_oper_alongdims(vals,prevfile,CFvarnp) 2130 2220 except: 2221 print errmsg 2131 2222 print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')' 2132 2223 for sout in output: print sout … … 2179 2270 varinfile = ncvar.ivars(fileon) 2180 2271 except: 2272 print errmsg 2181 2273 print 'ivars('+fileon+')' 2182 2274 for sout in output: print sout … … 2191 2283 ncvar.fvaradd(prevfile+','+CFvn, fileon) 2192 2284 except: 2285 print errmsg 2193 2286 print 'fvaradd(', prevfile, ','+CFvn+','+fileon+')' 2194 2287 for sout in output: print sout … … 2203 2296 oclean = ncvar.cleaning_varsfile(totalvarkeeps,fileon) 2204 2297 except: 2298 print errmsg 2205 2299 print 'cleaning_varsfile('+totalvarkeeps+','+fileon+')' 2206 2300 for sout in output: print sout … … 2332 2426 return 2333 2427 2428 2429 def draw_diff_plots(config, plots, odir, allvarcomp, kdiff, figscr, debug): 2430 """ Function to draw all plots 2431 config= Configuration of the experiment 2432 plots= dictionary with the plots 2433 odir= output experiment folder 2434 allvarcomp= dictionary with all the variables to compute and their information 2435 kdiff= kind of differences: 2436 'diffop': plots from operation differences 2437 'diffvar': plots from variable differences 2438 figscr= whether figures should be done from the scratch or not 2439 2440 * Plot as 2441 {[kplot]} = [varn1]|[op1]#[varn2]|[op2]#[...[varnN]|[opN]], ... 2442 [kplot] ___ 2443 diffmap2Dsfc: 2D map of surface differences values of 1 variable 2444 diffmap2Dz: 2D map of 3D differences values of 1 variable 2445 map2Dsfc: 2D map of surface values of 1 variable 2446 map3D: 2D map of 3D values of 1 variable 2447 shadconthovmsfc: Hovmoeller diagrams of 2 variable at the surface in shadow and the other in contourn 2448 shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2] 2449 shadcont2Dzsec: 2D map of vertical section of 2 variables one in shadow and the other in contourn 2450 [varn] 2451 variable 2452 [op] 2453 '+' separated list of operations 2454 in figures with more than 1 variable, use '#' to separate the [varn]|[op] 2455 """ 2456 fname = 'draw_diff_plots' 2457 2458 os.chdir(odir) 2459 2460 # Dictionary with the operations with surnames for the operated variable 2461 opersurnames = {} 2462 opsur = gen.get_specdictionary_HMT(config, H='opsur_',M='',T='') 2463 for opsr in opsur.keys(): 2464 opn = opsr.split('_')[1] 2465 vls = opsur[opsr].split(':') 2466 opersurnames[opn] = vls 2467 2468 # time values 2469 # Units time for the plots 2470 rd = config['CFreftime'] 2471 tunits = config['CFunitstime'] + '!since!' + rd[0:4] + '-' + rd[4:6] + '-' + \ 2472 rd[6:8] + '!' + rd[8:10] + ':' + rd[10:12] + ':' + rd[12:14] 2473 # time ticks kind 2474 tkind = config['timekind'] 2475 # time ticks format 2476 tfmt = config['timefmt'] 2477 # time axis label 2478 tlab = config['timelabel'] 2479 timevals = [tunits, tkind, tfmt, tlab] 2480 2481 if kdiff == 'diffop': 2482 specplotkeyn = 'specificdiffopplot' 2483 elif kdiff == 'diffvar': 2484 specplotkeyn = 'specificdiffvarplot' 2485 else: 2486 print errmsg 2487 print ' ' + fname + ": differences kind '" + kdiff + "' not ready !!" 2488 quit(-1) 2489 2490 # Dictionary of plot specificities 2491 plotspecifics = {} 2492 if config.has_key(specplotkeyn): 2493 # [minval]: minimum value 2494 # [maxval]: minimum value 2495 # [colorbar]: name of the colorbar (from matplotlib) to use 2496 # [cntformat]: format of the contour labels 2497 # [colorcnt]: color for the countor lines 2498 plotspecs = config[specplotkeyn].split(':') 2499 for pltspc in plotspecs: 2500 pltvls = pltspc.split('|') 2501 vn = pltvls[0] 2502 op = pltvls[1] 2503 fn = pltvls[2] 2504 plotspecifics[fn + '_' + vn + '_' + op] = pltvls[3:] 2505 if debug: 2506 print 'Specific values for plots _______' 2507 gen.printing_dictionary(plotspecifics) 2508 2509 # Kind of figures 2510 kindfigure = config['kindfig'] 2511 2512 # Map value 2513 mapvalue = config['mapval'] 2514 2515 # pythone scripts HOME 2516 pyHOME = config['pyHOME'] 2517 2518 # Title-text of operations 2519 opexplained = {} 2520 optits = config['titleoperations'].split(':') 2521 for optit in optits: 2522 opn = optit.split('|')[0] 2523 opt = optit.split('|')[1] 2524 opexplained[opn] = opt 2525 if debug: 2526 print 'Titles for operations _______' 2527 gen.printing_dictionary(opexplained) 2528 2529 for kplot in plots.keys(): 2530 varsplt = plots[kplot] 2531 for varplt in varsplt: 2532 if debug: 2533 print " printing '" + kplot + "' var ':" + varplt + "'..." 2534 varops = varplt.split('#') 2535 2536 # CF variables in plot 2537 CFvarsplot = [] 2538 # Files in plot 2539 filesplot = [] 2540 # Variables in plot within the files 2541 varsplot = [] 2542 # Dims in figure 2543 dimsplot = [] 2544 # pictoric values in figure 2545 pictplot = [] 2546 # Name of the figure 2547 figname = '' 2548 # Title of the figure 2549 titfigure = '' 2550 2551 ivp = 0 2552 for varop in varops: 2553 vn = varop.split('|')[0] 2554 op = varop.split('|')[1] 2555 2556 # CF variables in plot 2557 CFvarsplot.append(vn) 2558 2559 vnopS = vn + '_' + op 2560 if not allvarcomp.has_key(vnopS): 2561 print errmsg 2562 print ' ' + fname + ": no file for variable-operation '" + \ 2563 vnopS + "' !!" 2564 vopvals = allvarcomp[vnopS] 2565 mod1 = vopvals[0] 2566 mod2 = vopvals[1] 2567 mod3 = vopvals[2] 2568 mod4 = vopvals[3] 2569 headf = vopvals[4] 2570 2571 modexpdiff = mod2 + '/' + exp2 + ' - ' + mod1 + '/' + exp1 2572 modexpdiffS = mod2 + '-' + exp2 + '_' + mod1 + '-' + exp1 2573 2574 difffilen = odir + '/' + vn + '_' + kdiff + '_' + modexpdiffS + \ 2575 '_' + op.replace('+','_') + '.nc' 2576 2577 filesplot.append(difffilen) 2578 # Do we have processed the given difference? 2579 if not os.path.isfile(difffilen): 2580 print warnmsg 2581 print " " + fname + ": there is no file for '" + kdiff + \ 2582 "' difference '" + varop + "' skiping it !!" 2583 break 2584 2585 # Name of the variable inside the file 2586 vnsur = varnoper(vn, op, opersurnames) 2587 varsplot.append(vnsur) 2588 2589 # Dimensions in file 2590 try: 2591 with gen.Capturing() as output: 2592 dims = ncvar.idims(difffilen) 2593 except: 2594 print errmsg 2595 print 'ncvar.idims('+difffilen+')' 2596 for sout in output: print sout 2597 quit(-1) 2598 2599 dimsplot.append(dims) 2600 2601 # pictoric values for the figure 2602 Sfivaop = kplot + '_' + vn + '_' + op 2603 if plotspecifics.has_key(Sfivaop): 2604 pictvals = plotspecifics[Sfivaop] 2605 else: 2606 Vvals = gen.variables_values(vn) 2607 pictvals = [Vvals[2], Vvals[3], Vvals[6], '%g', 'black'] 2608 2609 pictplot.append(pictvals) 2610 2611 # Header of the name of the figure 2612 if ivp == 0: 2613 figname = kplot + '_' + vn + '_' + kdiff + '_' + modexpdiffS + \ 2614 '_' + op.replace('+','-') 2615 else: 2616 figname = figname + '-' + vn + '_' + op.replace('+','-') 2617 2618 # Title of the figure: 2619 if mod1 == mod2: 2620 modexptit = mod1 + '!' + exp2 + '-' + exp1 2621 else: 2622 modexptit = modexpdiff 2623 2624 if ivp == 0: 2625 titfigure = modexptit + "!" + kdiff + "!'" + vn + "'" 2626 vnS = vn 2627 else: 2628 titfigure = titfigure + "!&!'" + vn + "'" 2629 vnS = vnS + '!&!' + vn 2630 2631 opvals = op.split('+') 2632 for op1 in opvals: 2633 if not opexplained.has_key(op1): 2634 print errormsg 2635 print ' '+fname+": no explanation for operation '"+op1+"' !!" 2636 print ' provided:', opexplained.keys() 2637 quit(-1) 2638 if op1 == opvals[0]: 2639 titfigure = titfigure + '$_{[' + opexplained[op1] 2640 if len(opvals) == 1: titfigure = titfigure + ']}$' 2641 elif op1 == opvals[len(opvals)-1]: 2642 titfigure = titfigure + '\!' + opexplained[op1] + ']}$' 2643 else: 2644 titfigure = titfigure + '\!' + opexplained[op1] 2645 2646 ivp = ivp + 1 2647 # End of variable-operation 2648 figname = figname + '.' + kindfigure 2649 2650 if len(titfigure) > 80: 2651 print warnmsg 2652 print ' ' + fname + ": figure title '" + titfigure.replace('!', ' ')+\ 2653 "' larger than 80 characters (actually", len(titfigure), ') !!' 2654 print " simplifying it to '" + modexptit.replace('!',' ') + '!' + \ 2655 kdiff + '!' + vnS + "'" 2656 titfigure = modexptit.replace(' ','!') + '!' + kdiff + '!' + vnS 2657 2658 draw_plot(kplot, CFvarsplot, filesplot, varsplot, dimsplot, pictplot, \ 2659 figname, titfigure, kindfigure, mapvalue, timevals, odir, pyHOME, \ 2660 figscr, debug) 2661 2662 # End of variables-operations 2663 2664 # End of kind of plots 2665 2666 return 2667 2334 2668 # Files with information about the configuration of the script 2335 2669 inffiles = ['varcompute.inf', 'all_computevars.inf', 'all_statsvars.inf'] … … 2342 2676 cnf = gen.get_configuration('model_graphics.dat', False) 2343 2677 2678 verify_configuration(cnf, gen.Str_Bool(cnf['debug'])) 2679 2344 2680 # scratches 2345 scratch, filescratch, figscratch, diffscratch, addfiles, addfigures, adddiffs, dbg = scratches(cnf) 2681 scratch, filescratch, figscratch, diffscratch, figdiffscratch, addfiles, addfigures, \ 2682 adddiffs, dbg = scratches(cnf) 2346 2683 2347 2684 # Getting models … … 2483 2820 2484 2821 if not os.path.isfile(dirfigf): 2485 listplots, Nplt = plots_listconstruct(cnf, owdir, dbg)2822 listplots, Nplt = plots_listconstruct(cnf, 'DIRPLT', dirfigf, owdir, dbg) 2486 2823 else: 2487 2824 print warnmsg … … 2519 2856 for exp1 in exps[0:Nexps-1]: 2520 2857 for exp2 in exps[1:Nexps]: 2521 print ' ' + exp2 + '-' + exp1 + '...' 2858 Sexps = exp2 + '-' + exp1 2859 print ' ' + Sexps + '...' 2522 2860 owdir = cnf['ofold'] + '/' + mod + '/' + exp2 + '-' + exp1 2523 2861 sout = sub.call('mkdir -p ' + owdir, shell=True) … … 2534 2872 objf.close() 2535 2873 difff = owdir + '/all_vardiffstatistics.inf' 2536 sub.call('rm ' + +' >& /dev/null', shell=True)2874 sub.call('rm ' + difff +' >& /dev/null', shell=True) 2537 2875 objf = open(owdir+'/all_' + fdiff,'w') 2538 2876 objf.write("## Computation of all differences statistics " + \ … … 2572 2910 compute_var_diffs(cnf, alldiffvar, owdir, diffscratch, dbg) 2573 2911 2912 # Plotting operation differences 2913 ## 2914 print " " + main + ": Plotting operation differences' figures ..." 2915 dirfigf = owdir + '/diffopplotsdraw.inf' 2916 if figscratch: 2917 sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True) 2918 2919 objf = open(owdir+'/all_diffopfigures.inf','w') 2920 objf.write("## Drawing of all operation difference figures \n") 2921 objf.close() 2922 2923 if addfigures: 2924 sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True) 2925 2926 if not os.path.isfile(dirfigf): 2927 listplots, Nplt = plots_listconstruct(cnf, 'PLOTDIFFOP', dirfigf, owdir, \ 2928 dbg) 2929 else: 2930 print warnmsg 2931 print ' ' + main + ": getting plots to draw already from file !!" 2932 listplots, Nplt = read_plot_file(dirfigf) 2933 2934 # End of avoiding to repeat all the plots search 2935 2936 print " For experiment 'operation' differences '" + Sexps + "' is " + \ 2937 "required to plot:" , Nplt, "plots" 2938 2939 if dbg: 2940 print 'Plots to draw _______' 2941 gen.printing_dictionary(listplots) 2942 2943 draw_diff_plots(cnf, listplots, owdir, alldiffop, 'diffop', figdiffscratch, \ 2944 dbg) 2945 draw_diff_plots(cnf, listplots, owdir, alldiffvar, 'diffvar', figdiffscratch,\ 2946 dbg) 2947 2574 2948 quit() 2575 2949 # end of mods loop -
trunk/tools/model_graphics_template.dat
r1032 r1039 32 32 diffscratch = false 33 33 34 # Scratch difference figures: should be any figures previous work removed and start from the scratch? 35 figdiffscratch = false 36 34 37 # Have new files been added and do they need to be processed? 35 38 addfiles = false … … 42 45 43 46 # Debug 44 debug = true47 debug = false 45 48 46 49 # Folder with the files … … 160 163 161 164 DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last 162 DIRPLT_shadconthovmsfc = hfls|xmean#hfss| last165 DIRPLT_shadconthovmsfc = hfls|xmean#hfss|xmean 163 166 DIRPLT_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean 164 167 … … 167 170 #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 168 171 169 pltdiffshadcont2Dsfc = tas|tmean#wss|tmean:wss|last#tas|last 170 pltdiffshadconthovmsfc = wss|xmean#tas|xmean 171 pltdiffshadcont2Dzsec = ua|pinterp@last@xmean#va|pinterp@last@xmean 172 PLOTDIFFOP_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean 173 PLOTDIFFOP_shadconthovmsfc = uas|xmean#vas|xmean 174 PLOTDIFFOP_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean 175 176 PLOTDIFFVAR_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean 177 PLOTDIFFVAR_shadconthovmsfc = uas|xmean#vas|xmean 178 PLOTDIFFVAR_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean 172 179 173 180 # Specific variable-statistisc graphic parameters (if no value is given, they will be retrieved from 'variables_values.dat') … … 183 190 # [colorcnt]: color for the countor lines 184 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 185 diffspecificvarplot = tas|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:wss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:tas|last|shadcont2Dsfc|-20.|20.|seismic|%g|black:wss|last|shadcont2Dsfc|-30.|30.|seismic|%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 186 194 187 195 # Figures output kind
Note: See TracChangeset
for help on using the changeset viewer.