chart_spectrum.sl - Create a source spectrum for input to ChaRT
write_chart_spectrum("output_file.dat",[min_energy],[max_energy])
plot_chart_spectrum(min_energy,max_energy)
If you use a spectrum file as the spectral specification for
your PSF when running ChaRT, you will need to use the script
chart_spectrum.sl.
It is assumed that the spectral data have been fit in Sherpa
before chart_spectrum.sl is run. For help with fitting, see
the Fitting PHA Spectra thread.
The script is run from within Sherpa ("ahelp sherpa"), as
shown in the example. To load the script:
sherpa> () = evalfile("chart_spectrum.sl")
This step is only necessary once per Sherpa session.
The first argument to write_chart_spectrum is the name of the
spectrum file to create. (If the file already exists, it will
be overwritten.) The other arguments specify the minimum and
maximum energies to include in the spectrum. If the bounds are
omitted, the full energy range (as determined by Sherpa) will
be used.
The output produced by write_chart_spectrum is an ASCII file
that contains two columns. The first column gives the center
of the energy bin in [keV]. The second column is the flux in
[photons/cm2/s].
If you would like to plot your spectrum, use the function
plot_chart_spectrum.
This script is used in the Preparing to Run ChaRT thread.
sherpa> write_chart_spectrum("source_flux_chart.dat",1.0,8.0)
Create a spectrum file named "source_flux_chart.dat" over
the range 1-8 keV.
sherpa> plot_chart_spectrum(1.0,8.0)
Plot the spectrum over the range 1-8 keV.
- 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_fluxed_spectrum,
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
|