![]() |
back to the research page |
It installs python executables and libraries in /usr/local/# tar -zxvf python-2.2.2.tar.gz # cd python-2.2.2 # ./configure && make && make install
# tar -zxvf Numeric-23.0.tar.gz # cd Numeric-23.0 # python setup.py install
# tar -zxvf ScientificPython-2.4.1.tar.gz # cd ScientificPython-2.4.1 # python setup.py build # python setup.py install
# tar -zxvf PyClimate-1.2.tar.gz # cd PyClimate-1.2 # python setup.py install
First install f2py using the usual commands:# tar -zxvf F2PY-2-latest.tar.gz # cd F2PY-2.35.229-1505 # python setup.py installThen unpack the pywavelet archive and go to its directory# tar -zxvf pywavelet-0.1.tar.gz # cd pywavelet-0.1and build the pywavelet shared object using:# f2py -m pywavelet -c cfftpack.f chisqr.f wavelet.f pywavelet.fYou should get a pywavelet.so file, that you must copy to /usr/local/lib/python2.2/site-packages. Read the README file in the pywavelet-0.1/ directory to know more on how to use it ...
# date2indOLR.py 8 1 1991returns 8066, i.e. the 8 of January 1991 is the 8066th day in the daily OLR dataset ...# date2indNCEP_4 18 1 12 1991returns 18872, i.e the 1 of December 1991 at 18h UTC is the 18872th time-step in the 6-hourly NCEP/DOE II reanalysis dataset
You can use it directly from GRADS using variables, take a look at this sample grads script
# first import the necessary modulesimport array import Numeric as N# then open the file for read in binary mode and read it into a python array of floatsfile=open('gradsfile','rb') a=array.array('f',file.read())# if the file has been created on a big endian machine and your on a little endian (or the reverse) ; do :var=N.fromstring(a,N.Float32).byteswapped()# else (big endian to big endian or little endian to little endian):var=N.fromstring(a,N.Float32) file.close()
wgrib xgrads xgribmap xgribscan xgxps xgxtran xstnmap
# ln -s /usr/local/bin/xgrads /usr/local/bin/grads # ln -s /usr/local/bin/xgrads /usr/local/bin/gradsnc # ln -s /usr/local/bin/xgxps /usr/local/bin/gxps
udunits.dat goes to /usr/local/udunits/etc/font0.dat font1.dat font2.dat font3.dat font4.dat font5.dat hires lowres mres udunits.dat
# mkdir /usr/local/udunits/ # mkdir /usr/local/udunits/etc # cp udunits.dat /usr/local/udunits/etc/.
# mkdir /usr/local/lib/grads/ # cp font* *res /usr/local/lib/grads/.
lats4d is the shell-script : it must go somewhere in your path (e.g. $HOME/bin).lats4d lats4d.gs lats4d.man
|
|
|