On 2009-02-13 11:59, tripp wrote:
Hello Folks,
I have a fortran program I use to process several satellite images. I
currently output the results to a text file (~750 mb) which is then
read by a perl program that outputs a GIS-ready image using GDAL
(www.gdal.org). There are python libraries for GDAL too.
I'd like to pipe the array directly to python from fortran (instead of
writing it out to a text file). Is it possible to access an in-memory
fortran array with python?
I've looked at f2py, but I could not tell if this was possible.
f2py makes Python extension modules that wrap FORTRAN code. Basically, what you
would have to do is use f2py to wrap the subroutines of your FORTRAN program;
your Python program will be the main driver. It is usually recommended that your
Python program allocate the memory in the form of a numpy array, and pass it
into your FORTRAN subroutines to be filled. F77 fixed arrays are well-supported;
F90 allocatable arrays and pointers are not. You may need a fixed array shim
layer around your Fortran 90 code if it uses these features.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
--
http://mail.python.org/mailman/listinfo/python-list