-
Notifications
You must be signed in to change notification settings - Fork 8
IDL to Python IO
tiagopereira edited this page Nov 4, 2011
·
1 revision
(to be expanded)
I/O conversion quick sheet from IDL to Python
- openr/readu -> tt.io.fort_read
- writeu -> tt.io.fort_write
- assoc -> numpy.memmap
Note: readu should also be possible with numpy.fromfile (followed by a transpose to put Fortran-order into C-order), or numpy.memmap. However, care will have to be taken with the size of header and footer. (fort_read is essentially a numpy.fromfile.) The fort_read/numpy.fromfile approach has the advantage that the file object can be read sequentially, without the need for updating the offset in numpy.memmap.