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

set_region

Context: py.chips

Synopsis

Modifies the attributes of an existing region.

Syntax

set_region([id,] values)

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to modify a region within the current frame.
  • values - a list containing attribute value pairs or a ChipsRegion object.

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

Customizing the Region

There are several attributes that control the characteristics of regions. The set_region command may be used to modify the attribute values of an existing region 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 region will not be modified.

The attributes associated with regions are:

Attribute Description Options Default
depth Integer value indicating region depth see the Depth section of "ahelp chipsopt" 100
edge.color Color of the region edge name or hex; see the Color section of "ahelp chipsopt" green
edge.style stipple pattern used to draw the region edges see the Line Style section of "ahelp chipsopt" chips_solid
edge.thickness Thickness of the region edge 0.5:10 1
fill.color Color of the region fill name or hex; see the Color section of "ahelp chipsopt" green
fill.style The fill style for the region see the Fill Pattern section of "ahelp chipsopt" 0 (no fill)
opacity Opacity of the region fill 0.0:1.0 0.5

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_region_depth
set_region_edgecolor
set_region_edgestyle
set_region_edgethickness
set_region_fill
set_region_fillcolor
set_region_opacity

Example 1

chips> set_region(['edge.color','plum', 'edge.style', 'dot'])

Using attribute/value pairs, set the region edge color to plum and the edge stipple pattern to dot.

Example 2

chips> settings = ChipsRegion()
chips> settings.fill.color = 'blue'
chips> settings.edge.thickness = 2
chips> set_region('reg1',settings)

Populate the "settings" structure with attribute values, then use it to set reg1 edge to be blue with a thickness of 2.

Example 3

chips> class properties:
pass
chips> p = properties()
chips> p.edge = ChipsRegionEdge()
chips> p.fill = ChipsRegionFill()
chips> p.edge.color = 'red'
chips> p.fill.color = 'blue'
chips> set_region(p)

Create a user-defined structure with edge.color and fill.color fields. Use the structure to modify the values of the current region.

Example 4

chips> class properties:
pass
chips> p = properties()
chips> p.depth=50
chips> set_region(p)

Create a user-defined structure with depth field. Use the structure to modify the values of the current region.

CHANGES IN CIAO 4.1

Pattern fill options

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. See the Fill Patterns section of "ahelp chipsopt" for the full list of pattern styles.

Default color not changing for printing

The histogram and region fill colors when set to default were not being changed from a display foreground color to a postscript foreground color.

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.