From: Arlindo da S. <da...@al...> - 2008-01-14 19:45:59
|
On Jan 4, 2008 10:36 AM, Arlindo da Silva <da...@al...> wrote: > All, > > I just placed a pygrads tarball on http://opengrads.org/pre-rel if you > would like to give it a try. (So far tested on Mac OS X, Mandriva 2008 and > Fedora 7). > I just replaced the tarball with v1.0.7 that includes bug fixes I did over the weekend. I also included ganum_examples.py which exercises the NumPy dependent portion of the package, in particular the EOF calculator and the least square estimator. Another important update is that I redesigned the class that represents a grads field in python. GaField is now a subclass of the numpy.ma.MaskedArrayclass and most of the algebraic operators have been overloaded (some issues with slicing still remains but it is not critical). This greatly simplifies the syntax: ts = ga.exp('ts') # export 'ts' to python ts = ts - 273 # change units in python ga.imp('tc',ts) # put it back into grads as defined variable "tc" You can display it in GrADS: ga("display tc") or with Matplotlib: ga.imshow(ts) The "grid" attribute containing coordinate variables and the like are now fairly hidden. Also, GaField are masked arrays, so it works pretty much as in GrADS v2. One last feature is that the grads object is now "callable", so these 2 are equivalent: ga.cmd("display ts") ga("display ts") I have not update the wiki, but the docstrings should be current. Arlindo -- Arlindo da Silva da...@al... |