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

Home » Public Forums » archive » Re: Oh what is wrong with WHERE() ?
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: Oh what is wrong with WHERE() ? [message #48568 is a reply to message #48567] Sat, 29 April 2006 08:49 Go to previous messageGo to previous message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
"Sheldon" <shejo284@gmail.com> wrote in message
news:1146322284.261031.55760@e56g2000cwe.googlegroups.com...
...
> m[nodata_tot] = 255.0
> p[nodata_tot] = 255.0
> ; finding the area with real data check
> va_data = WHERE(p EQ 255.0, COMPLEMENT=vdatap, NCOMPLEMENT=chp)
> va_data = WHERE(m EQ 255.0, COMPLEMENT=vdatam, NCOMPLEMENT=chm)
> print, 'chp: ', chp, ' chm: ', chm
...
> chp: 32271 chm: 32272
> /////////////////////////////
>
> What happened to one pixel??


Hi Sheldon,
could you reduce this problem to a very short example?
(and with m and p small enough to actually print out)?

This looks very strange in that you apparently set both m and p
to have the same number of 255s, then get different results from
the where call.. David makes a good point about the folly of
using where for equality to floats, however for this example I don't
think that causes your problem.

Offhand I would say that p already has a single value of 255 that was
not in the indexes described by nodata_tot. Thus you already had a value
for 255 before your line "p[nodata_tot] = 255.0". This line had set
1443953 points to 255, leaving 32272 points that should be other,
however on of those 32272 points in fact had a point equal to 255,
thus leaving the chp value one short at 32721.

Cheers,
bob

PS you should think hard about converting your arrays to integers
before doing any equality test.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Problem with for-slope
Next Topic: Grid file manipulation (.grd)

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

Current Time: Fri Oct 10 20:57:11 PDT 2025

Total time taken to generate the page: 0.55894 seconds