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

Home » Public Forums » archive » Re: Negative indexing and the WHERE function in IDL 8.0
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: Negative indexing and the WHERE function in IDL 8.0 [message #72244 is a reply to message #72165] Fri, 20 August 2010 03:36 Go to previous messageGo to previous message
svhhaugan is currently offline  svhhaugan
Messages: 8
Registered: August 2010
Junior Member
On Aug 19, 3:29 pm, wlandsman <wlands...@gmail.com> wrote:

That won't work for IDL 8.0 users who want to use the negative
scalar
indexing, but still need strictarrsubs to give an error when
subscripting an array with another array with out of bound indices.

Sure, but in IDL 8.0.1 you can *add* another compile_opt statement
that
ensures you get what you want. You can't do that with IDL 7.

> P.S.    I go back to the very early days (1986) of IDL when WHERE()
> didn't have the COUNT parameter, and one had to specifically test
> whether the returned index was equal to -1.
>
> index = where(array)
> if index[0] NE -1 then ....

I go back a bit, too. This is still my preferred way of testing.

> but I had never seen before the use of CATCH to make sure WHERE()
> returns a valid value.   It seems very convoluted to me, but I suppose
> it makes sense if one expects WHERE() to normally return a valid
> index, and a single CATCH clause can be used for multiple WHERE()
> statements to test for errors.    But now those errors won't be
> caught...

Ok, ok, ok, I regret ever putting that catch statement in
there. People get hung up on it and don't see the forest for
all the trees. It was just to prove a point, that people could be
relying on the documented behavior of negative indices
raising errors, when "things just won't work" with a given
set of parameters.

But I also said:

'the catch,error part would most likely be done "with
human intervention"'.

I.e., just letting the program crash while you're fiddling
with it, giving you a nice and friendly command line inside
an emacs window where you can find out what the heck went wrong,
where, and why.

It is, after all, an "Interactive" data language. Not
everyone using IDL are *required* to write program suites
that work for all possible parameters and situations, so it
can be sold to a paying customer. If that was a requirement
then IDL would be entirely unsuitable for serious research,
IMO.

Cheers,
Stein
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FITS WCS routines
Next Topic: obj_destroy on IDL_IDLBridge hangs sometimes

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

Current Time: Fri Oct 10 00:44:47 PDT 2025

Total time taken to generate the page: 1.36383 seconds