Changeset 1075 for trunk/UTIL
- Timestamp:
- Oct 18, 2013, 5:24:05 PM (11 years ago)
- Location:
- trunk/UTIL/PYTHON/mcd
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/inimeso/inimeso5.py
r943 r1075 22 22 23 23 ### GET and WRITE SURFACE VALUES 24 query.xz = 0. ; query.update() ; query.printmeanvar()24 query.xz = 0.1 ; query.update() ; query.printmeanvar() 25 25 sounding.write( "%10.2f%12.2f%12.2f\n" % (query.pres/100.,query.temp*(610./query.pres)**(1.0/3.9),0.) ) 26 26 more.write( "%10.2f%10.2f" % (query.extvar[1],query.extvar[14]) ) ; more.close() 27 27 28 28 ### GET and WRITE VERTICAL PROFILE 29 query.profile( tabperso = np.append([0 ,5,10,20,50,100],np.linspace(200.,float(split(lines[4])[0])*1000.,float(split(lines[5])[0]))) )29 query.profile( tabperso = np.append([0.1,5,10,20,50,100],np.linspace(200.,float(split(lines[4])[0])*1000.,float(split(lines[5])[0]))) ) 30 30 for iz in range(len(query.prestab)): 31 31 sounding.write( "%10.2f%12.2f%12.2f%12.2f%12.2f\n" % ( \ -
trunk/UTIL/PYTHON/mcd/inimeso/input_coord
r943 r1075 1 353.87lon2 -1. 88lat3 244. ls4 0 6. lct5 2 0ztop1 173.0 lon 2 -1.0 lat 3 120. ls 4 05. lct 5 25 ztop 6 6 100. nz -
trunk/UTIL/PYTHON/mcd/mcd.py
r971 r1075 28 28 self.name = "MCD v4.3" 29 29 self.ack = "Mars Climate Database (c) LMD/OU/IAA/ESA/CNES" 30 self.dset = '/home/aymeric/Science/MCD_v4.3/data/'31 #self.dset = '/home/marshttp/MCD_v4.3/data/'30 #self.dset = '/home/aymeric/Science/MCD_v4.3/data/' 31 self.dset = '/home/marshttp/MCD_v4.3/data/' 32 32 ## 1. spatio-temporal coordinates 33 33 self.lat = 0. … … 82 82 self.max2d = None 83 83 self.dpi = 80. 84 self.islog = False 84 85 85 86 def toversion5(self): … … 231 232 if "(K)" in dastuff: self.fmt="%.0f" 232 233 elif "effective radius" in dastuff: self.fmt="%.2e" 233 elif "(Pa)" in dastuff: self.fmt="%. 1f"234 elif "(Pa)" in dastuff: self.fmt="%.2e" 234 235 elif "(W/m2)" in dastuff: self.fmt="%.0f" 235 236 elif "(m/s)" in dastuff: self.fmt="%.1f" … … 472 473 if "(mol/mol)" in fieldlab or "(kg/kg)" in fieldlab or "(kg/m2)" in fieldlab or "(W/m2)" in fieldlab: 473 474 ind = np.where(field < 1.e-30) 474 if ind != -1: field[ind] = 1.e-30 ## 0 does not work everywhere.475 if ind != -1: field[ind] = 0.e0 #1.e-30 ## 0 does not work everywhere. 475 476 return field,fieldlab 476 477 … … 603 604 else: ordo = self.xcoord ; absc = field ; absclab = fieldlab ; ordolab = self.xlabel 604 605 mpl.plot(absc,ordo,'-bo') ; mpl.ylabel(ordolab) ; mpl.xlabel(absclab) #; mpl.xticks(query.xcoord) 606 # cases with log axis 605 607 if self.zkey == 4: mpl.semilogy() ; ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1]) 608 if not self.vertplot and self.islog: mpl.semilogy() 609 if self.vertplot and self.islog: mpl.semilogx() 606 610 mpl.figtext(0.5, 0.01, self.ack, ha='center') 607 611 … … 633 637 choice = tabtodo[i] 634 638 (field, fieldlab) = self.definefield(choice) 639 640 # in log plots we do not show the negative values 641 if self.islog: field[np.where(field <= 0.e0)] = np.nan 642 635 643 if not self.vertplot: absc = self.xcoord ; ordo = field ; ordolab = fieldlab ; absclab = self.xlabel 636 644 else: ordo = self.xcoord ; absc = field ; absclab = fieldlab ; ordolab = self.xlabel 645 637 646 yeah.plot(absc,ordo,'-bo') #; mpl.xticks(query.xcoord) 638 647 ax = fig.gca() ; ax.set_ylabel(ordolab) ; ax.set_xlabel(absclab) 639 648 640 649 if self.xzs is not None and self.zkey == 4: ax.set_yscale('log') ; ax.set_ylim(ax.get_ylim()[::-1]) 650 if not self.vertplot and self.islog: ax.set_yscale('log') 651 if self.vertplot and self.islog: ax.set_xscale('log') 641 652 642 653 if self.lats is not None: ax.set_xticks(np.arange(-90,91,15)) ; ax.set_xbound(lower=self.lats, upper=self.late) -
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r971 r1075 145 145 if badrange: 146 146 errormess = errormess+"<li>One or several coordinate intervals are not... intervals. Set either a real range or an unique value." 147 if query.xdate == 666.: 148 errormess = "<li>CONGRATULATIONS! <br><img src='../surprise.jpg'><br> You reached secret mode.<br> You can <a href='http://www.youtube.com/watch?v=fTpQOZcNASw'>watch a nice video</a>." 147 149 148 150 # Get how many free dimensions we have … … 196 198 else: query.zonmean=False 197 199 200 islog = form.getvalue("islog") 201 if islog == "on": query.islog=True 202 else: query.islog=False 203 198 204 ### now, proceed... 199 205 if errormess == "": 200 206 201 207 # reference name (to test which figures are already in the database) 202 try: reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm+str(query.min2d)+str(query.max2d)+str(query.dpi) 208 try: reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm+str(query.min2d)+str(query.max2d)+str(query.dpi)+str(islog) 203 209 except: reference = "test" 204 210 if yeaheps: figname = '../img/'+reference+'.eps' -
trunk/UTIL/PYTHON/mcd/proto/index4.html
r971 r1075 286 286 <input type="radio" name="zonmean" value="on" /> on 287 287 </li> 288 <li>Log(values) in 1D plots 289 <input type="radio" name="islog" value="off" checked /> off 290 <input type="radio" name="islog" value="on" /> on 291 </li> 288 292 </ul> 289 293 </td> … … 303 307 <a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br /> 304 308 Interface written by <a href="http://www.lmd.jussieu.fr/~aslmd/">A. Spiga</a> (LMD) using <a href="http://www.python.org">Python</a>.<br /> 309 Javascript time conversion by <a href="http://www.lmd.jussieu.fr/~emlmd">E. Millour</a> (<a href="http://www-mars.lmd.jussieu.fr/mars/time/martian_time.html">link</a>). 305 310 </td> 306 311 </tr> -
trunk/UTIL/PYTHON/mcd/proto/index5.html
r1074 r1075 389 389 <input type="radio" name="zonmean" value="on" /> on 390 390 </li> 391 <li>Log(values) in 1D plots 392 <input type="radio" name="islog" value="off" checked /> off 393 <input type="radio" name="islog" value="on" /> on 394 </li> 391 395 </ul> 392 396 </td> … … 406 410 <a href="http://www-mars.lmd.jussieu.fr">Mars Climate Database</a> (c) LMD/OU/IAA/ESA/CNES.<br /> 407 411 Interface written by <a href="http://www.lmd.jussieu.fr/~aslmd/">A. Spiga</a> (LMD) using Python.<br /> 412 Javascript time conversion by <a href="http://www.lmd.jussieu.fr/~emlmd">E. Millour</a> (<a href="http://www-mars.lmd.jussieu.fr/mars/time/martian_time.html">link</a>). 408 413 </td> 409 414 </tr>
Note: See TracChangeset
for help on using the changeset viewer.