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

Home » Public Forums » archive » IDL and me!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL and me! [message #45565] Wed, 21 September 2005 07:26
Liberum is currently offline  Liberum
Messages: 48
Registered: September 2005
Member
Hi Guys and Gals,

As a nascent IDL user I have come across a little problem that really
chaps my hide! Any help would really be appreciated!
Consider the following file-reading code:

OPENR, LUN, file, /GET_LUN
s = ""
FOR i = 0, n_lines -1 DO BEGIN
READF, LUN, s ; reads the file line by line into string s
d = STRSPLIT(s, /EXTRACT)
col1 = d[0] & col2 = d[1] & col3 = d[2] & col4 = d[3]
IF FIX(col1) EQ -10 THEN bias[i] = 0
IF FIX(col1) EQ -5 THEN bias[i] = 1
IF FIX(col1) EQ -1 THEN bias[i] = 2
IF FIX(col1) EQ 0 THEN bias[i] = 3
IF FIX(col1) EQ 1 THEN bias[i] = 4
IF FIX(col1) EQ 5 THEN bias[i] = 5
IF FIX(col1) EQ 10 THEN bias[i] = 6
cth[i] = LONG(col2)
occur[i] = LONG(col3)
pixels[i] = LONG(col4)
hist_data[bias[i], cth[i] - 1] = FLOAT(occur[i])/pixels[i]*100.
i += 1
ENDFOR
FREE_LUN, LUN

Now all I'm trying to do is to read the contents of this file into an
array. Now when I run this script I get:

% Attempt to subscript D with <INT ( 1)> is out of range.

Now how can this be when d has 4 elements and I have not looped outside
of [0, 3] ????????????

Sincerely,
Lib
[Message index]
 
Read Message
Previous Topic: Re: contouring data on a triangular grid
Next Topic: Re: Gaussian Enhancement on Image Histogram

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

Current Time: Wed Oct 08 18:03:51 PDT 2025

Total time taken to generate the page: 0.00425 seconds