Calculate the k correction for a spectral model, redshift, and
energy range.
kcorr = calc_kcorr( dnum, z, obslo, obshi );
kcorr = calc_kcorr( dnum, z, obslo, obshi, restlo, resthi );
The routine is loaded into Sherpa with the call
require ("sherpa_utils");
Calculates the k correction for the model spectrum
associated with dataset number dnum (an integer >=1)
when at redshift z for the energy range obslo to obshi.
The energy range is taken to be
with the energies being in keV.
The redshift (z) parameter can be a scalar or a 1-D array; the return
value matches that of z. If it is an array then the
k correction will be evaluated for each redshift in the array.
If any component of the source model has a redshift parameter
then it should be set to 0 before calling this routine.
See the
"Calculating k-corrections" thread
for more information on this function.
As the previous version of calc_kcorr() but this time
we calculate the k correction from the observed energy range obslo to obshi
to the rest frame energy range restlo to resthi.
sherpa> paramprompt off
Model parameter prompting is off
sherpa> source = xsmekal[clus]
sherpa> set_dataspace(1,0.01,10,0.01)
sherpa> calc_kcorr(1,0.5,0.5,2)
1.06175
sherpa> calc_kcorr(1,0.5,0.5,2,2,10)
0.113007
Here we set up a source model called clus which uses
the XSMEKAL model for dataset number 1.
The parameter values are not prompted for and
so left at their default values (it is important
that the redshift parameter of the model
is left at 0).
The set_dataspace() command is used to set the
X-axis for the model to be 0.01 to 10 keV with
a grid step of 0.01 keV.
The calc_kcorr() routine is then used to calculate
the k correction if the source were at a redshift
of 0.5 for two cases:
- for the 0.5-2.0 keV band
- to convert from the observed 0.5-2.0 keV band to
the rest-frame 2-10 keV band
sherpa> sherpa.modeloverride = 1
sherpa> paramprompt off
Model parameter prompting is off
sherpa> source = xsmekal[clus]
sherpa> clus.kt = 6
sherpa> clus.abund = 0.3
sherpa> set_dataspace(1,0.01,10,0.01)
sherpa> calc_kcorr(1,0.5,0.5,2)
0.824037
sherpa> set_dataspace(1,0.01,10,0.1)
sherpa> calc_kcorr(1,0.5,0.5,2)
0.800428
Here we use the same model as in the previous example
but change the kT parameter to 6 keV
and the Abund parameter to 0.3 before calculating
the k corrections.
The 0.5-2.0 keV correction factor for a source at
redshift 0.5 is calculated - the difference in parameter values
of the model lead to a smaller k-correction value.
The grid size of the dataspace is then changed from 0.01 to
0.1 keV and the k correction re-calculated to highlight
that the correction is dependent on the grid size.
sherpa> sherpa.modeloverride = 1
sherpa> paramprompt off
Model parameter prompting is off
sherpa> source = xsmekal[clus]
sherpa> clus.kt = 6
sherpa> clus.abund = 0.3
sherpa> set_dataspace(1,0.01,10,0.01)
sherpa> calc_kcorr(1,0.5,0.5,2)
0.824037
sherpa> clus.kt = 10
sherpa> calc_kcorr(1,0.5,0.5,2)
0.788313
sherpa> clus.kt = 4
sherpa> calc_kcorr(1,0.5,0.5,2)
0.866314
Here we show the k correction being calculated for
three different temperatures: 6, 10, and 4 keV.
Please see "ahelp sherpa_utils" for information on
how to load these routines into Sherpa.
- chandra
-
guide
- sherpa
-
bye,
dataspace,
dcounts,
dollarsign,
echo,
eflux,
eqwidth,
erase,
flux,
get,
get_dcounts_sum,
get_dir,
get_eflux,
get_eqwidth,
get_filename,
get_flux2d,
get_flux_str,
get_lfactorial,
get_mcounts_sum,
get_pflux,
get_source_components,
get_verbose,
groupbycounts,
guess,
is,
journal,
list,
list_par,
mcounts,
numbersign,
paramest,
plot_eprof,
plot_rprof,
prompt,
reset,
run,
set,
set_analysis,
set_axes,
set_coord,
set_dataspace,
set_dir,
set_verbose,
setplot,
sherpa-module,
sherpa_plotfns,
sherpa_utils,
show,
simspec,
use,
version
|