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

Home » Public Forums » archive » Re: about color table
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: about color table [message #67120 is a reply to message #66874] Fri, 19 June 2009 20:55 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jun 19, 10:18 am, David Fanning <n...@dfanning.com> wrote:
> Jeremy Bailin writes:
>> Another way of going from array to scaledData (i.e. everything in
>> between TVLCT and TVImage in David's code), that's probably easier to
>> deal with if you want to change the values (or number) of the cutoffs,
>> is:
>
>> cutoffs = [0.2, 0.3, 0.5, 0.8]
>> scaledData = byte(value_locate(cutoffs, array) + 2)
>
> Thanks, Jeremy, for pointing this out. Even as jaded an IDL
> programmer has me had raised eyebrows when I read this. :-)
>
> I've written an article about this so others can learn about it.
>
>   http://www.dfanning.com/code_tips/partition.html
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Yeah, value_locate is very handy for problems like this! I
particularly like using it as a precursor to histogram - i.e. if you
want to do something fancy using reverse_indices but don't have
uniformly-spaced bins, first use value_locate to get integer indices
and then use histogram to do the heavy lifting.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using t3d to perform a reflection
Next Topic: about color table

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

Current Time: Sun Oct 12 01:58:11 PDT 2025

Total time taken to generate the page: 0.01210 seconds