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

Home » Public Forums » archive » Re: cmset_op question (Craig)
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: cmset_op question (Craig) [message #38320] Thu, 04 March 2004 01:57 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
jbattat@cfa.harvard.edu (James) writes:
> IDL> print, cmset_op(b, 'and' b)
> 1 1
>
> cmset_op returns unique values in the case of an integer array but not
> in the case of a string array.

James, this is a bug. But it's only tickled when you use AND, and
each set has only one unique value, and when those values are equal
between sets. (I complain about RSI, but this is my own dog food
problem). And yes, some integer cases do not tickle the bug.

The fix is to find the following line:
if NOT keyword_set(not1) AND NOT keyword_set(not2) then begin

and add the following code just after it:
;; Special case: if there are one in each set, and
;; they are equal, then the SHIFT() technique below
;; fails. Do this one by hand.
if na EQ 1 AND nb EQ 1 AND uu(0) EQ uu(1) then begin
count = 1L
if kind then return, 0L
return, [uu(0)]
endif

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: how to make a mask from a picture and how to put...
Next Topic: Hue Saturation Value... how to display the hue channel of an image

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

Current Time: Sat Oct 11 19:34:58 PDT 2025

Total time taken to generate the page: 1.35959 seconds