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 2008

URL: http://cxc.harvard.edu/sherpa4.1/load_data.sl.html
AHELP for Sherpa 4.1

load_data

Context: sl.sherpa

Synopsis

Load 1D data from a file

Syntax

load_data( [id], filename; [options] );

Description

The load_data command is a filetype-independent method of loading 1D data from a file (e.g. if the file-specific load command is unknown or if the filetype is unknown). It tries to load the file in the following order: load_pha, load_table, and load_ascii.

  • id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
  • filename - the name of the file (with path) which contains the data

If the filetype is known, file-specific options may be included in the load_data command. They are:

  • load_pha: use_errors
  • load_table: ncols, colkeys, and dstype
  • load_ascii: ncols, colkeys, sep, comment, and dstype

Refer to the individual command ahelp files for specifics on the options.

Example 1

sherpa> load_data("data.filtered");

Using the default settings, load a data file into Sherpa.

Example 2

sherpa> load_data("src", "data.txt"; ncols=3);

Load the first three columns of data.txt, using the dataset id "src". This example could also have been done using the load_ascii command.

Example 3

sherpa> load_data("src", "source.pha");

Data is loaded from the file source.pha with data id "src". This example could also have been done using the load_pha command.

Example 4

sherpa> load_data("rprofile_mid.fits[cols RMID,SUR_BRI,SUR_BRI_ERR]");
sherpa> load_data("rprofile_mid.fits";
colkeys=["RMID","SUR_BRI","SUR_BRI_ERR"]);

These commands are equivalent ways of loading x=RMID, y=SUR_BRI, and staterror=SUR_BRI_ERR from rprofile_mid.fits, a radial profile for which the midpoint of the annular regions has been calculated. This example could also have been done using the load_table command.

Bugs

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

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