View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

hselect

douglas brenner wrote on May 05, 2006

I have a variable object.name which is equal to HIP 1234.
The query '(object == "@@object.name")' does not seem to work although there is a header object with HIP 1234 as the object
What's wrong?

Mike Fitzpatrick wrote on May 05, 2006

When you say "variable object.name" do you literally mean a script variable (perhaps python?) or do you mean 'variable' in the sense it is used in the HEDIT help page where it refers to a header parameter keyword? In either case I'm confused since the period in the name should be invalid.

The @ operator dereferences a keyword value and is usually only needed for keywords with a '-' in them, so for instance

(object ?= @o-name)

would test the value of the 'object' keyword against the value of the 'o-name' keyword. Note the use of the '?=' string comparison operator which is different than '=='. If what you have is a script variable and you're trying to construct an expression using the value, then you need to do something like

cl> s1 = "(object ?=  '" // namevar // "')"
cl> hselect ("myimg", "$I,stuff", s1)


where the first line is simply the concatenation of 3 strings and the second is executed in 'compute mode' so the s1 variable is dereferenced properly by the CL.

Hope this helps, if you still have questions please post more details on what you're trying to do exactly.

Cheers,
-Mike

douglas brenner wrote on May 05, 2006

Thanks.

Last post on May 05, 2006