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

Home » Public Forums » archive » Binary_template + read_binary
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Binary_template + read_binary [message #53891] Wed, 09 May 2007 09:00 Go to previous message
rats06 is currently offline  rats06
Messages: 3
Registered: May 2007
Junior Member
Hi,

I have a LiDAR file in LAS FORMAT. I am trying to read this file using
BINARY_TEMPLATE and READ_BINARY but I am having some problems.
The only way I am being able to extract correctly all the information
is if I loop many times as the number of points I have in the dataset
and every time incrementing the TEMPLATE.OFFSET by 28 bytes.

What I mean is:

The format of the binary file should be:
Field1 = 4 bytes
Field2 = 4 bytes
Field3 = 4 bytes
Field4 = 2 bytes
Field5 = 1 byte
Field6 = 1 byte
Field7 = 1 byte
Field8 = 1 byte
Field9 = 2 bytes
Field10 = 8 bytes
Total number of bytes = 28

NUM_POINT_RECORDS = 276848 points

So, I create a TEMPLATE with BINARY_TEMPLATE with 10 fields using the
format above but using the NUMBER OF DIMENSIONS as a SCALAR.
Doing that and using the code:

for i = 0, NUM_POINT_RECORDS -1 do begin
data = read_binary(FILENAME, template=template)
template.offset[0] = template.offset[0] + 28
printf, ...
endfor

It works like that ... but of course too slow ... I tried putting the
NUMBER OF DIMENSIONS to 1 and using the NUM_POINT_RECORDS (276848
points) as the value ... but it doesn't work ... the result is not
the same as when I loop ...

How can I do that without looping ?

Thank you
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to write IDL log output to a file?
Next Topic: Re: math in graph title

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

Current Time: Wed Oct 08 19:13:01 PDT 2025

Total time taken to generate the page: 0.00401 seconds