About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 15 May 2008

URL: http://cxc.harvard.edu/chips4.0/lang.html
Hardcopy (PDF): A4 | Letter

Should I Use ChIPS in Python or S-Lang?


ChIPS can be run in two different languages: S-Lang and Python. There is no difference in the results obtained from either version, just a few syntax differences in the commands used. Compare these two commands:

# Python
set_curve(["line.color","olive", "symbol.size", 2])

% S-Lang
set_curve({"line.color","olive", "symbol.size", 2});

All ChIPS S-Lang commands end in a semicolon (;) and Python commands do not. Python uses square brackets ([]) and S-Lang uses curly ones ({}). Python comments are denoted by the pound sign (#), while S-Lang comments use percent (%). The syntax is otherwise identical. (There are other differences between the S-Lang and Python languages; this list is limited to ChIPS syntax.)

Some users will have a clear reason to choose Python over S-Lang, or vice-versa:

  • If you have experience scripting with one of the languages or use other programs written in it, use that version.

  • If the science community at your institution favors Python or S-Lang, choose the one for which local support is available.

Otherwise, you can try both versions and determine which you prefer using. The Starting ChIPS thread explains how to run ChIPS with either language.

Hardcopy (PDF): A4 | Letter
Last modified: 15 May 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.