- Timestamp:
- Sep 4, 2016, 10:13:44 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1081 r1082 28 28 # List with the mandatory keys 29 29 mandatorykeys = ['pyHOME', 'cdoHOME', 'scratch', 'filescratch', 'figscratch', \ 30 'diffscratch', 'figdiffscratch', ' addfiles', 'addfigures', 'adddiffs',\31 'add difffigures', 'debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', \32 ' titleoperations', 'kindfig', 'CFreftime', 'CFunitstime', 'mapval',\33 ' timekind', 'timefmt', 'timelabel' ]30 'diffscratch', 'figdiffscratch', 'figallmodexpscratch', 'addfiles', \ 31 'addfigures', 'adddiffs', 'adddifffigures', 'addallmodexpfigures', 'debug', \ 32 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', 'titleoperations', 'kindfig', \ 33 'CFreftime', 'CFunitstime', 'mapval', 'timekind', 'timefmt', 'timelabel' ] 34 34 35 35 # List with the optional keys … … 234 234 addmoddifffigs = False 235 235 236 if config['add modexpfigures'] == 'true':237 add modexpfigs = True236 if config['addallmodexpfigures'] == 'true': 237 addallmodexpfigs = True 238 238 else: 239 add modexpfigs = False239 addallmodexpfigs = False 240 240 241 241 if config['debug'] == 'true': … … 246 246 return scr, filescr, figscr, difscr, figdifscr, moddifscr, figmoddifscr, \ 247 247 figallmodexpscr, addfils, addfigs, adddiffs, adddifffigs, addmoddiffs, \ 248 addmoddifffigs, add modexpfigs, debug248 addmoddifffigs, addallmodexpfigs, debug 249 249 250 250 def exp_headers(mod,config): … … 3474 3474 return 3475 3475 3476 def allmodexps_listconstruct(config, modexps, reprj,odir, debug):3476 def allmodexps_listconstruct(config, modexps, odir, debug): 3477 3477 """ Function to create the list of all model-experiments to draw 3478 3478 config= Configuration of the experiment 3479 3479 modexps= list with the models-experiments pairs to use 3480 reprj= list with whether re-rpojection needs to be done3481 3480 odir= output differences folder 3482 3481 """ … … 3493 3492 ModComProj = cnf['RefProj'].split(':') 3494 3493 3494 allmodexp = {} 3495 Nallmodexp = 0 3495 3496 for modexp in modexps: 3497 if debug: 3498 print " " + fname + ": '" + modexp + "' ..." 3496 3499 mod = modexp.split('/')[0] 3497 3500 exp = modexp.split('/')[1] … … 3502 3505 reproj = not gen.searchInlist(ModComProj,mod) 3503 3506 3504 fvarcomp = 'varcompu et.inf'3507 fvarcomp = 'varcompute.inf' 3505 3508 if reproj: fvc = 'reproj_' + fvarcomp 3506 3509 else: fvc = fvarcomp … … 3508 3511 files, testfiles, allcompvar, Nvar= read_varcomp_file(idir + '/' + fvc) 3509 3512 3510 allmodexp = {}3511 3513 if allplts is not None: 3512 3514 # Getting all model-experiments plots characteristics 3513 3515 3514 Nallmodexp = 03515 3516 for allplt in allplts.keys(): 3517 pltn = allplt.split('_')[1] 3518 if debug and modexp == modexps[0]: 3519 print ' ' + fname + ": plot '" + pltn + "' " 3516 3520 varops = allplts[allplt].split(':') 3517 for v nop in varops:3521 for varop in varops: 3518 3522 vn = varop.split('|')[0] 3519 3523 op = varop.split('|')[1] 3524 vnop = vn + '_' + op 3525 if debug and modexp == modexps[0]: 3526 print ' ' + fname + ": varop '" + vnop + "' " 3520 3527 if not allcompvar.has_key(vnop): 3521 3528 print warnmsg … … 3523 3530 "' in '" + modexp + "' was not computed !!" 3524 3531 print ' skipping it!' 3532 print ' computed values:', allcompvar.keys() 3525 3533 break 3526 3534 … … 3530 3538 if modexp == modexps[0]: 3531 3539 allmodexp[vnop] = [modexp,headerf] 3540 Nallmodexp = Nallmodexp + 1 3532 3541 else: 3533 3542 prevals = allmodexp[vnop] … … 3535 3544 allmodexp[vnop] = prevals 3536 3545 3537 Nallmodexp = Nallmodexp + 13538 3546 else: 3539 3547 Nallmodexp = 0 … … 3774 3782 scratch, filescratch, figscratch, diffscratch, figdiffscratch, moddiffscratch, \ 3775 3783 figmoddiffscratch, figallmodexpscratch, addfiles, addfigures, adddiffs, \ 3776 adddifffigures, addmoddiffs, addmoddifffigures, addallmodex figures, pdbg = \3784 adddifffigures, addmoddiffs, addmoddifffigures, addallmodexpfigures, dbg = \ 3777 3785 scratches(cnf) 3778 3786 … … 4373 4381 dirfigf = owdir + '/allmodexpfigures.inf' 4374 4382 allfigf = owdir+'/all_figures.inf' 4375 if allmodexpfigscratch:4383 if figallmodexpscratch: 4376 4384 sout = sub.call('rm ' + allf + ' >& /dev/null', shell=True) 4377 4385 sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True) … … 4402 4410 if not os.path.isfile(allf): 4403 4411 # Constructing the information of modexp / variable 4404 allmodexpvar, Nallmodexpvar = allmodexps_listconstruct(c onfig, modexps, , odir, debug)4412 allmodexpvar, Nallmodexpvar = allmodexps_listconstruct(cnf, allmodexps, owdir, dbg) 4405 4413 else: 4406 4414 allmodexpvar, Nallmodexpvar = allmodexps_read(allf) 4407 4415 4408 draw_allmodexp_plots(cnf, listplots, owdir, allmodexpvar, 'diffvar', allmodexpfigscratch, dbg)4409 4416 #draw_allmodexp_plots(cnf, listplots, owdir, allmodexpvar, 'diffvar', figallmodexpscratch, dbg) 4417
Note: See TracChangeset
for help on using the changeset viewer.