Re: How to skip some bytes? [message #11615] |
Fri, 24 April 1998 00:00 |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
Gang Chen wrote:
> I am new to IDL, but I am trying to write a program. I want to read an
> unformatted data into a 3-D array, but I need to skip some bytes at the
> beginning of the data set. How can I do that with READU? Or is there
> another way to do it?
See the online help for POINT_LUN
Cheers,
Liam.
|
|
|
Re: How to skip some bytes? [message #11618 is a reply to message #11615] |
Fri, 24 April 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Gang Chen (gang@cochise.biosci.arizona.edu) writes:
> I am new to IDL, but I am trying to write a program. I want to read an
> unformatted data into a 3-D array, but I need to skip some bytes at the
> beginning of the data set. How can I do that with READU? Or is there
> another way to do it?
How many bytes to you want to skip?
Suppose you have a 512 byte header and the data was a (30,40,50)
floating point array. You might write something like this:
header = BytArr(512)
data = FltArr(30, 40, 50)
OpenR, lun, 'myfile.dat', /Get_Lun
ReadU, lun, header, data
Free_Lun, lun
You can find additional information about reading and writing
data as well as many other programming tips on my Coyote's
Guide to IDL Programming web page:
http://www.dfanning.com/
Cheers,
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|