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 2007

URL: http://cxc.harvard.edu/sherpabeta/load_data.py.html
AHELP for Sherpa 4.0 Beta load_data Context: py.sherpa

Synopsis

Load a data file

Syntax

load_data( [id=1], filename, [options] )

Description

The load_data() command tries to load the data in the following order: load_pha, load_table, and load_ascii. It acts as a catch-all command for when the user is unsure of which load function to use.

For available options, refer to the help files for the individual load commands.

Example

sherpa> load_data("data.txt")
sherpa> load_data("bkg", "bkg.txt", ncol=3)
sherpa> load_data(1, "data.txt", colkeys=["x", "y", "staterror"])
sherpa> load_data("data.txt", sep="\t")
sherpa> load_data("data.txt", colkeys=["xlo", "xhi", "y", "stat_err"],
dstype=Data1DInt)
sherpa> load_data("data.txt", colkeys=["col1", "col3", "col2"])

The load_data function can be called with just a filename and path argument, in which case all the default arguments will be used. In this case, two columns from the text file will be read into a Data1D data set as "x" and "y". The user can specify which columns to read from the file by their column names in the order as they correspond to the data arrays in the data set. If no columns names are present, defaults will be assigned. (e.g., "col1", "col2", ...) The default data set, Data1D, uses the order: x, y, staterror, syserror for data arrays. Data set IDs can be integers or strings; in the latter case a string can denote useful information about the data (e.g., whether it is your source or background data set).

Bugs

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

Last modified: December 2007



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.