Changeset 723 for trunk/UTIL/PYTHON/mcd


Ignore:
Timestamp:
Jul 16, 2012, 5:49:10 PM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON : added seasonal and wind capability to MCD python interface. updated READMEs for LMD insiders.

Location:
trunk/UTIL/PYTHON/mcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/mcd.py

    r653 r723  
    247247      for i in range(nd): self.xz = self.xcoord[i] ; self.update() ; self.put1d(i)
    248248
     249    def seasonal(self,nd=12,start=0.,end=360.):
     250    ### retrieve a seasonal slice
     251      self.xlabel = "Areocentric longitude (degrees)"
     252      self.prepare(ndx=nd) ; self.xcoord = np.linspace(start,end,nd)
     253      for i in range(nd): self.xdate = self.xcoord[i] ; self.update() ; self.put1d(i)
     254
    249255    def latlon(self,ndx=37,startx=-180.,endx=180.,ndy=19,starty=-90.,endy=90.):
    250256    ### retrieve a latitude/longitude slice
     
    283289      self.extvartab[i,j,1:100] = self.extvar[0:99] ## note: var numbering according to MCD manual is kept
    284290
    285     def makemap2d(self,choice):
     291    def makemap2d(self,choice,incwind=False):
    286292    ### one 2D map is created for the user-defined variable in choice.
     293      self.latlon() ## a map is implicitely a lat-lon plot. otherwise it is a plot (cf. makeplot2d)
    287294      (field, fieldlab) = self.definefield(choice)
    288       myplot.maplatlon(self.xcoord,self.ycoord,field,title=fieldlab,proj="moll")
    289 
    290     def map2d(self,tabtodo):
     295      if incwind:
     296          (windx, fieldlabwx) = self.definefield("u")
     297          (windy, fieldlabwy) = self.definefield("v")
     298          myplot.maplatlon(self.xcoord,self.ycoord,field,title=fieldlab,proj="cyl",vecx=windx,vecy=windy)
     299      else:
     300          myplot.maplatlon(self.xcoord,self.ycoord,field,title=fieldlab,proj="moll")
     301
     302    def map2d(self,tabtodo,incwind=False):
    291303    ### complete 2D figure with possible multiplots
    292304      if isinstance(tabtodo,np.str): tabtodo=[tabtodo] ## so that asking one element without [] is possible.
    293305      if isinstance(tabtodo,np.int): tabtodo=[tabtodo] ## so that asking one element without [] is possible.
    294306      fig = mpl.figure() ; subv,subh = myplot.definesubplot( len(tabtodo) , fig )
    295       for i in range(len(tabtodo)): mpl.subplot(subv,subh,i+1) ; self.makemap2d(tabtodo[i])
     307      for i in range(len(tabtodo)): mpl.subplot(subv,subh,i+1) ; self.makemap2d(tabtodo[i],incwind=incwind)
    296308
    297309    ### TODO: makeplot2d, plot2d, passer plot settings, vecteurs, plot loct pas fixe
  • trunk/UTIL/PYTHON/mcd/proto/index.html

    r639 r723  
    5151<li>Altitude   
    5252<input type="radio" name="isaltfree" value="0" checked> Value: <input type="text" size="2" name="altitude" value="10.">
    53 <input type="radio" name="isaltfree" value="1"> All [0 ; 100000] km
     53<input type="radio" name="isaltfree" value="1"> All [0 ; 100000] m
    5454</li>
    5555</ul>
Note: See TracChangeset for help on using the changeset viewer.