Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/script.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 Sherpa v1

script

Context: saving

Synopsis

Save every command typed in a Sherpa or ChIPS session to a file.

Syntax

script([filename="sherpa.log", clobber=False])

Description

The script function saves every command typed in a Sherpa session to the file specified in the 'filename' argument; by default, the file "sherpa.log" is used. Note that this command saves only the existing history of the session - i.e., everything typed up until the script command is called - and does not log new commands.

The script command is also available in ChIPS. In that program, the default filename is "chips.log".

  • filename - the name of the file to write; default = sherpa.log
  • clobber - Boolean to specify if existing 'filename' should be overwritten; default = False

Example 1

sherpa> script("sherpa_session1.log", clobber=False)

This command will record *everything* typed at the command line in a Sherpa session to the file "sherpa_session1.log", unless this filename already exists in the current working directory.

Setting clobber=True overwrites "sherpa_session1.log":

sherpa> script("sherpa_session1.log")
IOError: script file sherpa_session1.log exists and clobber is not set.

sherpa> script("sherpa_session1.log", True)

Example 2

sherpa> script()

When issued with no arguments, the 'script' command writes to "sherpa.log"; clobber is turned off by default.

sherpa> script()      # sherpa.log created

sherpa> script()
IOError: script file sherpa.log exists and clobber is not set.

Bugs

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

See Also

contrib
save_chart_spectrum
modeling
save_model, save_source
saving
restore, save, save_all, save_arrays, save_data, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_quality, save_resid, save_staterror, save_syserror, save_table

Last modified: December 2013
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.