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

Home » Public Forums » archive » Re: Someone can help me please?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Someone can help me please? [message #77027] Tue, 26 July 2011 04:10
Giacinto M is currently offline  Giacinto M
Messages: 2
Registered: July 2011
Junior Member
On 26 Lug, 13:02, Wox <s...@nomail.com> wrote:
> On Tue, 26 Jul 2011 02:51:25 -0700 (PDT), Giacinto M
>
> <ilgio1...@gmail.com> wrote:
>> Hello! I'm a beginner user of IDL,
>> I have a little problem that I can't solve, can you help me?:
>
>> From a 3D array, I want to look on the 3rd dimension (z) of each
>> coordinate (x,y) of the array and count
>> the number of time that I can found a specific number:
>
>> for example:
>> arr=[[[0,1],[2,1]],[[2,2],[1,1]],[[0,1],[0,0]],[[1,1],[1,1]] ]     -
>>>     number 1 appear  3 times on arr(x0,y1)
>
>> How can I do this?
>> Thanks
>
> print,total(arr eq 1,3,/int)
>
> where "1" is the number you are looking for and "3" the dimension you
> are looking at.

Fantastic! many thanks Wox
Re: Someone can help me please? [message #77028 is a reply to message #77027] Tue, 26 July 2011 04:02 Go to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Tue, 26 Jul 2011 02:51:25 -0700 (PDT), Giacinto M
<ilgio1984@gmail.com> wrote:

> Hello! I'm a beginner user of IDL,
> I have a little problem that I can't solve, can you help me?:
>
> From a 3D array, I want to look on the 3rd dimension (z) of each
> coordinate (x,y) of the array and count
> the number of time that I can found a specific number:
>
> for example:
> arr=[[[0,1],[2,1]],[[2,2],[1,1]],[[0,1],[0,0]],[[1,1],[1,1]] ] -
>> number 1 appear 3 times on arr(x0,y1)
>
> How can I do this?
> Thanks


print,total(arr eq 1,3,/int)

where "1" is the number you are looking for and "3" the dimension you
are looking at.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Someone can help me please?
Next Topic: ytickname

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

Current Time: Wed Oct 08 15:12:32 PDT 2025

Total time taken to generate the page: 0.00569 seconds