Changeset 1082 in lmdz_wrf for trunk


Ignore:
Timestamp:
Sep 4, 2016, 10:13:44 PM (9 years ago)
Author:
lfita
Message:

Getting more there for the all model-experiments figures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.py

    r1081 r1082  
    2828    # List with the mandatory keys
    2929    mandatorykeys = ['pyHOME', 'cdoHOME', 'scratch', 'filescratch', 'figscratch',    \
    30       'diffscratch', 'figdiffscratch', 'addfiles', 'addfigures', 'adddiffs',         \
    31       'adddifffigures', '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' ]
    3434
    3535    # List with the optional keys
     
    234234            addmoddifffigs = False
    235235
    236         if config['addmodexpfigures'] == 'true':
    237             addmodexpfigs = True
     236        if config['addallmodexpfigures'] == 'true':
     237            addallmodexpfigs = True
    238238        else:
    239             addmodexpfigs = False
     239            addallmodexpfigs = False
    240240
    241241    if config['debug'] == 'true':
     
    246246    return scr, filescr, figscr, difscr, figdifscr, moddifscr, figmoddifscr,         \
    247247      figallmodexpscr, addfils, addfigs, adddiffs, adddifffigs, addmoddiffs,         \
    248       addmoddifffigs, addmodexpfigs, debug
     248      addmoddifffigs, addallmodexpfigs, debug
    249249
    250250def exp_headers(mod,config):
     
    34743474    return
    34753475
    3476 def allmodexps_listconstruct(config, modexps, reprj, odir, debug):
     3476def allmodexps_listconstruct(config, modexps, odir, debug):
    34773477    """ Function to create the list of all model-experiments to draw
    34783478      config= Configuration of the experiment
    34793479      modexps= list with the models-experiments pairs to use
    3480       reprj= list with whether re-rpojection needs to be done
    34813480      odir= output differences folder
    34823481    """
     
    34933492    ModComProj = cnf['RefProj'].split(':')
    34943493
     3494    allmodexp = {}
     3495    Nallmodexp = 0
    34953496    for modexp in modexps:
     3497        if debug:
     3498            print "    " +  fname + ": '" + modexp + "' ..."
    34963499        mod = modexp.split('/')[0]
    34973500        exp = modexp.split('/')[1]
     
    35023505        reproj = not gen.searchInlist(ModComProj,mod)
    35033506
    3504         fvarcomp = 'varcompuet.inf'
     3507        fvarcomp = 'varcompute.inf'
    35053508        if reproj: fvc = 'reproj_' + fvarcomp
    35063509        else: fvc = fvarcomp
     
    35083511        files, testfiles, allcompvar, Nvar= read_varcomp_file(idir + '/' + fvc)
    35093512
    3510         allmodexp = {}
    35113513        if allplts is not None:
    35123514            # Getting all model-experiments plots characteristics
    35133515
    3514             Nallmodexp = 0
    35153516            for allplt in allplts.keys():
     3517                pltn = allplt.split('_')[1]
     3518                if debug and modexp == modexps[0]:
     3519                    print '    ' + fname + ":      plot '" + pltn + "' "
    35163520                varops = allplts[allplt].split(':')
    3517                 for vnop in varops:
     3521                for varop in varops:
    35183522                    vn = varop.split('|')[0]
    35193523                    op = varop.split('|')[1]
     3524                    vnop = vn + '_' + op
     3525                    if debug and modexp == modexps[0]:
     3526                        print '    ' + fname + ":        varop '" + vnop + "' "
    35203527                    if not allcompvar.has_key(vnop):
    35213528                        print warnmsg
     
    35233530                          "' in '" + modexp + "' was not computed !!"
    35243531                        print '    skipping it!'
     3532                        print '    computed values:', allcompvar.keys()
    35253533                        break
    35263534
     
    35303538                    if modexp == modexps[0]:
    35313539                        allmodexp[vnop] = [modexp,headerf]
     3540                        Nallmodexp = Nallmodexp + 1
    35323541                    else:
    35333542                        prevals = allmodexp[vnop]
     
    35353544                        allmodexp[vnop] = prevals
    35363545
    3537                 Nallmodexp = Nallmodexp + 1
    35383546        else:
    35393547            Nallmodexp = 0
     
    37743782scratch, filescratch, figscratch, diffscratch, figdiffscratch, moddiffscratch,       \
    37753783  figmoddiffscratch, figallmodexpscratch, addfiles, addfigures, adddiffs,            \
    3776   adddifffigures, addmoddiffs, addmoddifffigures, addallmodexfigures, pdbg =         \
     3784  adddifffigures, addmoddiffs, addmoddifffigures, addallmodexpfigures, dbg =         \
    37773785  scratches(cnf)
    37783786
     
    43734381dirfigf = owdir + '/allmodexpfigures.inf'
    43744382allfigf = owdir+'/all_figures.inf'
    4375 if allmodexpfigscratch:
     4383if figallmodexpscratch:
    43764384    sout = sub.call('rm ' + allf + ' >& /dev/null', shell=True)
    43774385    sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True)
     
    44024410if not os.path.isfile(allf):
    44034411    # Constructing the information of modexp / variable
    4404     allmodexpvar, Nallmodexpvar = allmodexps_listconstruct(config, modexps, , odir, debug)
     4412    allmodexpvar, Nallmodexpvar = allmodexps_listconstruct(cnf, allmodexps, owdir, dbg)
    44054413else:
    44064414    allmodexpvar, Nallmodexpvar = allmodexps_read(allf)
    44074415
    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.