I am just starting to use python, and as such my question may well be a
bit simplistic.  I am currently trying to write what should be a very
basic set of routines for reading and writing to a binary grid format
(ERMapper).  However:

I am struggling to find the correct tools to write a row of a
2-dimensional array to a binary file.  In matlab the command looks
like:

fid=fopen(filename,'wb');
for y=1:NrOfLines
   fwrite(fid,in(y,:)','real*4');
end
fclose(fid);

I'm conscious that the "write" command would allow me to write text to
a binary file, but I'm not clear how to:
1) format my numeric data such that it matches the real*4 format
2) parse an entire row of a 2D array without using a for loop.

If anyone has any suggestions on how to do this (or even hints as to
what modules I should be looking at) they would be greatly appreciated.
 Alternativly, if anyone has written routines for dealing with basic
ERMapper grids (as opposed to the wavelet compressed data) I'd love to
save myself from re-inventing the wheel.

Thanks
Trevor Dhu

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to