Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 26 October 2016

URL: http://cxc.harvard.edu/chips/convert/commands.html

Conversion guide: ChIPS 3 command language to ChIPS 4.7

This document does not highlight many of the capabilities that are new in ChIPS, such as the ChIPS GUI, or extensive support for overlaying images, contours, and curves. Please see the General differences between CIAO 3 and CIAO 4, ChIPS Gallery, and ChIPS threads for more information and examples.


Supported commands

The following commands - listed in alphabetical order - can be replicated in the new version of ChIPS. In most cases there is a one-to-one correspondance, although occasionally several routines will have to be called.

AXIS newcolor
AXES newcolor

You can say either

set_axis(["*.color", "newcolor"])

or

set_cascading_property("all", chips_axis, "color", "newcolor")

Either command will also change the color of any axis labels, which the 3.4 command did not change. They can be restored to the default color, if so desired, buy saying

set_axis(["label.color", "default"])
AXIS [WIDTH] w
AXES [WIDTH] w

You can say either

set_axis(["*.thickness", q])

or

set_cascading_property("all", chips_axis, "thickness", "w")

where 0.5 <= w <= 10.

The last argument must be given as a string for set_cascading_property, so

AXIS 2

becomes either of

set_axis(["*.thickness", 2])
set_cascading_property("all", chips_axis, "thickness", "2")

This will not change the thickness of the numeric labels or axis labels. They can both be changed to a bold font, if required, with either of

set_axis(["*.fontstyle", "bold"])
set_cascading_property("all", chips_axis, "fontstyle", "bold")

or individually with

set_axis(["label.fontstyle", "bold"])
set_axis(["ticklabel.fontstyle", "bold"])
[AXIS] TWOAXES|FOURAXES|TWOAXESFRAME
[AXES] TWOAXES|FOURAXES|TWOAXESFRAME
set_plot(["style","open"])    # for TWOAXES
set_plot(["style","closed"])  # for FOURAXES
set_plot(["style","boxed"])   # for TWOAXESFRAME
BATCH [on]

One of:

set_preference("window.display", "false")
set_window(["display", False])

The command to use depends on whether a window has already been created. If it has not then use set_preference, otherwise use set_window to change the redraw attribute as show above. See also the REDRAW call.

To run a job in the background you may need to use xvfb to create a virtual X server for ChIPS to use.

BATCH off

One of:

set_preference("window.display", "true")
set_window(["display", True])

See the BATCH on command for more information.

C n
current_curve("crvn")

So C 2 becomes current_curve("crv2").

C all
current_curve("all")
CLEAR

One of:

clear()
empty()

The clear() routine removes everything, including windows, whereas the erase() routine deletes everything within the current window.

COLORSYS cmyk|grayscale|rgb
set_preference("export.colorscheme", "cmyk")
set_preference("export.colorscheme", "grayscale")
set_preference("export.colorscheme", "rgb")

There is also "cmyksep", which creates four output files, one for each channel (cyan, magenta, yellow, and black). The cmyk and cmyksep formas are only supported for the ps, eps, and pdf output types.

The color scheme can also be over-ridden when calling print_window:

print_window("fig1.proof",["colorscheme","cmyk"])

or set from the print dialog:

print_window("fig1.proof", ["printdialog", True])
CONTOUR filename
CONTOUR filename [LEVELS] l1 .. ln

If the file is an image, then one of:

make_figure("filename")
add_contour("filename")

make_figure("filename",[l1,..,ln])
add_contour("filename",[l1,..,ln])

The add_contour version should be used if you wish to add a contour to an existing plot.

If the file is a table, with the first three columns containing the x, y, and z data values to contour:

tbl = read_file("filename")
x = copy_colvals(tbl, "col1")
y = copy_colvals(tbl, "col2")
z = copy_colvals(tbl, "col3")

add_contour(x, y, z)

# or, if levels are specified
add_contour(x, y, z, [l1,..,ln])
CONTOUR x y z
CONTOUR x y z LEVELS l1 .. ln

x, y, and z are one-dimensional arrays, with the X-axis values increasing fastest.

add_contour(x,y,z)
add_contour(x,y,z, [l1, .., ln])

It is also possible to contour an image by saying

add_contour(img2d)
add_contour(img1d, nx, ny)

where img2d is a 2D array and img1d is a 1D array (in this case nx and ny are the X and Y dimensions to use).

CURVE filename
PLOT filename

One of:

make_figure("filename")
add_curve("filename")

The make_figure() command will create a plot and add axis labels and a plot title, based on the contents of the file. The add_curve() command should be used if more control over the plot appearance is needed, or if you want to add more than one curve to a plot.

CURVE filename i j k
PLOT filename i j k
make_figure("filename[cols #i,#j,#k]")
add_curve("filename[cols #i,#j,#k]")

The column names can also be used instead of the column number in the column filter.

CURVE filename <column list>
PLOT filename <column list>
add_curve("filename[cols ...]")

The columns to plot are taken from the number in the input file:

Number of columns Meaning
2 x,y
3 x,y,dy
4 x,y,dylo,dyhi

so the Data Model column filter should be used to select the columns to plot.

To plot other columns - e.g. to add X error bars - then the file will have to be read in using Crates and the columns selected manually, for example, if the first four columns of tbl.fits are named X, Y, XLO, and XHI then

CURVE tbl.fits x 1 y 2 xdn 3 xup 4

would be converted to

tbl = read_file("tbl.fits")
x = copy_colvals(tbl, "X")
y = copy_colvals(tbl, "Y")
dxlo = copy_colvals(tbl, "XLO")
dxhi = copy_colvals(tbl, "XHI")
add_curve(x, y, [None, None, dxlo, dxhi])

ABSOLUTE error values are not supported; values will have to be converted to relative form before plotting. The SCOL column option is not supported.

[CURVE] newcolor
set_curve(["line.color","newcolor"])
[CURVE] newstyle
set_curve(["line.style","styleval"])

See the line style section for the mapping between newstyle and styleval.

[CURVE] NOLINE

One of:

set_curve(["line.style", "noline"])
set_curve(["line.style", "none"])
[CURVE] SIMPLELINE
set_curve(["line.style", "solid"])
[CURVE] WIDTH w
set_curve(["line.thickness", w])

where 0.5 <= w <= 10.

[CURVE] SYM newcolor
set_curve(["symbol.color", "newcolor"])
[CURVE] SYM newstyle

One of:

set_curve(["symbol.style", "styleval"])
set_curve(["symbol.style", "styleval", "symbol.fill", False])

See the symbol style section for the mapping between newstyle and styleval and whether the symbol.fill attribute needs changing.

[CURVE] SYM s
set_curve(["symbol.size",s])

where 1 <= s <= 100.

D n
current_plot("plotn")

So D 2 becomes current_plot("plot2").

D all
current_plot("all")
DELETE
delete_plot([id])
delete_curve([id])
delete_histogram([id])
delete_contour([id])
delete_line([id])
delete_label([id])

In the old ChIPS command language the object being deleted was given by the context of the command, so the two commands

C ALL DELETE
D 2 DELETE

would delete all curves and the second drawarea respectively. The new language has separate delete commands for the different objects, so the above commands would be converted to:

delete_curve("all")
delete_plot("plot2")

or

current_curve("all")
delete_curve()

current_plot("plot2")
delete_plot()
DISPLAY imagename

Use ds9 to view the file by saying

chips> !ds9 filename &

or display as a ChIPS image using one of

chips> add_image("filename")
chips> make_figure("filename", "image")
DRAWARA x1 x2 y1 y2
add_plot(x1,y1,x2,y2)

The order of the coordinates has changed.

ERRS [X|Y] newcolor
set_curve(["err.color","newcolor"])

The use of the optional coordinate argument (i.e. "X" or "Y") is no longer supported, since the properties of the error bars are shared between all four bars (up, down, right, and left), except for the visibility, which can be changed individually.

ERRS [X|Y] STANDARD
set_curve(["err.style","line"])

The use of the optional coordinate argument (i.e. "X" or "Y") is no longer supported, since the properties of the error bars are shared between all four bars (up, down, right, and left), except for the visibility, which can be changed individually.

ERRS [X|Y] BAR
set_curve(["err.style","capped"])

The use of the optional coordinate argument (i.e. "X" or "Y") is no longer supported, since the properties of the error bars are shared between all four bars (up, down, right, and left), except for the visibility, which can be changed individually.

ERRS [X|Y] SIZE v
set_curve(["err.caplength", v])

The size v does not have the same meaning in CIAO 4 as it did in CIAO 3; it now is an absolute value measured in pixels.

ERRS [X|Y] BOTH|NONE
set_curve(["err.*", v])
set_curve(["err.down", v, "err.up", v, "err.left", v, "err.right", v])

where v is True for BOTH and False for NONE.

ERRS X BOTH|NONE
set_curve(["err.left", v, "err.right", v])

where v is True for BOTH and False for NONE.

ERRS Y BOTH|NONE
set_curve(["err.down", v, "err.up", v])

where v is 1 for BOTH and 0 for NONE.

ERRS X UP
set_curve(["err.left", False, "err.right", True])

Changing the err.left value may not be necessary.

ERRS X DOWN
set_curve(["err.left", True, "err.right", False])

Changing the err.right value may not be necessary.

ERRS Y UP
set_curve(["err.down", False, "err.up", True])

Changing the err.down value may not be necessary.

ERRS Y DOWN
set_curve(["err.down", True, "err.up", False])

Changing the err.up value may not be necessary.

GRIDS [X|Y] ON|OFF

One of:

set_axis(["majorgrid.visible", v, "minorgrid.visible", v])
set_xaxis(["majorgrid.visible", v, "minorgrid.visible", v])
set_yaxis(["majorgrid.visible", v, "minorgrid.visible", v])

where v is True for ON and False for OFF.

GRIDS MAJ [X|Y] ON|OFF

One of:

set_axis(["majorgrid.visible",v])
set_xaxis(["majorgrid.visible",v])
set_yaxis(["majorgrid.visible",v])

where v is True for ON and False for OFF.

GRIDS MIN [X|Y] ON|OFF

One of:

set_axis(["minorgrid.visible",v])
set_xaxis(["minorgrid.visible",v])
set_yaxis(["minorgrid.visible",v])

where v is True for ON and False for OFF.

GRIDS [MAJ|MIN] [X|Y] newcolor

One of:

set_axis(["majorgrid.color","color","minorgrid.color","color"])
set_axis(["majorgrid.color","color"])
set_axis(["minorgrid.color","color"])

set_xaxis(["majorgrid.color","color","minorgrid.color","color"])
set_xaxis(["majorgrid.color","color"])
set_xaxis(["minorgrid.color","color"])

set_yaxis(["majorgrid.color","color","minorgrid.color","color"])
set_yaxis(["majorgrid.color","color"])
set_yaxis(["minorgrid.color","color"])

In the old command language, changing the property of a grid would automatically display the grid. In the new language the visibility has to be explicitly turned on; it is not done automatically. So

GRIDS MAJ red

becomes, assuming the grid is not already visible,

set_axis(["majorgrid.color","red","majorgrid.visible",1])
GRIDS [MAJ|MIN] [X|Y] newstyle

One of:

set_axis(["majorgrid.style","styleval","minorgrid.style","styleval"])
set_axis(["majorgrid.style","styleval",])
set_axis(["minorgrid.style","styleval"])

set_xaxis(["majorgrid.style","styleval","minorgrid.style","styleval"])
set_xaxis(["majorgrid.style","styleval",])
set_xaxis(["minorgrid.style","styleval"])

set_yaxis(["majorgrid.style","styleval","minorgrid.style","styleval"])
set_yaxis(["majorgrid.style","styleval",])
set_yaxis(["minorgrid.style","styleval"])

See the line style section for the mapping between newstyle and styleval.

See the GRIDS newcolor command for information on setting the grid visibility.

INFO

There is no one command that displays similar information to the INFO command.

The info(), info_current(), info_depth(), info_coordinate(), and info_bound_axes() routines return a string containing information on what objects have been created. The info preferences control the content and appearance of the output of these routines.

Information on current objects - such as the line color or symbol type - can be found by saying

print (get_plot())
print (get_curve())
print (get_histogram())
print (get_contour())
print (get_line())
print (get_label())
L n
current_label("lbln")

So L 2 becomes current_label("lbl2").

L all
current_label("all")
LABEL x y "text"
add_label(x,y,"text")

If the text contains any "\" characters then add the r qualifier before the string. For example add_label(2,5,r"y=\alpha^2").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

LABEL ANGLE a
L n [LABEL] ANGLE a
set_label(["angle",a])
set_label("lbln",["angle",a])
LABEL newcolor
L n [LABEL] newcolor
set_label(["color","newcolor"])
set_label("lbln",["color","newcolor"])
LABEL SIZE s
L n [LABEL] SIZE s
set_label(["size",s])
set_label("lbln",["size",s])

where 1 <= s <= 100 and refers to the size of the text in points.

LABEL "new text"
L n [LABEL] "new text"
set_label_text("new text")
set_label_text("lbln","new text")

If the text contains any "\" characters then add the r qualifier before the string. For example set_label_text(r"y=\alpha^2").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

LABEL COORDS x y
L n [LABEL] COORDS x y
move_label(x,y)
LEVELS l1 ... lN
set_contour(["levels", [l1,...,lN]])
LIMITS X x1 x2
LIMITS Y y1 y2
LIMITS x1 y1 x2 y2
limits(X_AXIS, x1, x2)
limits(Y_AXIS, y1, y2)
limits(XY_AXIS, lo, hi)

The only way to change the limits on both axes at the same time is if the limits are the same. The AUTO symbol can still be used, so

limits(Y_AXIS, -1e5, AUTO)
will set the lower limit of the Y axis to 1e-5 and the upper limit to the maximum data value. The * symbol is not supported.

LINE x1 y1 x2 y2
add_line(x1,y1,x2,y2)

If you want a horizontal or vertical line you can also use the add_hline and add_vline routines.

LINE newcolor
LN n [LINE] newcolor
set_line(["color","newcolor"])
LINE newstyle
LN n [LINE] newstyle
set_line(["style","styleval"])

See the line style section for the mapping between newstyle and styleval.

LINE WIDTH w
LN n [LINE] WIDTH w
set_line(["thickness",w])

where 0.5 <= w <= 10.

LINE x1 y1 x2 y2
LN n [LINE] x1 y1 x2 y2

If the line is to be shifted, but not rotated or stretched, then the move_line routine can be used.

[AXIS|AXES] LINEAR
[AXIS|AXES] LINEAR X
[AXIS|AXES] LINEAR Y
lin_scale()
lin_scale(X_AXIS)
lin_scale(Y_AXIS)

linear_scale()
linear_scale(X_AXIS)
linear_scale(Y_AXIS)
LN n
current_line("linen")

So LN 2 becomes current_line("line2").

LN all
current_line("all")
LOCATION x1 x2 y1 y2
reposition_plot(x1,y1,x2,y2)

The order of the coordinates has changed.

[AXIS|AXES] LOG
[AXIS|AXES] LOG X
[AXIS|AXES] LOG Y
log_scale()
log_scale(X_AXIS)
log_scale(Y_AXIS)
PAGESIZE w h [unit]

One of:

set_preferences(["export.pagewidth", w,
                 "export.pageheight", h])
set_preferences(["export.pagewidth", w,
                 "export.pageheight", h,
                 "export.pageunits", "unit"])

The allowed values for the pageunits attribute are: cm, mm, inches, and pixels.

It is also possible to set the output page size using a paper size by setting the export.pagesize preference to one of: letter, legal, executive, a3, a4, and a5.

The orientation of the output is controlled by the export.orientation preference setting. The supported values are "landscape" and "portrait".

The export.fittopage and export.keepaspect preference settings control how the output page is filled, when the output and window sizes are different. Further information can be found in the Export section.

The attributes can also be over-ridden when calling print_window(), but only for ps and pdf output formats:

print_window("fig1", ["pagesize", "letter", "fittopage", True])
PICKPOINTS
PICKPOINTS n
pick(0)
pick(n)

The escape key is used to end the selection early (or when n is 0).

The get_pick routine returns the selected positions as Python arrays.

PLOTFONT GREEK|ITALIC|OLDENGLISH|ROMAN|TINY

There can now be multiple font types within a visualization. The choices are: helvetica, times, courier, and greek. There is only very-limited support for user-loaded fonts so only the in-built fonts will be considered here.

The preference settings for each font field have to be changed individually:

set_preferences(["label.font", f, "plot.title.font", f,
                 "axis.label.font", f, "axis.ticklabel.font", f])

where f is one of "helvetica", "times", "courier", or "greek".

To change all existing text within a visialization to a font f use:

set_cascading_property(chips_window, "font", f)

Individual values can also be changed. For example

set_label(["font","times"])
set_axis(["label.font","courier"])

Note that LaTeX commands to change the font within a label override the font setting - e.g. the string label2 below will remain as times (roman) whatever the font setting is changed to for the label.

add_label(5, 5, r"label1 \textrm{label2}")
PRINT
PRINT POSTFILE filename

One of:

print_window()
print_window("filename")

print_window("filename.ps")
print_window("filename.eps")
print_window("filename.pdf")
print_window("filename.png")
print_window("filename.jpg")
print_window("filename.jpeg")

If no filename argument is given then the output will be sent to your default printer. If no suffix is given then the format is taken from the export.format preference setting.

The export.* set of preferences can be used to adjust the output. So, to create a PNG version called plot.png:

print_window("plot.png")

or to change the output size to US letter (here it will create plot.ps as the default format is "ps").

print_window("plot", ["pagesize", "letter", "fittopage", True])
REDRAW
set_window(["display", True])

This does not exactly replicate the behavior of REDRAW, since it not only causes the update of the display but also leaves the redraw setting on. To update the display but make future changes hidden you need to turn the redraw setting back off.

REDRAW ON|OFF
set_window(["display", v])

where v is True for ON and False for OFF.

REDO
REDO n
redo()
redo(n)
RELSIZE [n] x
RELATIVESIZE [n] x

One of:

adgust_grid_yrelsize(n,x)
adgust_grid_xrelsize(n,x)

The row and column numbering - indicated by the n argument - starts at 1 at the top-left of the grid.

RESTORE filename
load_state("filename")

See the STORE command for information on changes to the format of the state file.

SPLIT [COLS] n
split(n)

You can also use the strip_chart routine if you need plots with bound axes (i.e. where the display range is the same in each plot for the shared axis).

SPLIT ncol nrow
split(nrow,ncol)

Note that the argument order has changed. The ordering of the plots has also changed, from top to bottom then left to right to left to right then top to bottom

If you wish to change the gaps between the rows or columns then you can use the four-argument form of the routine:

split(nrow,ncol,ygap,xgap)
SPLIT ncol nrow p
split(nrow,ncol)
current_plot("plotp")

Note that the argument order has changed.

SPLIT COLS a b ...x
add_frame()
col_grid_objects([a,b,...,x], xgap, ygap, 1)

The add_frame call is not needed if a frame already exists. The easiest way to check for this is to call get_frame() and see if an error message is created.

The second and third arguments refer to the x and y gaps to use between plots, respectively. So

col_grid_objects([3,2], 0.05, 0, 1)

adds a small horizontal gap between the two columns but no vertical space between the rows.

SPLIT GAP [X|Y] v

One of:

adjust_grid_xgap(v)
adjust_grid_ygap(v)
adjust_grid_gaps(v,v)
SPLIT LOCATION x1 x2 y1 y2
pr = ChipsPlot
pr.leftmargin = x1
pr.rightmargin = 1 - x2
pr.bottommargin = y1
pr.topmargin = 1 - y2
set_preferences(pr)

The plot.*margin preferences are used when deciding what parts of the frame to fill with a split. So, instead of calling SPLIT and then SPLIT LOCATION, you now change the preferences before calling split.

Note that the margin values indicate the distance from the edge, hence the need for 1-x2 and 1-y2 above.

STORE filename
make_script("filename")
save_state("filename")

The file(s) created by make_script() are in ASCII and so can be edited.

The file created by save_state() is in a binary format and is not human readable. It includes all the data needed to re-create the plot, as well as the command history, so you can use undo to step back through your changes.

TICKS [MAJ] [X|Y] v

One of:

set_axis(["majortick.interval", v,])
set_xaxis(["majortick.interval", v,])
set_yaxis(["majortick.interval", v,])
TICKS MIN [X|Y] v

One of:

set_axis(["minortick.interval",v,"minortick.mode","interval"])
set_xaxis(["minortick.interval",v,"minortick.mode","interval"])
set_yaxis(["minortick.interval",v,"minortick.mode","interval"])
TICKVALS [X|Y] ON|OFF

One of:

set_axis_ticklabel_visible(v)
set_axis_ticklabel_visible("ax1",v)
set_axis_ticklabel_visible("ay1",v)

where v is True for ON and False for OFF.

The whole axis - including label - can be hidden or displayed using the hide_axis and display_axis routines.

TICKVALS [X|Y] format|AUTO

One of:

set_axis(["tickformat",format])
set_xaxis(["tickformat",format])
set_yaxis(["tickformat",format])

where the default format is "%g" (e.g. if AUTO was specified).

Note that there are a number of improvements to the format support in ChIPS, including exponential notation (%z and %Z) and sexagesimal formats (ra and dec).

TITLE
TITLE "text"
set_plot_title("")
set_plot_title("text")

If the text contains any "\" characters then add the r qualifier before the string. For example set_plot_title(r"y=\alpha^2").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

TITLE newcolor
set_plot(["title.color","newcolor"])
TITLE SIZE b
set_plot(["title.size",b])

The size is now given in points and can be 1 <= n <= 100.

UNDO
UNDO n
undo()
undo(n)
XLABEL
XLABEL "text"
set_plot_xlabel("")
set_plot_xlabel("text")

If the text contains any "\" characters then add the r qualifier before the string. For example set_plot_xlabel(r"\Delta").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

XLABEL newcolor
set_xaxis(["label.color","newcolor"])
XLABEL [SIZE] n
set_xaxis(["label.size",n])

The size is now given in points and can be 1 <= n <= 100.

YLABEL
YLABEL "text"
set_plot_ylabel("")
set_plot_ylabel("text")

If the text contains any "\" characters then add the r qualifier before the string. For example set_plot_ylabel(r"\Delta").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

YLABEL newcolor
set_yaxis(["label.color","newcolor"])
YLABEL [SIZE] n
set_yaxis(["label.size",n])

The size is now given in points and can be 1 <= n <= 100.


Python commands equivalent to S-Lang routines

The following S-Lang routines have Python equivalents. Please note that the Python routines raise an error if there is a problem rather than returning 0 or -1.

curve(x,y);
curve(x,y,dy);
curve(x,y,dylo,dyhi);
curve(x,y,dxlo,dxhi,dylo,dyhi);

One of:

add_curve(x,y)
add_curve(x,y,dy)
add_curve(x,y,[dylo,dyhi])
add_curve(x,y,[dylo,dyhi,dxlo,dxhi])
chips_label(x,y,text);
chips_label(x,y,text,newcolor);
chips_label(x,y,text,newcolor,size);
chips_label(x,y,text,newcolor,size,angle);

One of:

add_label(x,y,text)
add_label(x,y,text,["color",newcolor,])
add_label(x,y,text,["color",newcolor,"size",s])
add_label(x,y,text,["color",newcolor,"size",s,"angle",a])

If the text contains any "\" characters then add the r qualifier before the string. For example add_label(2,5,r"y=\alpha^2").

See the Text Formatting documentation for the LaTeX-like commands suported by ChIPS.

As with the LABEL command the size value is now in points and is not a scaling factor.

chips_line(x1,y1,x2,y2);
chips_line(x1,y1,x2,y2,newcolor);
chips_line(x1,y1,x2,y2,newcolor,width);
chips_line(x1,y1,x2,y2,newcolor,width,newstyle);

One of:

add_line(x1,y1,x2,y2)
add_line(x1,y1,x2,y2,["color",newcolor,])
add_line(x1,y1,x2,y2,["color",newcolor,"thickness",w])
add_line(x1,y1,x2,y2,["color",newcolor,"thickness",w,"style","styleval"])

where 0.5 <= w <= 10 and see the line style section for the mapping between newstyle and styleval.

The add_hline() and add_vline() routines can be used to create horizontal or vertical lines respectively.

chips_split(ncol,nrow);

See the SPLIT ncol nrow command.

chips_split(ncol,nrow,p);

See the SPLIT ncol nrow p command.

chips_clear;

See the CLEAR command.

chips_redraw;

See the REDRAW command.

chips_auto_redraw;

See the REDRAW ON|OFF command.

a = chips_pickpoints;
a = get_pick()

The Escape key is used to terminate the process.

The return value is no-longer a single array with values stored as [x1,y1,x2,y2,...,xn,yn], but is a 3 or 4-element array, where

  1. a[0] contains the X coordinates
  2. a[1] contains the Y coordinates
  3. a[2] indicates what was pressed (e.g. mouse button, key)
  4. a[3] indicates what key was pressed (not created if only mouse presses were recorded.
a = chips_pickpoints(n);
a = get_pick(n)

The Escape key is used to terminate the process. See the chips_pickpoints() description for details on the format of the return value.

chips_set_xrange()
chips_set_yrange()

See the LIMITS command.

chips_get_xrange()
a = get_plot_xrange()

The return value is a 2-element array, in minumum, maximum order.

chips_get_yrange()
a = get_plot_yrange()

The return value is a 2-element array, in minumum, maximum order.

chips_set_xscale()
chips_set_yscale()

See the LOG and LINEAR commands.

chips_set_pane(n)
chips_set_drawing_area(n)
current_plot("plotn")

The chips.* preference settings

The number of preferences, and the system of setting them, have seen significant changes in CIAO 4, as discussed in the preferences ahelp documentation.

The mapping from old to new preference names is:

CIAO 3 CIAO 4
chips.curvestyle curve.line.style
chips.symbolstyle curve.symbol.style
chips.linestyle line.style
chips.curvecolor curve.line.color
chips.symbolcolor curve.symbol.color
chips.linecolor line.color
chips.linewidth line.thickness
chips.symbolsize curve.symbol.size
chips.font label.font
chips.font axis.label.font
chips.font axis.ticklabel.font
chips.font plot.title.font
chips.colorsys export.colorscheme
chips.pagewidth export.pagewidth
chips.pagelen export.pageheight
chips.unit export.pageunits
chips.padfactor axis.pad
chips.lowerloglimit axis.logminimum

The following fields are either not supported or no-longer relevant: chips.undo, chips.savevars, chips.tmpdir, chips.tmpdata, chips.fullautolimits, and chips.mingridsize.

It is possible to override the preference settings when creating an object; such overrids only affect the created object and not the preference values themselves. So

add_curve(x,y,["line.color","red","symbol.style","none"])

will draw the curve with a red line and no symbols, but will not change the curve.line.color and curve.symbol.style preference settings.

An alternative way to make these changes is to use the ChipsXXX objects rather than a list of name,value pairs as above:

ci = ChipsCurve()
ci.line.color = "red"
ci.symbol.style = "none"
add_curve(x, y, ci)

It is still possible to create an object and then change its properties, and this can use a list, dictionary, or object approach:

add_curve(x,y)
set_curve(["line.color", "red", "symbol.style", "none"])

or

add_curve(x,y)
set_curve({"line.color": "red", "symbol.style": "none"})

or

add_curve(x,y)
ci = ChipsCurve()
ci.line.color = "red"
ci.symbol.style = "none"
set_curve(ci)

Unsupported commands

The following commands are not supported in the new version of ChIPS. Alternatives are given where possible.

C n:m
C a,b,...,x

Only one curve or all curves can be current at any one time. The code will have to be re-written to work on each curve individually.

CURVE DATA filename ...
PLOT DATA filename ...

This option is not supported. Errors must be given when the curve is created.

[CURVE] SCALE [X|Y] value

There is no way to change the data values once they have been plotted. The data has to be scaled prior to plotting, so

CURVE "foo.fits[cols X,Y]"
SCALE Y 2

would become

tbl = read_file("foo.fits")
x = copy_colvals(tbl,"X")
y = copy_colvals(tbl,"Y")
add_curve(x,y*2)
[CURVE] STEP

In the old ChIPS command langauge the CURVE command could be used to plot (x,y) values as a histogram by using the STEP connector style. The new language treats histograms as a separate type of visualization.

The data should therefore be plotted using the add_histogram routine instead of add_curve. So

CURVE "hist.fits[cols xmid,y]"
STEP

becomes

add_histogram("hist.fits[cols xmid,y]")
D n:m
D a,b,...,x

Only one plot or all plots can be current at any one time. The code will have to be re-written to work on each plot individually.

DEBUG [on|off]
EDITMODE ...
ERRS [X|Y] linestyle

It is not possible to change the line style of error bars. They are always drawn using a solid line.

ERRS [X|Y] ABSOLUTE|RELATIVE

All errors are given as relative values.

L n:m
L a,b,...,x

Only one label or all labels can be current at any one time. The code will have to be re-written to work on each label individually.

LN n:m
LN a,b,...,x

Only one line or all lines can be current at any one time. The code will have to be re-written to work on each line individually.

PACK ...

Once an object has been created its name - such as crv1 for a curve - can not be changed.

SKIP n

Use the data model filter #row=... to restrict the rows read in from a file.

SPLIT GAP [X|Y] n v

There is no way to change the spacing of plots in a given column or row.

SPLIT MAJ X|Y

This command is no longer required as the individual routines allow you to work with rows or columns. So

SPLIT 2
SPLIT MAJ Y

becomes

split(1,2)
SURFACE ...

Surface plots are not supported in CIAO 4.7.

TICKVALS [SIZE] [X|Y] s

There is no equivalent command since the scaling of axis elements is handled differently.

The label sizes are now given in points and can be changed with the "label.size" and "ticklabel.size" attributes of an axis.

The length of the major and minor tick marks are controlled by the "majortick.length" and "minortick.length" attributes of an axis.

TYPE
VERBOSE
VIEWPOINT ...
ZLABEL ...
Any command referring to the Z axis

Unsupported S-Lang routines

The following routines are not available in CIAO 4.

chips_get_label()
chips_get_pane()
chips_get_drawing_area()

Use the info_current routine to find out the selected objects.

chips_color_name()
chips_color_value()

The number of colors available in ChIPS has significantly increased in CIAO 4.

chips_eval()
chips_get_xscale()
chips_get_yscale()
chips_get_zrange()
chips_get_zscale()
chips_set_zrange()
chips_set_zscale()

Last modified: 26 October 2016
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.