PyGrADS

Arlindo da Silva dasilva at ALUM.MIT.EDU
Wed Apr 16 11:59:11 EDT 2008


On Wed, Apr 16, 2008 at 4:42 AM, Maat, Herbert ter <Herbert.termaat at wur.nl>
wrote:

>  Arlindo,
>
> I will get back to you about the documentation when I have returned from
> the US. Will the PyGrADS application change with the release of GrADS2.0 for
> Windows?
>

>>>

The idea is to keep the API unchanged, although some internal tweak may be
necessary. As of now, the basic gacore class works with GrADS v2 with no
change whatsoever. I'd need the IPC extension in order to implement the full
functionality of ganum and galab in a robust way. There are possible
workarounds, but time would be best spent getting some extension
functionality in v2 rather than circumventing it somehow.


>
> >>>
>  The "ga" object has an instance of Basemap attached to it, simply
>
> m = ga.map
> m.drawcountries(...)
>
> This helped me a lot and provided the right tools for me to create the
> graph that I wanted. Thanks. I tried it yesterday with the following
> statement m=ga.basemap but I coul'dn't get the drawcountries handle from
> that.
>
> >>>
>

I really meant "m=ga.map", not "m=ga.basemap". Let me explain. You first use
ga.basemap to instantiate a "Basemap" object:

   ga.basemap(....parameters....)

internally, PyGrADS makes a call to Basemap and saves the handle under
"ga.map". To get this handle,

  m = ga.map
  m.drawcountries()

In retrospect, ga.basemap() should return the Basemap handle, but right now
you need a second step to get this handle. Does it make sense?


>
>  I  don't think that I'am still puzzled about this as I tried to
> do overwrite a value of a keyword (in my case keyword area_thresh). I
> received the following error message. I have a feeling that I can't
> overwrite any keyword that is already a value assigned to.
>
>  [73] ga-> ga.basemap('cyl',resolution='h',area_thresh=1)
> ------------------------------------------------------------
> Traceback (most recent call last):
>   File "<ipython console>", line 1, in <module>
>   File "C:\Python25\lib\site-packages\grads\galab.py", line 116, in
> basemap  projection='cyl', **kwopts)
> <type 'exceptions.TypeError'>: type object got multiple values for keyword
> argument 'area_thresh'
>

This seems to be an issue with Basema() itself, not the galab wrapper. For
example, if you try:

Basemap('cyl',resolution='h',area_thresh=1)

you get the same error message. Perhaps you could report this to the Basemap
mailing list?
However, specifying resolution='f' may give you the desired results as it
defaults to area_tresh=1 km^2.

   Arlindo

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


More information about the gradsusr mailing list