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 2007

URL: http://cxc.harvard.edu/chips4.0/add_region.py.html
AHELP for ChIPS 4.0 add_region Context: py.chips

Synopsis

Creates a region.

Syntax

add_region( [ChipsId,] sides, xx, yy, radius [,attributes])
add_region( [ChipsId,] xvals, yvals, [,attributes])

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • sides - the number of sides on a regular polygon (i.e. 3=triangle, 4=square, 5=pentagon, etc.)
  • xx,yy - the location of the center of the regular polygon; the current coordinate system is used if one is not specified.
  • radius - the distance from the center (xx,yy) of the regular polygon to the edge; the current coordinate system is used if one is not specified.
  • xvals, yvals - arrays of x and y coordinates to create a non-convex region from (xvals[0],yvals[0]) to (xpos[n], yvals[n]). Degenerate (self-intersecting) polygons are not supported.
  • attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.

The add_region command creates a region whose attributes are specified by user preferences or in an attribute list. The new region becomes current by default; providing a ChipsId overrides the currency state.

Clipping

Regions displayed in data coordinates are clipped at the plot boundaries.

Customizing the Region

There are several attributes that control the region characteristics. The attributes can be set to the ChIPS defaults, values provided in the add_region command, or values from the user's preference file.

The attributes may also be modified with the set_region command at any time; see "ahelp py.chips set_region" and "ahelp py.chips setget" for more information.

The attributes associated with regions are:

Attribute Description Options Default
angle Angle at which the region is drawn -360.0:360.0 0.0
depth Integer value indicating region depth see the Depth section of "ahelp py.chips chipsopt" 100
edge.color region edge color see the Color section of "ahelp py.chips chipsopt" green
edge.style stipple pattern used to draw the region edges see the Line Style section of "ahelp py.chips chipsopt" chips_solid
edge.thickness Thickness of the region edge 0.5:10 1
fill.color region fill color see the Color section of "ahelp py.chips chipsopt" green
fill.visible Should the region be filled or not false|true; see the Booleans section of "ahelp py.chips chipsopt" false
opacity Opacity of the region fill, if visible 0.0:1.0 0.5
stem stem used for region id alphanumeric reg

Example 1

chips> add_region(6,.5,.5,.4)

Add a hexagon region in the current coordinate system.

Example 2

chips> settings = ChipsRegion()
chips> settings.fill.color = 'cyan'
chips> settings.fill.visible = 1
chips> settings.edge.color= 'beige'
chips> add_region([40,70,70],[10,70,10],settings)

Populate the "settings" structure with the attribute values, then add a triangle with vertices at (40,10), (70,70), and (70,10)

Example 3

chips> add_region([.1,.5,.9],[.9,.2,.7],['edge.color', 'red',
'edge.style', 'shortdash'])

Create region with a red, dashed edge, specifying the attribute values in a list.

Bugs

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

Last modified: December 2007



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.