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

URL: http://cxc.harvard.edu/chips/ahelp/get_contour.html
AHELP for CIAO 4.9 ChIPS v1

get_contour

Context: contours

Synopsis

Retrieves the attribute value(s) of the contour.

Syntax

get_contour()
get_contour(id)
get_contour(id, attribute)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attribute The name of the attribute to retrieve, such as 'color' or 'levels'.

The get_contour command returns a structure containing all the attribute values of the contour. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object.

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.

Please see the "Contour Preferences and Attributes" section below the examples for a list of the contour attributes.

Data Range

The get_contour_range command returns the X and Y ranges of the current contour. The values are returned as [xmin, xmax, ymin, ymax]. There are also individual commands for retrieving just the x, y, or z range: get_contour_xrange, get_contour_yrange, and get_contour_zrange.

To see if a contour is hidden or visible, use the get_contour_visible command.

Advanced Functions

The module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module):

get_contour_algorithm
get_contour_color
get_contour_depth
get_contour_interval
get_contour_mode
get_contour_numlevels
get_contour_style
get_contour_thickness

Example 1

chips> add_contour("img.fits","color=red")
chips> print(get_contour())
algorithm = 1
color = red
depth = 100
id = None
interval = 10.0
levels = [55.0, 60.0, 65.0, 70.0, 75.0, 80.0]
mode = nice
numlevels = 5
stem = None
style = solid
thickness = 1.0
wcs = None
chips> print(get_contour().levels)
[55.0, 60.0, 65.0, 70.0, 75.0, 80.0]
chips> print(get_contour("ctr1", "color"))
default

A contour is created and becomes current. Calling get_contour with no argument returns all the attributes of the object. The remaining calls show how get_contour can be used to access individual attributes of the contour.

Example 2

chips> add_contour("img.fits","color=red")
chips> add_contour([1,1,1,1,3,1,1,1,1], 3, 3)
chips> print(get_contour("ctr1"))

Two contours are created. get_contour is called with the id of the first contour, returning all attributes.

Example 3

chips> id = ChipsId()
chips> id.contour = "ctr1"
chips> print(get_contour(id))

A ChipsId structure is created and the id.contour field is set to "ctr1". get_contour is called with the ChipsId.

Example 4

chips> ctratt = get_contour()
chips> print(ctratt)

Retrieve a structure containing the attribute values of the current contour and store the results in "ctratt". Print the contents of "ctratt".

Contour Preferences and Attributes

The attributes associated with contours are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_contour() command. To change the contour preference settings prepend "contour." to the attribute name.

Attribute Description Options Default Set?
algorithm the contouring algorithm to be used standard, marching marching Yes
color contour color name or hex; see the Color section of "ahelp chipsopt" default Yes
depth Depth used for the contour object see the Depth section of "ahelp chipsopt" default Yes
interval Indicates the delta value from one contour level to the next whem mode=interval Non-negative value 10 Yes
levels When setting, this attribute controls the the contour levels to display when the mode is "arbitrary". When using get_contour() this attribute contains the actual contour levels displayed. Array or list of numbers [] Yes
mode How the contour levels are determined arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" nice Yes
numlevels number of contour levels when mode is count Non-negative integer 5 Yes
stem Stem used for contour id An alpha-numeric character sequence that does not contain a space ctr No
style Stipple pattern used to draw the line segment see the Line Style section of "ahelp chipsopt" solid Yes
thickness Thickness of the line 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes
wcs The name of the coordinate system to use "logical", "physical", "world". You can also use the names of the transforms, such as "sky" and "EQPOS". "world", if available and supported (WCS-TAN). No

Bugs

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

See Also

concepts
setget
contours
add_contour, current_contour, delete_contour, display_contour, hide_contour, set_contour, shuffle_contour
utilities
set_current

Last modified: November 2016
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.