Re: accessing reverse_indices [message #31008] |
Wed, 29 May 2002 08:07 |
Jaco van Gorkom
Messages: 97 Registered: November 2000
|
Member |
|
|
"Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
news:onznyj10rg.fsf@cow.physics.wisc.edu...
>
> What happens if the particular bin is empty? It looks like HISTOBINS
> returns -1 which will gum the works, right?
If an array of bins is requested, then any empty bins will be quietly
ignored. If only one empty bin is requested, or if all requested bins
are empty, then HISTOBIN cannot very well return any valid indices into
the original array. Returning -1 and setting a COUNT variable to 0
seemed like an IDL 'standard' way of handling this situation, sort of.
It is what WHERE() does. Of course I would much prefer to return an
empty array...
This behaviour was the best I could come up with. I'm open to any
suggestions,
Jaco
|
|
|
Re: accessing reverse_indices [message #31010 is a reply to message #31008] |
Wed, 29 May 2002 07:34  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Jaco van Gorkom" <j.c.van.gorkom@fz-juelich.de> writes:
> Hi all,
>
> yesterday I got myself soo frustrated with the HISTOGRAM
> function and with its awefulsome keyword REVERSE_INDICES,
> that I decided to make this world a slightly better place by
> writing a utility function to access the reverse indices.
... [ cool function elided ] ...
Jaco--
What happens if the particular bin is empty? It looks like HISTOBINS
returns -1 which will gum the works, right?
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: accessing reverse_indices [message #31016 is a reply to message #31010] |
Wed, 29 May 2002 06:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jaco van Gorkom (j.c.van.gorkom@fz-juelich.de) writes:
> yesterday I got myself soo frustrated with the HISTOGRAM
> function and with its awefulsome keyword REVERSE_INDICES,
> that I decided to make this world a slightly better place by
> writing a utility function to access the reverse indices.
Bless you, Jaco! :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|