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

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/load_pha.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 load_pha Context: sherpa

Synopsis

Module function to load source and background data from PHA Type I files into Sherpa

Syntax

Integer_Type load_pha([Integer_Type], {String_Type | Struct_Type})
Integer_Type load_bpha([Integer_Type], {String_Type | Struct_Type})

Success/Error Return Values: 1/0

Arguments:

(1) Data set number (default 1)

(2) PHA Type I filename, or

(2) S-Lang variable output by readpha()

Description

The function load_pha() loads data from a PHA Type I file into a Sherpa data set. The function load_bpha() loads data from a PHA Type I file into the background associated with a Sherpa source data set. (The brackets indicate an optional letter in the function name, with ``[b]'' representing functions to use with background data. Note that background functions currently assume that the setting of multiback in the Sherpa state object is 0, i.e., that only one background dataset is allowed per source dataset.)

If the file contains the header keywords BACKFILE, RESPFILE, and/or ANCRFILE, the background, RMF, and/or ARF file contents are automatically read in as well. (BACKFILE is ignored for load_bpha.)

See the related Sherpa command READ for more information.

Example 1

sherpa> () = load_pha(,"example.pha")
sherpa> () = load_pha(1,"example.pha")
sherpa> () = load_bpha(,"example.pha")
sherpa> () = load_bpha(1,"example.pha")

The first two commands will load data from the PHA Type I file into Sherpa source data set 1. The last two commands will load data from the PHA Type I file into the background associated with Sherpa source data set 1.

Example 2

sherpa> foo = readpha("example.pha")
sherpa> () = load_pha(1,foo)

Here the data are read into the S-Lang variable ``foo''. The load_pha() function then reads the data from arrays which are part of the variable ``foo''.

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

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