PYGRADS anyone?

Arlindo da Silva dasilva at ALUM.MIT.EDU
Thu Nov 27 02:35:43 EST 2008


On Wed, Nov 26, 2008 at 12:22 PM, Kevin M Levey <klevey at customweather.com>wrote:

> WED 26NOV08: 0915PST
>
> Dear GRADS users
>
> I was wondering if anyone in the GRADS community has or is using
> Arlindo da Silva's PYGRADS on a regular basis? I hate to bug poor
> Arlindo all the time, but I would be keen to get some feedback from
> those using PYGRADS to generate plots, not interactively, but using
> grads scripts run in batch mode from shell scripts. I have no problem
> creating images (with blue marble backgrounds) etc interactively, but
> I would like some guidance as to how to convert my existing GRADS GS
> scripts and run these form the command line in batch mode. There is no
> information regarding this on the current PYGRADS WIKI pages that
> Arlindo has set up.
>


Some clarification. I've been using the term "pygrads" to mean 2 related but
different things. First, *pygrads* is the name of the package. This package
includes the python *grads* module, as well as the command line utility
*pygrads*, which is a customization of the interpreter *ipython* given it a
bit of a grads look and feel; the utility *pygrads* is generally used for
interactive work. Although you could write scripts to be run under ipython,
I myself tend not to do so, using instead the module *grads* inside a
regular python script.

The module *grads* can be imported like any other python module. However, in
order to write such scripts you need some familiarity with the python
language itself. Take a look at the references I listed in section 4 of the
wiki:


http://opengrads.org/wiki/index.php?title=Python_Interface_to_GrADS#Additional_References

In particular, this wikibook:

    http://en.wikibooks.org/wiki/Programming:Python

For an example of a python script using the *grads* module  take a look at
this recipe:

http://cookbooks.opengrads.org/index.php?title=Recipe-003:_Using_PyGrADS_to_save_variable_data_to_a_text_file


> The reason for wanting to use this version of GRADS is that I would
> prefer to create plots with the blue marble basemap all within the
> same script, and not have to use imagemagick to merge GRADS plots with
> pre-existing topo basemaps.
>
> Anyone who has mastered PYGRADS etc, and who is willing to give me a
> few pointers, I'd appreciate the tips and help!
>

Let me know if you have questions.

   Arlindo

--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20081127/51a125af/attachment.html 


More information about the gradsusr mailing list