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_table.py.html
AHELP for Sherpa 4.0 Beta load_table Context: py.sherpa

Synopsis

Load data by data set ID

Syntax

load_table( [id=1], filename, [ncols=2,colkeys=[],dstype=Data1D] )
load_table( [id=1], TABLECrate, [ncols=2,colkeys=[],dstype=Data1D] )
load_table( [id=1], PyFITS HDUList, [ncols=2,colkeys=[],dstype=Data1D] )

Description

Load a FITS table or tabular data from column-based text file given a filename and path, or a TABLECrate object, or a PyFITS HDUList object into a data set by data set ID.

The load_table command can be given the names of specific columns in the file to load:

load_table("profile.fits[cols RMID, SUR_BRI, SUR_BRI_ERR]")

Example

sherpa> load_table("tbl.fits")
sherpa> load_table("psf", "kernel.txt", ncol=3)
sherpa> load_table(1, "tbl.fits", colkeys=["x", "y", "staterror"])
sherpa> load_table("radpro.fits", colkeys=["R", "SUR_BRI",
"SUR_BRI_ERR"], dstype=Data1DInt)
sherpa> load_table("tbl.fits", colkeys=["col1", "col3", "col2"])

The load_table 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 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 PSF 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.