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

Synopsis

Module functions for assigning source and background error estimates.

Syntax

Integer_Type set_errors([Integer_Type,]Array_Type)
Integer_Type set_berrors([Integer_Type,]Array_Type)

Success/Error Return Values: 1/0

Arguments:

(1) Dataset number (default 1)

(2) An array of source/background error estimates

Note that if only one argument is provided, it is assumed to be an
array, and the dataset is assumed to be dataset 1.

Description

The set_errors and set_berrors functions allow the user to assign new source and background error estimates to Sherpa datasets.

Note that:

  • Any errors that are assigned via set_errors replace the error estimates that Sherpa makes automatically using the current STATISTIC setting, and are used until the errors are explicitly redefined.
  • The input array length must match the number of bins in the filtered dataset; consequently, if one's goal is to use these functions in data manipulation, it is important not to change the filter in Sherpa between any call to, e.g., get_errors and set_errors!
  • The input array is typecast to match the type of its associated dataspace (see, e.g., set_axes for a definition of dataspaces). For instance, if dataset 3 is of Double_Type, then when set_errors(3,<array>) is run, the array is typecast to Double_Type if necessary.

See the related Sherpa commands ERRORS and BERRORS for more information.

Example

Cause Sherpa to perform a least-squares fit:

sherpa> DATA spec.dat
sherpa> d = get_data()
sherpa> d[*] = 1
sherpa> () = set_errors(,d)

In this example, an array of the length of the filtered data is retrieved from Sherpa, and all elements of the array are reset to 1. This new array is then sent to Sherpa, where it overwrites the old array of error estimates.

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.