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 #93812 is a reply to message #93811] Wed, 26 October 2016 04:27 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, October 26, 2016 at 1:19:44 PM UTC+2, Sanu wrote:
> 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.

What results did you get? What code did you try?
h
[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: Sun Oct 12 00:32:37 PDT 2025

Total time taken to generate the page: 0.16689 seconds