Last modified: November 2016

URL: https://cxc.cfa.harvard.edu/chips/ahelp/set_contour.html
AHELP for CIAO 4.11 ChIPS v1

set_contour

Context: contours

Synopsis

Modifies the attributes of an existing contour.

Syntax

set_contour(attributes)
set_contour(id, attributes)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attributes Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object.

The set_contour command sets the specified attributes to the provided values. The modified contour becomes current. Multiple contours may be modified with a single command by setting the currency to "all".

Customizing the Contour

There are several attributes that control the characteristics of contours. The set_contour command may be used to modify the attribute values of an existing contour at any time during a ChIPS session. See "ahelp attributes" and "ahelp setget" for more general information.

If multiple attributes are being set simultaneously and one of them fails, the entire command will fail and the contour will not be modified.

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

Advanced Functions

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

set_contour_algorithm
set_contour_color
set_contour_depth
set_contour_interval
set_contour_levels
set_contour_mode
set_contour_numlevels
set_contour_style
set_contour_thickness

Examples

Example 1

chips> set_contour(["thickness", 2, "color", "peach"])

Using attribute/value pairs, set the contour to display using a line thickness of 2 and with the color peach.

Example 2

chips> set_contour({"thickness": 2, "color": "peach"})

Repeats the previous example but using a dictionary rather than list to set the attributes to change.

Example 3

chips> set_contour(["levels", [10,15,20]])
chips> print(get_contour().mode)
arbitrary

Change the levels being displayed by the contour (setting the levels attribute in this manner automatically changes the mode of the contour to "arbitrary").

Example 4

chips> s = ChipsContour()
chips> s.color = "red"
chips> s.style = "shortdash"
chips> set_contour("ctr1", s)

Populate the "s" structure with attribute values, then use it to set the contour with an id of "ctr1" to use red, short-dashed lines.


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, get_contour, hide_contour, shuffle_contour
utilities
set_current