Changeset 805
- Timestamp:
- Oct 15, 2012, 12:00:39 AM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/mcd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/mcd/inimeso.py
r653 r805 36 36 ### FINISH 37 37 sounding.close() ; additional.close() 38 query.plot1d(["p","t","u","v"] ,vertplot=1) ; mpl.show()38 query.plot1d(["p","t","u","v"]) ; mpl.show() -
trunk/UTIL/PYTHON/mcd/mcd.py
r800 r805 93 93 self.getdustlabel() 94 94 self.title = self.name + " with " + self.dustlabel + "." 95 if self.lats is None: self.title = self.title + " Latitude " + str(self.lat) + "E" 96 if self.lons is None: self.title = self.title + " Longitude " + str(self.lon) + "N" 97 if self.xzs is None: 98 self.vertunits() 99 self.title = self.title + " Altitude " + str(self.xz) + " " + self.vunits 100 if self.locts is None: self.title = self.title + " Local time " + str(self.loct) + "h" 95 101 96 102 def getextvarlab(self,num): … … 231 237 print "Zonal wind = %5.3f meters per second." % (self.zonwind) 232 238 print "Meridional wind = %5.3f meters per second." % (self.merwind) 239 print "Total horizontal wind = %5.3f meters per second." % ( np.sqrt(self.zonwind**2 + self.merwind**2) ) 233 240 234 241 def printextvar(self,num): … … 311 318 elif self.zkey == 5: self.xlabel = "altitude above mean Mars Radius(=3396000m) (m)" 312 319 320 def vertunits(self): 321 if self.zkey == 1: self.vunits = "m CP" 322 elif self.zkey == 2: self.vunits = "m AMR" 323 elif self.zkey == 3: self.vunits = "m ALS" 324 elif self.zkey == 4: self.vunits = "Pa" 325 elif self.zkey == 5: self.vunits = "m AMMRad" 326 313 327 ################### 314 328 ### 1D analysis ### … … 326 340 def diurnal(self,nd=13): 327 341 ### retrieve a local time slice 342 save = self.loct 328 343 self.xlabel = "Local time (Martian hour)" 329 344 self.prepare(ndx=nd) ; self.ininterv(0.,24.,nd,start=self.locts,end=self.locte) 330 345 for i in range(nd): self.loct = self.xcoord[i] ; self.update() ; self.put1d(i) 346 self.loct = save 331 347 332 348 def zonal(self,nd=37): 333 349 ### retrieve a longitude slice 350 save = self.lon 334 351 self.xlabel = "East longitude (degrees)" 335 352 self.prepare(ndx=nd) ; self.ininterv(-180.,180.,nd,start=self.lons,end=self.lone) 336 353 for i in range(nd): self.lon = self.xcoord[i] ; self.update() ; self.put1d(i) 354 self.lon = save 337 355 338 356 def meridional(self,nd=19): 339 357 ### retrieve a latitude slice 358 save = self.lat 340 359 self.xlabel = "North latitude (degrees)" 341 360 self.prepare(ndx=nd) ; self.ininterv(-90.,90.,nd,start=self.lats,end=self.late) 342 361 for i in range(nd): self.lat = self.xcoord[i] ; self.update() ; self.put1d(i) 362 self.lat = save 343 363 344 364 def profile(self,nd=20,tabperso=None): 345 365 ### retrieve an altitude slice (profile) 366 save = self.xz 346 367 self.vertlabel() 347 368 self.vertplot = True … … 351 372 if tabperso is not None: self.xcoord = tabperso 352 373 for i in range(nd): self.xz = self.xcoord[i] ; self.update() ; self.put1d(i) 374 self.xz = save 353 375 354 376 def seasonal(self,nd=12): 355 377 ### retrieve a seasonal slice 378 save = self.xdate 356 379 self.xlabel = "Areocentric longitude (degrees)" 357 380 self.prepare(ndx=nd) ; self.ininterv(0.,360.,nd,start=self.xdates,end=self.xdatee) 358 381 for i in range(nd): self.xdate = self.xcoord[i] ; self.update() ; self.put1d(i) 382 self.xdate = save 359 383 360 384 def makeplot1d(self,choice): … … 407 431 ### retrieve a latitude/longitude slice 408 432 ### default is: local time is not fixed. user-defined local time is at longitude 0. 433 save1 = self.lon ; save2 = self.lat ; save3 = self.loct 409 434 self.xlabel = "East longitude (degrees)" ; self.ylabel = "North latitude (degrees)" 410 435 self.prepare(ndx=ndx,ndy=ndy) … … 415 440 for j in range(ndy): 416 441 self.lon = self.xcoord[i] ; self.lat = self.ycoord[j] 417 if not fixedlt: self.loct = (umst + self.lon/15.) % 24 442 if not fixedlt: 443 if self.lons is not None and self.lone is not None: self.loct = (umst + (self.lons+self.lone)/30.) % 24 444 else: self.loct = (umst + self.lon/15.) % 24 418 445 self.update() ; self.put2d(i,j) 419 446 if not fixedlt: self.loct = umst 447 self.lon = save1 ; self.lat = save2 ; self.loct = save3 420 448 421 449 def put2d(self,i,j): … … 503 531 # contour field 504 532 c = yeah.contourf( x, y, what_I_plot, zelevels, cmap = palette, alpha = trans ) 505 Figure.colorbar(fig,c,orientation='vertical',format="%.1e") 533 clb = Figure.colorbar(fig,c,orientation='vertical',format="%.1e") 534 clb.set_label(fieldlab) 506 535 ax = fig.gca() ; ax.set_title(fieldlab) ; ax.set_ylabel("Latitude") ; ax.set_xlabel("Longitude") 507 536 ax.set_xticks(np.arange(-180,181,45)) ; ax.set_xbound(lower=self.lons, upper=self.lone) -
trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py
r800 r805 69 69 if sumfree > 2: exit() ## only 1D or 2D plots for the moment 70 70 71 try: query.xdate = float(form.getvalue("ls")) 72 except: query.xdate = float(1) 71 try: query.datekey = int(form.getvalue("datekeyhtml")) 72 except: query.datekey = float(1) 73 if query.datekey == 1: 74 try: query.xdate = float(form.getvalue("ls")) 75 except: query.xdate = float(1) 76 else: 77 try: query.xdate = float(form.getvalue("julian")) 78 except: query.xdate = float(1) 79 query.loct = 0. 80 73 81 try: query.hrkey = int(form.getvalue("hrkey")) 74 82 except: query.hrkey = int(1) … … 156 164 #print "<br />" 157 165 166 print "<a href='../index.html'>Click here to start a new query</a><br />" 167 158 168 ## Now the part which differs 159 169 if sumfree == 0: query.update() ; query.htmlprinttabextvar(vartoplot) #query.printmeanvar() 160 elif sumfree >= 1: print "< a href='../index.html'>Click here to start a new query</a><br /><img src='"+figname+"'><br />"170 elif sumfree >= 1: print "<img src='"+figname+"'><br />" 161 171 else: print "<h1>ERROR : sumfree is not or badly defined ...</h1></body></html>" 162 172 -
trunk/UTIL/PYTHON/mcd/proto/index.html
r797 r805 50 50 </td> 51 51 <td align="center"> 52 <b>CUSTOMIZE EARTH TIME</b><br /> 53 Year / Month / Day @ hh:mm:ss [UTC]<br /> 52 <input type="radio" name="datekeyhtml" value="1" checked> 53 <b><font color="red">MARS date</font></b> 54 Solar longitude <input type="text" size="3" name="ls"> degrees<br /> 55 Local Time <input type="text" size="4" name="localtime" value="0."> Martian hour<br /> 56 <input type="radio" name="datekeyhtml" value="0"> 57 <b><font color="blue">EARTH date</font></b> 58 YY / MM / DD @ hh:mm:ss<br /> 54 59 <input type="text" size="3" name="year"> / <input type="text" size="1" name="month"> / <input type="text" size="1" name="day"> @ 55 <input type="text" size="1" name="hours">:<input type="text" size="1" name="minutes">:<input type="text" size="1" name="seconds"> <br />56 <input type="button" value="SAVE CHANGES" onClick="Convert2Ls();" style="font-weight:bold"><br />60 <input type="text" size="1" name="hours">:<input type="text" size="1" name="minutes">:<input type="text" size="1" name="seconds"> 61 UTC<br /> 57 62 </td> 58 63 <td align="center"> 59 64 Earth Julian Date <input type="text" size="6" name="julian" readonly="readonly"><br /> 60 Martian year <input type="text" size="1" name="martianyear" readonly="readonly"> <br /> 61 Martian month <input type="text" size="1" name="martianmonth" readonly="readonly"> / 12<br /> 62 Martian sol <input type="text" size="2" name="sol" readonly="readonly"> / 669 65 Martian year <input type="text" size="1" name="martianyear" readonly="readonly"> 66 month <input type="text" size="1" name="martianmonth" readonly="readonly"> / 12 <br /> 67 Martian sol <input type="text" size="2" name="sol" readonly="readonly"> / 669<br /> 68 <input type="button" value="EARTH DATE >>> MARS DATE" onClick="Convert2Ls();"><br /> 63 69 </td> 64 70 </tr> … … 98 104 write a value (or) a range val1;val2 (or) 'all'<br /> 99 105 <ul> 100 <li>Latitude <input type="text" size="7" name="latitude" value="0."> degree North 106 <li>Latitude <input type="text" size="7" name="latitude" value="0."> degree North 101 107 <li>Longitude <input type="text" size="7" name="longitude" value="0."> degree East 102 <li>Local Time <input type="text" size="7" name="localtime" value="0."> Martian hour103 108 <li>Altitude <input type="text" size="9" name="altitude" value="10."> <select name="zkey"> 104 109 <option value="1" >m (O: Mars center)</option> … … 131 136 <!--[Advanced settings for well-informed Martians]<br />--> 132 137 <ul> 133 <li>Force Mars solar longitude to be <input type="text" size="3" name="ls"> degrees</li>134 138 <li>High resolution topography? <input type="radio" name="hrkey" value="1" checked /> Yes <input type="radio" name="hrkey" value="0" /> No </li> 135 139 <li>Dust scenario? <select name="dust">
Note: See TracChangeset
for help on using the changeset viewer.