Re: Is there a way to use C++ code in IDL [message #34199 is a reply to message #34197] |
Thu, 20 February 2003 11:16   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
CelticBlues (idluser@celticblues.com) writes:
> The file is a home grown tagged file format containing a type of image data
> and additional information about the conditions at the time the image was
> taken etc. Here is an example of what a simple file may look like:
Oh, no. I'm not going to be sucked into this. I have my
own work to do. (Actually, now that I think about it, I
am a little short of paying customers at the moment...)
But, no, I'm not going to do this.
This is not a hard file format to figure out.
Learn how to read a line of the file at a time:
line = ""
OPENR, lun, 'myfile.dat', /Get_Lun
ReadF, lun, line
Learn how to parse that line. I'd pay particular
attention to STRPOS and STRMID, for starters.
I'd learn what FIX, LONG, and FLOAT can do.
I don't know what kind of data that is in the data
block, but presumably those letters mean *something*.
I'd learn how to decode that.
There is a day's worth of material here, for sure.
But this is a LOT easier than you are probably
thinking right now. Try it out by doing things
at the IDL command line. IDL is fabulous at what
I call "learning by noodling around". You have
a tremendous advantage of being able to see and make
sense of what is in the data file. We are not all
so lucky.
And, for heaven's sake, get a book about IDL programming.
If you are a serious sort of person get Liam Gumley's
book. If you prefer something with a bit more attitude,
get my book. But you are unlikely to learn what you
really want to know by looking at the IDL documentation.
Either one of these books will parse the essential from
the overwhelming for you. :-)
Good luck. I think you are going to find out you
LOVE IDL (well, eventually). :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|