[SciPy-user] read ascii data

Michael ODonnell odonnems at yahoo.com
Wed Dec 12 08:55:49 EST 2007


I am a new python/scipy user, but my first question is what type of grid data are you working with. I am not sure how you are defining 'grid' in other words. If you are working with spatial raster data, there is a library called GDAL. If the data has no spatial content you may try PIL library. 

I have also worked with reading comma delimited ascii files and you could also enumerate and skip all lines except for those you are interested in pretty easily and quickly. 

These are a few ideas, but which method you should select likely depends on the format of the data as well as what you plan on doing with the data that you are reading.

I hope this gives you some ideas,
Michael



----- Original Message ----
From: Christoph Scheit <cscheit at lstm.uni-erlangen.de>
To: scipy-user at scipy.org
Sent: Wednesday, December 12, 2007 3:57:14 AM
Subject: [SciPy-user] read ascii data


Hi All,

I have a file containing ascii data related to a block-structured grid.
I could use readtxt, but I would like to have the possibility to read
 only
a certain range of rows out of the file. Lets say I have ten blocks in
 my grid
and each block 10 rows of data.
So in one read I would like to read for instance line 30 to line 39
I can use skip rows, but how can I limit the loadtxt to the upper
 limit?
Is there something already available or do I have to do it on my own?

Thanks in advance,

Christoph
_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user






      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20071212/c1f72495/attachment.html>


More information about the SciPy-User mailing list