Ignore:
Timestamp:
Oct 15, 2012, 2:01:19 AM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON. mcd online. sections lon alt and lat alt. and set 'all' mode for any choice of vertical coordinates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py

    r805 r806  
    5959else:                isloctfree = 0 ; query.loct = float(getloct)
    6060
     61try: query.zkey = int(form.getvalue("zkey"))
     62except: query.zkey = int(3)
     63
    6164query.xz = -9999.
    6265getalt = form.getvalue("altitude")
    6366if getalt == None: getalt = "1"
    64 if getalt == "all":  isaltfree = 1 ; query.xzs = 0. ; query.xze = 120000.
     67if getalt == "all": 
     68    isaltfree = 1
     69    if query.zkey == 2:    query.xzs = -5000.   ; query.xze = 100000.
     70    elif query.zkey == 3:  query.xzs = 0.       ; query.xze = 120000.
     71    elif query.zkey == 5:  query.xzs = -5000.   ; query.xze = 100000.
     72    elif query.zkey == 4:  query.xzs = 1000.    ; query.xze = 0.001
     73    elif query.zkey == 1:  query.xzs = 3396000. ; query.xze = 3596000.
    6574elif ";" in getalt:  isaltfree = 1 ; ind = getalt.find(";") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:])
    6675else:                isaltfree = 0 ; query.xz = float(getalt)
     
    8392try: query.dust = int(form.getvalue("dust"))
    8493except: query.dust  = int(1)
    85 try: query.zkey = int(form.getvalue("zkey"))
    86 except: query.zkey = int(3)
    8794#        self.perturkey = 0  #integer perturkey ! perturbation type (0: none)
    8895#        self.seedin    = 1  #random number generator seed (unused if perturkey=0)
     
    141148
    142149    ### getting data
    143     if islatfree == 1 and islonfree == 1:       query.latlon()   
    144     else:                                       exit() 
    145 
    146     ### figure   
    147     query.htmlmap2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt,figname=figname)
    148     #mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4)
    149     #Image.open("img/temp.png").save(figname,'JPEG') ##lighter images   
    150     ### http://www.pythonware.com/library/pil/handbook/introduction.htm
     150    if islatfree == 1 and islonfree == 1:       
     151        query.htmlmap2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt,figname=figname)
     152        #mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4)
     153        #Image.open("img/temp.png").save(figname,'JPEG') ##lighter images   
     154        ### http://www.pythonware.com/library/pil/handbook/introduction.htm
     155    elif isaltfree == 1 and islonfree == 1:     
     156        query.htmlplot2d(vartoplot,fixedlt=input_fixedlt,figname=figname)
     157    elif isaltfree == 1 and islatfree == 1:     
     158        query.htmlplot2d(vartoplot,fixedlt=input_fixedlt,figname=figname)
     159    else:
     160        exit() 
    151161
    152162## This is quite common
Note: See TracChangeset for help on using the changeset viewer.