[SciPy-User] matplotlib and large array

Christopher Barker Chris.Barker at noaa.gov
Wed Jun 9 22:34:56 EDT 2010


David Baddeley wrote:
> I ended up coding up my own, wxpython based, viewer 

Us too (and when I say "us" I mean Dan Helfman wrote all the code). Ours 
is specifically designed for geo-referenced data, raster and vector 
(using GDAL for the reading). It uses wxPython for the GUI, and OpenGL 
for fast rendering. It's essentially a toolkit for building custom 
interactive data viewer/manipulators

When it brings in a large image, it pyramids and tiles it, which takes a 
bit of time, but then it's quite fast for zooming, panning, etc.

It theory, if GDAL reads it, our tool will too, but I'm not sure we've 
brought in a greyscale geo-tiff yet, so there may be some tweaking 
required for that.

You can get the maybe-not-quite-up-to-date source an binaries from:

http://bitbucket.org/dhelfman/maproom/wiki/Home

Send us a note offline if you're interested in more info.

-Chris


which downsamples at low magnification and only pulls out the currently 
visible ROI at high mag. Only this visible region is then colourmapped 
(at most the window size - so around 1k by 1k pixels if you've got the 
window maximised). This makes a huge difference to memory consumption, 
and performance. There's no provision for plotting axes or other stuff 
over the image though. My viewer is designed for 3D images with multiple 
colour channels (microscopy data sets), but will handle 2D images fine. 
Unfortunately it's currently got a fair bit of application dependent 
cruft/dependencies. I've been meaning to strip these out so it can be 
used standalone for a while, so if you don't find an alternative viewer, 
drop me a line and I'll see if I can get it into some sort of shape.
> 
> cheers,
> David
> 
> 
> ----- Original Message ----
> From: Massimo Di Stefano <massimodisasha at gmail.com>
> To: matplotlib-users at lists.sourceforge.net
> Cc: SciPy Users List <scipy-user at scipy.org>
> Sent: Thu, 10 June, 2010 6:31:17 AM
> Subject: [SciPy-User] matplotlib and large array
> 
> Hi All,
> 
> i need to work with a relative large images "60 mb" (single band geotiff file)
> i store it in python as a numpy array using python-gdal, 
> the array dinension is (7173 X 7924) single band image,
> but tring to display it with matshow/imageshow
> or other matplotlib functions i have that python freeze itself and is not able to load the image.
> 
> if i use a subset of the image, i 'm able to display it
> or at least i hade to reduce its resolution using hacks like :
> 
> reduced_array = array[::3,::3]
> 
> i don't need full resolution dataset when the image is displaied with a full "zoom out"
> so the reduction " reduced_array = array[::3,::3] "  is good to show the complete image
> but when i zoom in the image i obviously lost data (less resolution)
> 
> what do you use to display large dataset ?
> 
> i'm thinking  about a "piramid" with multy array based on the different zoom levels
> .. but maybe this idea is not so cool.
> someone already has developed similar code ?
> 
> thanks to All for any suggestion!
> 
> Regards,
> 
> Massimo
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 
> 
>       
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the SciPy-User mailing list