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

Synopsis

Calculate the k correction for a spectral model, redshift, and energy range.

Syntax

kcorr = calc_kcorr( dnum, z, obslo, obshi );
kcorr = calc_kcorr( dnum, z, obslo, obshi, restlo, resthi );

Description

The routine is loaded into Sherpa with the call

  require ("sherpa_utils");

calc_kcorr(dnum,z,obslo,obshi)

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

obslo <= energy < obshi

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.

calc_kcorr(dnum,z,obslo,obshi,restlo,resthi)

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.

Example 1

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

Example 2

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.

Example 3

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.

NOTES

Please see "ahelp sherpa_utils" for information on how to load these routines into Sherpa.

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.