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

Synopsis

Retrieve a fluxed spectrum (counts divided by ARF) using module functions in Sherpa.

Syntax

Struct_Type get_fluxed_spectrum([Integer_Type])

Error Return Value: NULL

Arguments:

(1) data set number (default 1)

Description

This function takes the appropriate data set and divides it by the ARF, if the data are counts (PHA) data and information from an ARF file has also been read in. The function returns a S-Lang variable of Struct_Type containing the counts data divided by the ARF (data), the Poisson errors divided by the ARF (errors), and (in a future version) the ARF itself, estimated on the counts space energy/wavelength grid (arf).

The data and errors arrays can then be used directly in analyses (after using set_data() and set_errors()), or can be modified further by the user (e.g., converted from cts cm^-2 to cts cm^-2 s^-1 using get_exptime()).

Example

Obtain the fluxed spectrum and make a plot of the spectrum, include errorbars. Finally write fluxed spectrum to the ascii file.

sherpa> foo = get_fluxed_spectrum
sherpa> print(spec1)
data             =  Float_Type[663]
errors           =  Float_Type[663]
arf              =  Float_Type[663]
sherpa> xax=get_energy_axes             
                                # obtain the energy scale
sherpa> print(xax)
axistype         =  Energy
axisunits        =  keV
lo               =  Float_Type[663]
hi               =  Float_Type[663]
mid              =  NULL

sherpa> plot x xax.lo y spec1.data e spec1.errors   
                               # this is CHIPS plot command

sherpa> writeascii("fluxed_spec.dat",x.lo, x.hi, spec1.data, 
spec1.errors, spec1.arf)

sherpa> $more fluxed_spec.dat
0.3066  0.3212  0.638139        0.172438        32.8455
0.3212  0.3358  0.249041        0.0901943       52.2003
0.3358  0.3504  0.163455        0.0657966       67.2967
0.3504  0.365   0.206631        0.0633644       82.2723
0.365   0.3796  0.213993        0.0594795       93.3986

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.