| 
 
Retrieve a fluxed spectrum (counts divided by ARF) using module
functions in Sherpa.
 
Struct_Type get_fluxed_spectrum([Integer_Type])
Error Return Value: NULL
Arguments:
(1) data set number (default 1) 
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()). 
 
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
 
chandra
guide
sherpa
get_analysis,
get_arf_axes,
get_axes,
get_coord,
get_data,
get_energy_axes,
get_errors,
get_filter,
get_filter_expr,
get_fit,
get_ftest,
get_metadata,
get_photon_axes,
get_photon_energy_axes,
get_photon_wave_axes,
get_qvalue,
get_raw_axes,
get_record,
get_source,
get_statistic,
get_stats,
get_syserrors,
get_wave_axes,
get_weights,
record,
save,
write
 |