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

Home » Public Forums » archive » create a loop on IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
create a loop on IDL [message #93322] Wed, 15 June 2016 23:08 Go to previous message
smnadoum is currently offline  smnadoum
Messages: 24
Registered: June 2016
Junior Member
Hi, I am new to IDL. I need help in creating a loop for a code that I am working on.

Here is my code:



pro soil_timeseries, dir, soil, outarr
files = file_search(dir, '*.bsq', count = nfiles)
file= 'F:\soil\MCD43A4.2000.049_soil.bsq\'

outarr = [ ]

get_lun, read_lun
openr, read_lun, file
a = assoc(read_lun, intarr(2400,2400))


for i = 0, nfiles - 1 do begin
print, 'files ', i
file = files(i)

soil= a[i]

roi= soil[28,1759]*0.0001
outarr = [outarr, roi]

endfor
free_lun
close, /all
return
end



It only reads one file, how can I get the code to read all of the files. I have 534 files, however, it is only ready one that is specified in the code:file= 'F:\soil\MCD43A4.2000.049_soil.bsq\'. I don't know if I am doing the right thing with:'for i = 0, nfiles - 1 do begin' because it doesn't seems to work (read all of the files)

Thank you.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading DICOM problem
Next Topic: Upgrading to Windows 10

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

Current Time: Wed Oct 08 09:19:58 PDT 2025

Total time taken to generate the page: 0.00491 seconds