Ignore:
Timestamp:
Jul 4, 2011, 4:21:53 PM (14 years ago)
Author:
aslmd
Message:

MESOSCALE: Python graphics. [sorry for multiple committing]. added a functionality which save actual command line to a *.sh file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/PLOT/PYTHON/scripts/winds.py

    r192 r193  
    227227    if found_lct:     makeplotpng(zeplot,pad_inches_value=0.35)   
    228228    else:             print "Local time not found"
    229 
     229    return zeplot
    230230
    231231
     
    251251    from optparse import OptionParser    ### to be replaced by argparse
    252252    from api_wrapper import api_onelevel
     253
     254    #############################
     255    ### Get options and variables
    253256    parser = OptionParser()
    254257    parser.add_option('-f', action='store', dest='namefile',    type="string",  default=None,  help='[NEEDED] name of WRF file')
     
    268271        exit()
    269272    print "Options:", opt
    270 
    271273    zefile = opt.namefile   
    272274    zelevel = opt.nvert   
    273275    stralt = None
     276
     277    #####################################################
     278    ### Call Fortran routines for vertical interpolations
    274279    if opt.interp is not None:
    275280        if opt.nvert is 0 and opt.interp is 4:  zelevel = 0.010
     
    290295        zelevel = 0 ## so that zelevel could play again the role of nvert
    291296
    292     winds (zefile,int(zelevel),\
     297    #############
     298    ### Main call
     299    name = winds (zefile,int(zelevel),\
    293300           proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb,winds=opt.winds)
     301
     302    #########################################################
     303    ### Generate a .sh file with the used command saved in it
     304    command = ""
     305    for arg in sys.argv: command = command + arg + ' '
     306    f = open(name+'.sh', 'w')
     307    f.write(command)
Note: See TracChangeset for help on using the changeset viewer.