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

Home » Public Forums » archive » help with - count in where() function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
help with - count in where() function [message #90868] Thu, 30 April 2015 10:32 Go to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi

I wrote a simple example of my code to understand the behaviour of count in the where() function but I still don't understand something.

My example:

array = [[-1,2,3,4,5],[6,-7,8,9,10]]
mask =bytarr(5,5)
for i=0L,4 do begin
for j=0L, 4 do begin
IF (TOTAL(ARRAY GT 5.)+ TOTAL(Array LT 0.)) EQ 0 THEN mask[i,j]=1
endfor
endfor

ind = where(mask EQ 1,count)
print, count
IDL> 0


print, total(array GT 5.)
> IDL 4.00000
print, total(array LT 0.)
> IDL 2.00000


I was expecting the answers in the two last prints. I don't understand why when I print out the count it's zero. Can anyone help?

Actually I was expecting to be 4 because there are 2 negatives and 4 greater than 5 so (2+4=6, thus 10-6=4).

Thanks
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Copying contents of a function graphics window
Next Topic: Mapping southern in Northern map

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

Current Time: Wed Oct 08 13:56:24 PDT 2025

Total time taken to generate the page: 0.00390 seconds