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_region.py.html
AHELP for ChIPS 4.1

get_region

Context: py.chips

Synopsis

Retrieves the attribute value(s) of the region.

Syntax

get_region()
get_region(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 region within the current frame.
  • attribute - a string containing the name of the attribute to retrieve

The get_region command returns a structure containing all the attribute values of the region. 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 regions are:

Attribute Description
depth Integer value indicating region depth
edge.color Color of the region edge
edge.style stipple pattern used to draw the region edges
edge.thickness Thickness of the region edge
fill.color Color of the region fill, if visible
fill.style fill style for the region
opacity Opacity of the region fill, if visible

To see if a region is hidden or visible, use the get_region_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_region_angle
get_region_depth
get_region_edgecolor
get_region_edgestyle
get_region_edgethickness
get_region_fillstyle
get_region_fillcolor
get_region_opacity

Example 1

chips> add_region([.1,.1,.7,.9,.7],[.07,.95,.95,.65,.07],"fill.style=1
fill.color=salmon")
chips> print(get_region())
chips> print(get_region("reg1","fill.color"))

A region is created and becomes current. Calling get_region with no argument returns all the attributes of the object. get_region is called a second time to return just the "fill.color" attribute.

Example 2

chips> add_region([.1,.1,.7,.9,.7],[.07,.95,.95,.65,.07],"fill.style=1
fill.color=salmon")
chips> add_region(3,.3,.3,.3,"fill.style=1 fill.color=plum")
chips> print(get_region("reg1"))

Two regions are created. get_region is called with the id of the first region, returning all attributes.

Example 3

chips> id=ChipsId()
chips> id.region="reg1"
chips> print(get_region(id))

A ChipsId structure is created and the id.region field is set to "reg1". get_region is called with the ChipsId.

Example 4

chips> regatt = get_region()
chips> print(regatt)

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

CHANGES IN CIAO 4.1

The attribute "fill.style" replaces the "fill.visible" attribute. There are multiple fill styles available, instead of a boolean filled/not filled. A value of 0 (chips_nofill) is equivalent to fill.visible=0; a value of 1 (chips_solidfill) is equivalent to fill.visible=1 .

Bugs

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.