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

Home » Public Forums » archive » error in a simple pro
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: error in a simple pro [message #55933 is a reply to message #55786] Thu, 13 September 2007 02:10 Go to previous messageGo to previous message
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
yychongzi@gmail.com schrieb:
> Hi, I am new to ENVI and IDL, but really interested and trying to
> learn.
>
> Below is a simple pro file for reading ENVI image, but there is
> something wrong with the line 'for i=0, .....' Could anyone tell me
> why? Thanks a lot.
>
>
> pro readenvi
>
> envi_select, title='choose image', fid=fid, dims=dims, pos=pos
> if(fid eq -1) then begin print, 'cancelled'
> return
> endif
>
> envi_file_query, fid, fname = 'C:\ars\data\test'
>
> num_cols = dims[2] - dims[1] + 1
> num_rows = dims[4] - dims[3] + 1
> num_bands = n_elements(pos)
>
> image = fltarr(num_bands,num_cols,num_rows)
>
> for i=0, num_bands -1 do image[i,*,*] = envi_get_data (fid=fid,
> dims=dims, pos = pos[i])
>
> window, 11, xsize=num_cols, ysize=num_rows, title = fname
> tvscl, image[0,*,*]
>
> print, num_cols
> end
>

Runs OK for me (it should, since it's one of my examples :-) ). Did you
by any chance forget the $ in the first line of your FOR statement? The
keyword FNAME in ENVI_FILE_QUERY is for output by the way, so you should
write

ENVI_FILE_QUERY, fid, fname=fname

Cheers,

Mort
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ENVI File Question
Next Topic: insufficient system resources

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

Current Time: Sat Oct 11 05:20:47 PDT 2025

Total time taken to generate the page: 0.16095 seconds