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

Home » Public Forums » archive » for loop problem for beginner
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
for loop problem for beginner [message #93808] Tue, 25 October 2016 04:38 Go to previous message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
Hi, I have one image of size 91x76 in which there are values at some point and rest are zeros. So I want to extract only values and wana save them in column of csv format.
here b1 is the raster image to which i want to save in array a.
But not working please help...and how to save result in csv format so that I can get the values in excel column.

e = ENVI()
file = 'C:\Auto_Classification\Delhi\A10.tif'
raster = e.OpenRaster(file)
b1 = raster.GetData(BANDS=[0])
help,b1
a= intarr(1000)
k=0
for i=0,90,1 do for j=0,75 do begin
if (b1(i,j) ne 0) then begin
a(k)=b1(i,j)
k=k+1
endif
endfor
print,a
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: in multiplot to have common xaxis
Next Topic: Logistic model in COMFIT function

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

Current Time: Wed Oct 08 11:47:10 PDT 2025

Total time taken to generate the page: 0.00510 seconds