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

Home » Public Forums » archive » Re: How to skip some bytes?
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
Re: How to skip some bytes? [message #11615] Fri, 24 April 1998 00:00
Liam Gumley is currently offline  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 Go to previous message
davidf is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Deleting Variables
Next Topic: Starting ftp from IDl

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

Current Time: Wed Oct 08 17:42:11 PDT 2025

Total time taken to generate the page: 0.00498 seconds