About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/chips4.1/get_contour.sl.html
AHELP for ChIPS 4.1

get_contour

Context: sl.chips

Synopsis

Retrieves the attribute value(s) of the contour.

Syntax

get_contour();
get_contour(id [,attribute]);

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to specify a contour within the current plot.
  • attribute - a string containing the name of the attribute to retrieve

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.

The attributes associated with contours are:

Attribute Description
algorithm algorithm used to calculate contours
color Color of the contours
depth Integer value indicating line depth
interval distance between contours when mode is interval
levels the exact contours to display
mode Mode used to determine the contour levels
numlevels number of contour levels when mode is count
style the pattern used for the contour style
thickness Thickness of the contour

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
get_contour_transform

Example 1

chips> add_contour("img.fits");
chips> get_contour;
algorithm = 1
color = default
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> get_contour.levels;
[55.0, 60.0, 65.0, 70.0, 75.0, 80.0]
chips> 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");
chips> add_contour([1,1,1, 1,3,1, 1,1,1], 3,3);
chips> 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> 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".

CHANGES IN CIAO 4.1

The attribute "levels" which refers to the requested number of levels for a given contour in count mode has been changed to "numlevels." When setting the attribute, "levels" now refers to a list of exact levels the user wants the contour to display (when the mode is set to "arbitrary"). When using get_contour(), the "levels" attribute contains the numeric values of the contour levels.

Bugs

The list of contour levels may contain repeated values

The values returned in the levels attribute of get_contour() may contain repeated values; for instance in the example below the 60.0 value is repeated twice.

chips> get_contour.levels;
[55.0, 60.0, 60.000000000000007, 65.0, 70.0, 75.0, 80.0]

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

Last modified: December 2008



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