Changeset 805 for trunk/UTIL/PYTHON/mcd/mcd.py
- Timestamp:
- Oct 15, 2012, 12:00:39 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.