Re: Questions about IDL 8.0 [message #73722 is a reply to message #73712] |
Wed, 24 November 2010 12:15   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 24, 6:00 pm, Michael Galloy <mgal...@gmail.com> wrote:
> But I don't see where 'zaxis' appears at all:
>
> IDL> foreach el,s['zaxis*'] do print, el.identifier
> AXIS2
> AXIS5
> AXIS8
> AXIS11
>
> It seems like it is doing something smart, but I'm not sure exactly what
> it is. For example, 'zaxis*' matches all the axes pointing in the z
> direction:
>
> IDL> foreach el, s['zaxis*'] do el.hide = 1
Yes, the overload function is not matching by the names of the objects
(though it could), it is using igetid() to decide what is the best
match for the string given. The help on igetid() says
"You do not need to enter the exact substring of the intended
visualization object. IGETID’s matching algorithm overlooks small
formatting irregularities to return the match(es) that best fit the
given substring."
In this particular case, when igetid() sees one is searching for axes,
it determines if the string specifies a direction (from it containing
x|y|z), and if so, only returns the axes with the corresponding
direction:
IDL> s=surface(/test,axis_style=2)
IDL> foreach el,s['axis*'] do print,el.name, el.direction
Axis 0 0
Axis 1 1
Axis 2 2
Axis 3 0
Axis 4 1
Axis 5 2
Axis 6 0
Axis 7 1
Axis 8 2
Axis 9 0
Axis 10 1
Axis 11 2
IDL> foreach el,s['zaxis*'] do print,el.name, el.direction
Axis 2 2
Axis 5 2
Axis 8 2
Axis 11 2
IDL> foreach el,s['*Axis 2*'] do print,el.name, el.direction
Axis 2 2
|
|
|