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
Re: for loop problem for beginner [message #93811 is a reply to message #93809] Wed, 26 October 2016 04:19 Go to previous messageGo to previous message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Tuesday, October 25, 2016 at 5:19:02 PM UTC+5:30, Helder wrote:
> On Tuesday, October 25, 2016 at 1:38:07 PM UTC+2, Sanu wrote:
>> 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
>
> Hi,
> have a look at the where() function. It does what you did in the loop, just much much better:
> http://www.harrisgeospatial.com/docs/WHERE.html
> You will find some examples that will get you going.
>
> Cheers,
> Helder

Hi but I did'nt get the results.Please help me in making this program.
[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 13:58:57 PDT 2025

Total time taken to generate the page: 0.00188 seconds