Jose Gomez-Dans wrote:
> Jeff, thanks for your comment
>
> 2009/3/2 Jeff Whitaker <jsw...@fastmail.fm <mailto:jsw...@fastmail.fm>>
>
>
>     Jose: I think the key is to only create the basemap instance only
>     once (for the main plot and for the inset), then re-use that
>     basemap instance each time you create an animation frame. 
>
>
> That helps in memory consumption, and that's something I looked into. 
> However, my basemap instances are defined (in the case of the inset) as:
>  m2 = Basemap(projection='ortho',lon_0=6,lat_0=-12,ax=ax2)
> Actually, they both have references to axes. The bit I don't really 
> understand is how to define my basemap only once and then just "hang 
> it" from some axes.

Jose:  You can create the Basemap instance once, and then pass the axes 
with the ax keyword whenever you call a basemap method.
>
> Additionally, I am warping a fairly large image (not shown in my 
> example), so that it takes quite a long time to process. This is only 
> seldom updated, so I could just save the background and overlay on it 
> my data. As I see it, even if I recycle the basemap instance, I'd 
> still have to go through the process of warping my image, extracting 
> coastlines, etc. It would be faster to just save it, and recreate it 
> whenever it is necessary. I don't really know how to do this.

The image is only warped the first time you call the bluemarble method 
for a given basemap instance.  Subsequent calls used the cached image.
>
> I have changed my code by shamelessly copying from your previous 
> advice ;p (see <http://pastebin.com/f4eaedd7>). Things improve a bit, 
> but my parllels/meridians are not aligned with the map. Clearly I'm 
> still missing something!

I don't have time right now to look at that code, I'll try to play with 
it tomorrow.

-Jeff
>
> Many thanks for your help,
> Jose
>


-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : jeffrey.s.whita...@noaa.gov
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to