Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/chips/ahelp/get_attribute.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 ChIPS v1

get_attribute

Context: utilities

Synopsis

Retrieves attribute value(s) for an object.

Syntax

get_attribute([id,] object_type [,attribute])

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
object_type The type of object to modify - e.g. chips_window, chips_curve, chips_line - as descrined in the Object Type section of "ahelp chipsopt".
attribute The name of the attribute to retrieve, such as 'style' or 'line.color'.

The get_attribute command retrieves the value of a specific attribute. If an attribute is not specified, the values of all attributes of the specified object are returned.

The command can only operate on a single object. An error is returned if currency is set to "all" and there are multiple versions of the object present.

Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.

Example 1

chips> crv = get_attribute(chips_curve)
chips> print(crv.symbol.color)
default

Retrieve a structure containing the attribute values of the current curve and store the results in "crv". The print call is used to examine either one of the fields, as above, or the whole strtucture, as below:

chips> print(crv)
baddata = 1
depth = 100
err.caplength = 10
err.color = default
err.down = False
...
symbol.fill = True
symbol.size = 5
symbol.style = 4

Example 2

chips> print(get_attribute("win1", chips_window, "display"))
True

Retrieve the display attribute value for the window called "win1".

Bugs

See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

concepts
attributes, setget
utilities
set_attribute, set_cascading_property, set_current

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.