Last modified: December 2013

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

get_curve

Context: curves

Synopsis

Retrieves the attribute value(s) of the curve.

Syntax

get_curve()
get_curve(id)
get_curve(id, attribute)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attribute The name of the attribute to retrieve, such as 'symbol.style' or 'line.color'.

The get_curve command returns a structure containing all the attribute values of the curve. 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.

Please see the "Curve Preferences and Attributes" section below the examples for a list of the curve preferences.

Data Range

The get_curve_range command returns the X and Y ranges of the current axes of the current plot. The values are returned as [xmin, xmax, ymin, ymax]. There are also individual commands for retrieving just the x or y range: get_curve_xrange and get_curve_yrange.

To see if a curve is hidden or visible, use the get_curve_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_curve_baddatamode
get_curve_depth
get_curve_errcolor
get_curve_errdown
get_curve_errleft
get_curve_errright
get_curve_errstyle
get_curve_errthickness
get_curve_errup
get_curve_limitlength
get_curve_limitoverride
get_curve_linecolor
get_curve_linestyle
get_curve_linethickness
get_curve_symbolangle
get_curve_symbolcolor
get_curve_symbolfill
get_curve_symbolsize
get_curve_symbolstyle

Examples

Example 1

chips> add_curve("lc.fits[cols time, count_rate]")
chips> print(get_curve())
chips> print(get_curve("crv1","line.color"))

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

Example 2

chips> add_curve("lc.fits[cols time, count_rate]")
chips> x = np.arange(11)
chips> add_curve(x, x**2)
chips> print(get_curve("crv1"))

Two curves are created. get_curve is called with the id of the first curve, returning all attributes.

Example 3

chips> id=ChipsId()
chips> id.curve="crv1"
chips> print(get_curve(id))

A ChipsId structure is created and the id.curve field is set to "crv1". get_curve is called with the ChipsId.

Example 4

chips> crvatt = get_curve()
chips> print(crvatt)

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


Curve Preferences and Attributes

The attributes associated with curves are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_curve() command. To change the curve preference settings prepend "curve." to the attribute name.

Attribute Description Options Default Set?
baddata How to handle NaNs and +/-infs in data omit, ignore: omit means to discard bad data point and leave gap, ignore means discard bad points, connecting the surrounding points omit Yes
depth Depth of the curve see the Depth section of "ahelp chipsopt" default Yes
err.caplength Length of the cap drawn on error bars (when err.style is cap). 1 to 100, inclusive. 10 Yes
err.color Color of the curve err bars name or hex; see the Color section of "ahelp chipsopt" default Yes
err.down Plot y down errors if data provided see the Booleans section of "ahelp chipsopt" true Yes
err.left Plot x down errors if data provided see the Booleans section of "ahelp chipsopt" true Yes
err.right Plot x up errors if data provided see the Booleans section of "ahelp chipsopt" true Yes
err.style Specifies the error bar style bar|line|cap (bar and line are identical) line Yes
err.thickness Specifies the thickness of error bars 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes
err.up Plot y up errors if data provided see the Booleans section of "ahelp chipsopt" true Yes
limitlength Length of the bars for upper and lower limits 0 to 1 in plot normalized coordinates 0.05 Yes
limitoverride Should both the limit and the error bar be drawn on a point? true = hide the errors, false = show the errors; see the Booleans section of "ahelp chipsopt" true Yes
line.color Color of the curve line name or hex; see the Color section of "ahelp chipsopt" default Yes
line.style the pattern used for the curve line style see the Line Style section of "ahelp chipsopt" solid Yes
line.thickness Thickness of the curve line 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes
stem Stem used for curve id An alpha-numeric character sequence that does not contain a space crv No
symbol.angle The angle, in degrees, of rotation for the curve symbols -360.0 to 360.0 0.0 Yes
symbol.color Color of the curve symbols name or hex; see the Color section of "ahelp chipsopt" default Yes
symbol.fill Should the curve symbols be filled or not see the Booleans section of "ahelp chipsopt" true Yes
symbol.size Size of the curve symbols 1 to 100 2 Yes
symbol.style The shape of the glyph used as the curve symbols see the Symbol Styles section of "ahelp chipsopt" cross Yes

Bugs

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

See Also

chips
make_figure
concepts
setget
curves
add_curve, current_curve, delete_curve, display_curve, hide_curve, set_curve, shuffle_curve
utilities
set_current