Changeset 794
- Timestamp:
- Sep 21, 2012, 5:15:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r793 r794 38 38 getlat = form.getvalue("latitude") 39 39 if getlat == None: getlat = 1 40 41 40 if getlat == "all": islatfree = 1 ; query.lat = -9999. 42 41 else: islatfree = 0 ; query.lat = float(getlat) 42 43 43 getlon = form.getvalue("longitude") 44 44 if getlon == None: getlon = 1 … … 47 47 48 48 getloct = form.getvalue("localtime") 49 50 49 if getloct == None: getloct = 1 51 50 if getloct == "all": isloctfree = 1 ; query.loct = -9999. … … 81 80 # fg: init var as with form values 82 81 if var1 == None: var1="t" 83 if var2 == None: var2="p"82 #if var2 == None: var2="p" 84 83 85 84 vartoplot = [] 86 85 if var1 != "none": vartoplot = np.append(vartoplot,var1) 87 if var2 != "none" : vartoplot = np.append(vartoplot,var2)86 if var2 != "none" and var2 != None: vartoplot = np.append(vartoplot,var2) 88 87 if var3 != "none" and var3 != None: vartoplot = np.append(vartoplot,var3) 89 88 if var4 != "none" and var4 != None: vartoplot = np.append(vartoplot,var4) … … 128 127 129 128 ### figure 130 query. map2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt)131 mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4)132 Image.open("img/temp.png").save(figname,'JPEG') ##lighter images133 ## http://www.pythonware.com/library/pil/handbook/introduction.htm129 query.htmlmap2d(vartoplot,incwind=iswindlog,fixedlt=input_fixedlt,figname=figname) 130 #mpl.savefig("img/temp.png",dpi=110,bbox_inches='tight',pad_inches=0.4) 131 #Image.open("img/temp.png").save(figname,'JPEG') ##lighter images 132 ### http://www.pythonware.com/library/pil/handbook/introduction.htm 134 133 135 134 ## This is quite common … … 147 146 ## Now the part which differs 148 147 if sumfree == 0: query.update() ; query.htmlprinttabextvar(vartoplot) #query.printmeanvar() 149 elif sumfree >= 1: print "< img src='"+figname+"'><br />"148 elif sumfree >= 1: print "<a href='../index.html'>Click here to start a new query</a><br /><img src='"+figname+"'><br />" 150 149 else: print "<h1>ERROR : sumfree is not or badly defined ...</h1></body></html>" 151 150 … … 153 152 ## This is quite common 154 153 bottom = "<hr><a href='../index.html'>Click here to start a new query</a>.<hr></body></html>" 155 print bottom154 #print bottom 156 155 157 156 ##write to file object
Note: See TracChangeset
for help on using the changeset viewer.