Write IDL file to C [message #6592] |
Thu, 11 July 1996 00:00 |
Jean - Luc OLIVES
Messages: 1 Registered: July 1996
|
Junior Member |
|
|
Hello IDL world user,
I have some beginner trouble with using IDL. I used IDL for process
image, and save them for read by a C program. My C code can read that
files, "Bon dieu mais que ce passe t-il ?".
I want an special output format :
int int float float float float ...
(dimx) (dimy) Re(X) Im(X) Re(Y) Im(Y) ...
The first two are the size of my "image", follow by the data who are
complex. So I this is my IDL code
********************************
DataC = COMPLEXARR(dimx,dimy)
DataC = COMPLEX(image)
A =[dimx,dimy]
A = FIX(A)
OPENW ,unit ,filename, /GET_LUN
WRITEU, unit, A
WRITEU ,unit, DataC
FREE_LUN ,unit
**************************************
I have read the file by the READU, and it's work well.
And My C code :
void OpenInputFile(FILE *fpt, char *filename)
{
if ((fpt = fopen(filename, "rb+")) == NULL) {
fprintf (stderr, "VDP: could not open file %s\n", filename);
exit(3);
}
}
void ReadNumRow_Col(int nr, int nc, FILE *fpt) {
fread(&nr, sizeof(int), 1, fpt);
fread(&nc, sizeof(int), 1, fpt);
}
Classical C routines
I have tried (short int), but don't work.
Result = numrows : 1090519040, numcols : 0
Please HELP !!!!
Jean-Luc
Olives@onecert.fr
|
|
|