Changeset 723


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/README.INSTALL

    r446 r723  
     1###########################
    12############ README.INSTALL
     3###########################
     4
    25This README describes the required steps to install the python distribution and packages necessary to run the graphical routines.
    36
     
    4245Step 4/- Read the README.PP ;)
    4346------------------------------
     47
     48NB: To use the movie capability, you will have to install mencoder.
     49NB: To use advance interpolation methods for GCM and mesoscale files, you will have to compile fortran routines with f2py (or compile those independently).
     50
     51###########################
     52############ README.INSTALL.LMD
     53###########################
     54
     55If you work on LMD or IPSL computers, you don't necessarily need to install EPD.
     56
     57[NB: You don't necessarily need to download pp.py sources either but in case
     58you would like to try modifications of the code please use the command
     59   svn co http://svn.lmd.jussieu.fr/Planeto/trunk/UTIL/PYTHON
     60and change PYTHONPATH accordingly in the lines given in what follows]
     61
     62-------------------------
     63account on lmd.jussieu.fr
     64-------------------------
     65
     66A. Spiga installed on his account a version of EPD.
     67--> Add the following lines to your env_pers.ksh, then source the file. You're OK!
     68--> (ask for an installation of mencoder if you'd like to use movie capabilities)
     69
     70#####################################
     71if [ `uname` = 'Linux' ] ;then
     72  if [ `uname -m` = 'x86_64' ] ;then
     73  PATH="/donnees/aslmd/PY/epd-7.0-2-rh3-x86_64/bin/:$PATH"
     74  else
     75  PATH="/donnees/aslmd/PY/epd-7.0-2-rh5-x86/bin/:$PATH"
     76  fi
     77fi
     78PYTHONPATH=/donnees/aslmd/MODELES/UTIL/PYTHON/
     79export PYTHONPATH
     80PATH=$PYTHONPATH:$PATH
     81#####################################
     82
     83---------------------------------
     84account on ciclad.ipsl.jussieu.fr
     85---------------------------------
     86
     87P. Weill installed on the system a version of EPD (and mencoder for movie capabilities)
     88--> Just add the following lines to your .bashrc, then source the file. You're OK!
     89
     90######################################
     91PATH="/opt/epd-7.1-1/bin/:$PATH"
     92PYTHONPATH=/home/spiga/MODELES/UTIL/PYTHON/
     93export PYTHONPATH
     94PATH=$PYTHONPATH:$PATH
     95######################################
     96
     97-----------------------------------------------------------
     98-----------------------------------------------------------
     99-----------------------------------------------------------
     100-----------------------------------------------------------
     101Authors : A. Colaitis and A. Spiga
     102
  • trunk/UTIL/PYTHON/README.PP

    r518 r723  
    1111**************************************
    1212**************************************
     13
     14The program pp.py works on virtually any NETCDF file.
     15If not, please contact us, it is usually an easy fix to make it work.
    1316
    1417************************************
  • 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.