Changeset 811 for trunk/UTIL/PYTHON/mcd/proto
- Timestamp:
- Oct 20, 2012, 11:45:11 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r807 r811 43 43 if getlat == "all": islatfree = 1 ; query.lats = -90. ; query.late = 90. 44 44 elif ";" in getlat: islatfree = 1 ; ind = getlat.find(";") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:]) 45 elif "," in getlat: islatfree = 1 ; ind = getlat.find(",") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:]) 46 elif "/" in getlat: islatfree = 1 ; ind = getlat.find("/") ; query.lats = float(getlat[:ind]) ; query.late = float(getlat[ind+1:]) 45 47 else: islatfree = 0 ; query.lat = float(getlat) 46 48 … … 50 52 if getlon == "all": islonfree = 1 ; query.lons = -180. ; query.lone = 180. 51 53 elif ";" in getlon: islonfree = 1 ; ind = getlon.find(";") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:]) 54 elif "," in getlon: islonfree = 1 ; ind = getlon.find(",") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:]) 55 elif "/" in getlon: islonfree = 1 ; ind = getlon.find("/") ; query.lons = float(getlon[:ind]) ; query.lone = float(getlon[ind+1:]) 52 56 else: islonfree = 0 ; query.lon = float(getlon) 53 57 … … 57 61 if getloct == "all": isloctfree = 1 ; query.locts = 0. ; query.locte = 24. 58 62 elif ";" in getloct: isloctfree = 1 ; ind = getloct.find(";") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:]) 63 elif "," in getloct: isloctfree = 1 ; ind = getloct.find(",") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:]) 64 elif "/" in getloct: isloctfree = 1 ; ind = getloct.find("/") ; query.locts = float(getloct[:ind]) ; query.locte = float(getloct[ind+1:]) 59 65 else: isloctfree = 0 ; query.loct = float(getloct) 60 66 … … 73 79 elif query.zkey == 1: query.xzs = 3396000. ; query.xze = 3596000. 74 80 elif ";" in getalt: isaltfree = 1 ; ind = getalt.find(";") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:]) 81 elif "," in getalt: isaltfree = 1 ; ind = getalt.find(",") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:]) 82 elif "/" in getalt: isaltfree = 1 ; ind = getalt.find("/") ; query.xzs = float(getalt[:ind]) ; query.xze = float(getalt[ind+1:]) 75 83 else: isaltfree = 0 ; query.xz = float(getalt) 76 84 … … 124 132 reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt) 125 133 figname = '../img/'+reference+'.png' 134 txtname = '../txt/'+reference 126 135 testexist = daos.path.isfile(figname) 127 136 … … 133 142 134 143 ### getting data 135 if isloctfree == 1: query.diurnal(nd=24) 144 if isloctfree == 1: query.diurnal(nd=24) 136 145 elif islonfree == 1: query.zonal() 137 146 elif islatfree == 1: query.meridional() … … 140 149 141 150 ### generic building of figure 151 query.getascii(vartoplot,filename=txtname) 142 152 query.htmlplot1d(vartoplot,figname=figname) 143 153 #mpl.savefig("img/temp.png",dpi=85,bbox_inches='tight',pad_inches=0.25) … … 178 188 ## Now the part which differs 179 189 if sumfree == 0: query.update() ; query.htmlprinttabextvar(vartoplot) #query.printmeanvar() 180 elif sumfree >= 1: print "<img src='"+figname+"'><br />" 190 elif sumfree == 2: print "<img src='"+figname+"'><br />" 191 elif sumfree == 1: 192 print "<a href='"+txtname+"'>Click here to download an ASCII file containing data</a><br />" 193 print "<img src='"+figname+"'><br />" 181 194 else: print "<h1>ERROR : sumfree is not or badly defined ...</h1></body></html>" 182 195
Note: See TracChangeset
for help on using the changeset viewer.