comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Write IDL file to C
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Write IDL file to C [message #6592] Thu, 11 July 1996 00:00
Jean - Luc OLIVES is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Simulation of digital fixed-point arithmetic
Next Topic: HELP!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 13:51:59 PDT 2025

Total time taken to generate the page: 0.24194 seconds