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

Skip the navigation links
Last modified: 21 September 2006
Hardcopy (PDF): A4 | Letter

Why are some Sherpa commands case-sensitive, while others aren't?


Commands entered at the Sherpa prompt fall into three categories: "pure" Sherpa commands (i.e. commands handled directly by the Sherpa parser); ChIPS commands, which are passed to the ChIPS parser; and S-Lang statements, which are handled by the S-Lang interpreter.

The Sherpa and ChIPS parsers handle commands in a case-insensitive fashion. For example, the SHOW command is processed directly by the Sherpa parser, so you can enter it in any case:

sherpa> show statistic
Statistic:           Chi-Squared Gehrels
sherpa> SHOW statistic
Statistic:           Chi-Squared Gehrels
sherpa> sHoW statistic
Statistic:           Chi-Squared Gehrels

On the other hand, the names of S-Lang functions and variables are case-sensitive, and changing their capitalization will generate a Parse Error/Undefined Name message. For example, list_par is a S-Lang function defined in the Sherpa S-Lang module, and its name must be entered in lower case:

sherpa> list_par
  #  Name Type       Value Lnk Frz         Min         Max       Delta
  1 cs.c0  src           1   0   0           0  3.4028e+38          -1
sherpa> LIST_PAR
Parse Error/Undefined Name: LIST_PAR;

Although S-Lang names can contain both upper and lower-case letters, the names of all functions and variables in the Sherpa module are strictly lower-case. Hence, if you are uncertain whether a command is actually a S-Lang function, typing it in lower-case is the safest approach.



Hardcopy (PDF): A4 | Letter
Last modified: 21 September 2006


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.