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_dataset.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 load_dataset Context: sherpa

Synopsis

Module function to load data into Sherpa

Syntax

Integer_Type load_dataset([Integer_Type], {String_Type | Struct_Type |
Array_Type}, [,Array_Type, ...])

Success/Error Return Values: 1/0

Arguments:

(1) Data set number (default 1)

(2) File name, or

(2) S-Lang variable of Struct_Type (e.g., type of variable returned by
VARMM readfile()), or

(2) S-Lang variable of Array_Type

(3) More S-Lang variables of Array_Type

Description

This function acts as a wrapper around the filetype-specific load functions (e.g., load_ascii, load_pha, etc.). If a file name is provided, then the data are read in via the VARMM library readfile() function. If a S-Lang variable of Struct_Type is provided, then the data are loaded from the fields of that variable. If one or more S-Lang variables of Array_Type are provided, then the data are passed to the functions set_axes() and set_data(). A maximum of 8 arrays, for for data of up to 7 dimensions, can be passed as arguments of Array_Type.

See the related Sherpa command READ for more information.

Example 1

sherpa> () = load_dataset(,"example.dat")
sherpa> () = load_dataset(1,"example.pha")

These two commands are equivalent; both load data from file into data set 1. In the first case, data are loaded from an ASCII file, and in the second, data are loaded from a PHA file; load_dataset() calls the appropriate function to read from ASCII and FITS files respectively.

Example 2

sherpa> foo = readfile("example.pha")
sherpa> () = load_dataset(1,foo)
sherpa> () = load_dataset(1,foo.channels, foo.counts)

Here the data are loaded into a S-Lang variable of Struct_Type. In the first call to load_dataset(), this S-Lang variable is passed to the function. In the second call, two arrays are passed to load_dataset(). The data in ``foo.channels'' and ``foo.counts'' are used as the x and y arrays respectively; but the other fields of the variable ``foo'' are not used. This means the second call to load_dataset() is not quite the equivalent of the first.

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.