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

Home » Public Forums » archive » BYTSCL and NAN keyword
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: BYTSCL and NAN keyword [message #38348 is a reply to message #38282] Wed, 03 March 2004 08:41 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kenneth Bowman <k-bowman@null.tamu.edu> writes:

> In article <ond67vf8sb.fsf@cow.physics.wisc.edu>,
> Craig Markwardt <craigmnet@REMOVEcow.physics.wisc.edu> wrote:
>
>> How about this non-WHERE approach?
>> bb = bytscl(x, ...) + (finite(x) EQ 0)*255b
>
> Clever idea (JD also)! The logical not operator (~) will work as well
>
> bb = BYTSCL(x, ..., /NAN) + BYTE(255*(~FINITE(co)))
>
> While not mandatory, the BYTE function ensures that the result bb is
> type BYTE (since FINITE returns a LONG).

No I disagree. FINITE should (and does) return a BYTE, just like all
the other conditional expressions in IDL.

Logical negation ("~" operator) also keeps the byte-ness of the
operand.

I think where you are going askew is the multiplication by 255. You
really need the "B" after 255b in order to force it to be a byte.

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
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Working with indices of WHERE
Next Topic: NR__SVDFIT issue

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

Current Time: Sat Oct 11 10:16:15 PDT 2025

Total time taken to generate the page: 0.56059 seconds