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

Synopsis

Load data into a table model by data set ID

Syntax

load_table_model( name, tbl_filename,
[ncols=2,colkeys=[],dstype=Data1D] )
load_table_model( name, TABLECrate, [ncols=2,colkeys=[],dstype=Data1D] )
load_table_model( name, PyFITS HDUList,
[ncols=2,colkeys=[],dstype=Data1D] )
load_table_model( name, img_filename, [coord="logical"] )
load_table_model( name, IMAGECrate, [coord="logical"] )
load_table_model( name, PyFITS HDUList, [coord="logical"] )

Description

The load_table_model() function is used to read data from a file and assign it to an instance of the table model class. It can load 1D data from a FITS table with a single column (or specified column), ASCII table data, and 2D data from a FITS image file.

Example

sherpa> load_table_model("expmap", "img.fits")
sherpa> load_table_model("expmap", crate)
sherpa> load_table_model("expmap", hdulist)
sherpa> load_table_model("mymodel", "tbl.fits", ncols=2)
sherpa> load_table_model("expmap", crate, colkeys=["X","Y"])
sherpa> load_table_model("expmap", hdulist, ncols=2)

The load_table_model function can be called with an identifier and a filename and path argument, in which case all the default arguments will be used depending on the file's type. In both cases, the image or table will be read into a model that can be combined arithmetically with the source model. In the table case, 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. The dependent array from the image or table will be used as the table model values. 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, PSF, or exposure map 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.