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

Home » Public Forums » archive » reading dem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading dem [message #21589 is a reply to message #21573] Fri, 01 September 2000 11:34 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Sylvain Carette <sylvainc@total.net> writes:

> --------------A4C74D0ACADA4F254E47B596
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Well it didnt work.. :-(
> I got:
> % Input line is too long for input buffer of 32767 characters.
> % READF: Error encountered reading from file. Unit: 100, File:
> D:\gis\DEM250\montrealw.dem
>
> Now I'm stuck... is there a way to make readf read only no more than 32767
> char?

Okay, so you can read <31 1024-blocks at a time, unformatted. Then
you convert to a string and use reads.

ii = 0L
bb = bytarr(1024L*31) && ll = lonarr(170L*31)
while ii LT nvals do begin
readu, lun, bb ;; Read blocks
reads, string(bb), ll ;; Change to a string and parse into LONGs
im(ii:ii+170-1) = ll ;; Insert into image array
ii = ii + n_elements(ll) ;; Advance array index
end

This doesn't handle the case of the first block, which only has 135
elements, but you should get the idea. Now why not try a little
experimentation on your own...

Good luck,
Craig

P.S. I used a long integer because the values are defined in the spec
as INTEGER*4.

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: DISPLAY
Next Topic: IDLgrContour is hiding

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

Current Time: Thu Oct 09 20:33:23 PDT 2025

Total time taken to generate the page: 0.32195 seconds