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
reading dem [message #21573] Tue, 29 August 2000 23:07 Go to previous message
Sylvain Carette is currently offline  Sylvain Carette
Messages: 19
Registered: May 2000
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<tt>I'm trying to get started with IDL .</tt>
<br><tt>All their examples work fine. But of course, working with my data
didnt work at all...</tt>
<br><tt>Need to read usgs1:250k dem. I'm not sure if I understand the format
but I succeed to</tt>
<br><tt>get the right value using " reads, string(filechunk), var ". Maybe
there is other ways</tt>
<br><tt>with assoc, format, xdr stuff?</tt>
<br><tt>Anyhow, the problem here is that although if I execute each line
of a small procedure</tt>
<br><tt>separately from the console and it work as expected, it doesnt
when i execute the</tt>
<br><tt>procedure. It doesnt even finish the first loop.</tt>
<br><tt>% READS: End of input data encountered: &lt;STRING&nbsp;&nbsp;
('&nbsp;&nbsp; 366&nbsp;&nbsp; 366&nbsp;&nbsp; 359&nbsp; ...')></tt>
<br><tt>% Execution halted at:&nbsp; READDEM250&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
25 C:\RSI\IDL53\project\readdem250.pro</tt>
<br><tt>Why can I execute the first loop cycle from the console and not
from inside the loop?</tt>
<br><tt>What did I miss?</tt>
<br><tt>Below listing -&nbsp; btw, the reason the statements are all written
inline instead of</tt>
<br><tt>inside another loop is that I coulnt get nested loop to work thanks
to wonderful IDL documentation.</tt><tt></tt>
<p><tt>Thanks</tt><tt></tt>
<p><tt>Sylvain Carette</tt>
<br><tt>VRML designer-composer</tt><tt></tt>
<p><tt>pro readdem250</tt>
<br><tt>openr, lun, dialog_pickfile(), /get_lun</tt>
<br><tt>block = assoc( lun, bytarr(1024)) ;the file is divided in 1024
chunk</tt>
<br><tt>im = intarr(1201,1201) ; dem is 1201x1201</tt>
<br><tt>col = intarr(1201) ; one column</tt>
<br><tt>ba = intarr(146) ; to hold one profile stored trough 8*1024 recordB
chunk</tt>
<br><tt>bb = intarr(170) ; first = 146 bytes, last = 35 bytes,</tt>
<br><tt>bc = intarr(170) ; others = 170 bytes, total = 1201 bytes</tt>
<br><tt>bd = intarr(170)</tt>
<br><tt>be = intarr(170)</tt>
<br><tt>bf = intarr(170)</tt>
<br><tt>bg = intarr(170)</tt>
<br><tt>bh = intarr(35)</tt><tt></tt>
<p><tt>for i=1, 1201 do begin ; skip first 1024 chunk, "recordA"</tt>
<br><tt>&nbsp;reads, string(block[146:*,i]), ba ; recordB profile value
begin at byte 146</tt>
<br><tt>&nbsp;reads, string(block[i+1]), bb</tt>
<br><tt>&nbsp;reads, string(block[i+2]), bc</tt>
<br><tt>&nbsp;reads, string(block[i+3]), bd</tt>
<br><tt>&nbsp;reads, string(block[i+4]), be</tt>
<br><tt>&nbsp;reads, string(block[i+5]), bf</tt>
<br><tt>&nbsp;reads, string(block[i+6]), bg</tt>
<br><tt>&nbsp;reads, string(block[0:210,i+7]), bh&nbsp; ; 6 byte/value</tt>
<br><tt>&nbsp;</tt>
<br><tt>&nbsp;col = [ba, bb, bc, bd, be, bf, bg, bh] ; concatenate all
segment in one profile</tt>
<br><tt>&nbsp;im[i,*] = col</tt>
<br><tt>endfor</tt>
<br><tt>imlr = bytscl(im)</tt>
<br><tt>end</tt></html>
[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: Wed Oct 08 20:03:34 PDT 2025

Total time taken to generate the page: 0.21892 seconds