Synopsis
Utility routines for ChIPS (CIAO contributed package)
Syntax
import chips_contrib.utils from chips_contrib.utils import * The module provides the following routines: xlabel(text) ylabel(text) title(text) xlog() ylog() xylog() xlin() ylin() xylin() xlim() ylim() xylim() add_ds9_contours()
Description
The chips_contrib.utils module provides utility routines for CIAO users, and is provided as part of the CIAO contributed scripts package.
Please see "ahelp add_ds9_contours" for help on the add_ds9_contours() routine; the other rountines are described below.
Loading the routines
The module can be loaded into ChIPS, Sherpa, or Python scripts by saying one of the following:
from chips_contrib.utils import * from chips_contrib.all import *
where the second line will load in all the ChIPS contributed routines, not just the utils module.
Contents
The utils module currenly provides the routines:
Routine | Description |
---|---|
xlabel() | Set the label of the X axis |
ylabel() | Set the label of the Y axis |
title() | Set the title of the plot |
xlog() | Change the X axis to use a logarithmic scale |
ylog() | Change the Y axis to use a logarithmic scale |
xylog() | Change the X and Y axes to use a logarithmic scale |
xlin() | Change the X axis to use a linear scale |
ylin() | Change the Y axis to use a linear scale |
xylin() | Change the X and Y axes to use a linear scale |
xlim() | Change the X axis limits |
ylim() | Change the Y axis limits |
xylim() | Change the X and Y axis limits |
add_ds9_contours() | Add the contours from a ds9 *.con file to a ChIPS plot (with optional coordinate conversion). |
The xlabel, ylabel and title routines
All three routines take a single argument, a string containing the text for the axis label. Use "" to remove the label. If the label contains LaTeX symbols that begin with a "\" character then prepend the letter r to the string. Examples of use are:
chips> xlabel("Energy (keV)") chips> ylabel(r"photon/cm^2/s/\AA") chips> title(r"Light curve: mean rate = 2.3 \pm 0.2 count s^{-1}")
These commands are short forms for the ChIPS set_plot_xlabel(), set_plot_ylabel() and set_plot_title() routines.
The xlog, ylog, and xylog routines
These routines take no arguments and change the current axis - or axes - to display with a logarithmic scale. They are short forms for the ChIPS log_scale() routine, and examples of use are show below:
chips> xlog() chips> ylog() chips> xylog()
The xlin, ylin, and xylin routines
These routines take no arguments and change the current axis - or axes - to display with a linear scale. They are short forms for the ChIPS lin_scale() routine, and examples of use are show below:
chips> xlin() chips> ylin() chips> xylin()
The xlim, ylim, and xylim routines
These routines take up to two arguments and change the limits of the current axis or axes. They are short forms for the ChIPS limits() routine, and examples of use are show below:
chips> xlim(10,100) chips> xlim(AUTO,100) chips> xlim(10,AUTO) chips> xlim(AUTO,AUTO) chips> ylim(1e-6,1e-2) chips> xylim(1, 100)
The xylim() command can only be used to change both axes to display the same range; the ChIPS limits() command should be used if the ranges for the X and Y axes are different.
Changes in the October 2011 Release
New routine
The add_ds9_contours() routine was added to the module.
Changes in the December 2010 Release
Module name change
To load in all the ChIPS contributed modules you now have to say one of
import chips_contrib.all from chips_contrib.all import *
rather than
import chips_contrib from chips_contrib import *
which no longer loads in any code.
Bugs
See the bugs pages on the CIAO website for an up-to-date listing of known bugs.
See Also
- limits
- limits, panto, pick_limits, zoom