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

Synopsis

Module functions to retrieve photon-space energy grids over which models are evaluated.

Syntax

{Struct_Type | Array_Type} get_photon_energy_axes([Integer_Type])
{Struct_Type | Array_Type} get_photon_energy_baxes([Integer_Type])
{Struct_Type | Array_Type} get_full_photon_energy_axes([Integer_Type])
{Struct_Type | Array_Type} get_full_photon_energy_baxes([Integer_Type])

Error Return Value: NULL

Arguments:

(1) data set number (default 1)

Description

In Sherpa parlance, a ``dataspace'' is an N-dimensional grid defined by the independent variables of the dataset (i.e., x_i in the expression y = f(x_0, x_1,...,x_(N-1))). Simple examples include the CHANNELS array in PHA datasets and the pixel numbers along each axis of FITS images.

The get_photon_energy_axes() function retrieves the dataspace, or filtered data set axes of the appropriate data set (if no argument is given, the axes for data set 1 are retrieved). Regardless of the current Sherpa ANALYSIS setting, this function returns the dataspace in units of energy (keV). However, the dataspace is also translated into ``photon space''. The get_energy_axes() function returns the dataspace in ``energy space''. In essence, ``photon space'' is what one would see if one could undo the redistribution of energies by the detector. (One can't really ``deconvolve'' the data in this manner with any confidence, but for the purposes of visualization only, the data from the appropriate RMF and ARF files are used to estimate what the data would look like after a ``deconvolution''.)

Thus, for example, if one is working with filtered PHA data in energy-space, what is returned are the low and high bin boundaries in keV (quantities assigned, e.g., by the ENERG_LO and ENERG_HI columns of the ARF). But if one is working in wavelength-space or channel-space, the bin boundaries returned are still in keV. These boundaries generally do not match the boundaries that would be returned by get_energy_[b]axes().

(The function get_photon_energy_baxes() acts as get_photon_energy_axes(), save that it retrieves the dataspace for the background associated with the appropriate data set.)

One may display photon-space model amplitudes et al. on the same grid output by get_photon_axes using the Sherpa plotting commands LPLOT SOURCE et al.

Example

Read the PHA file with the ARF/RMF defined in the header (qso.pha). Define the model, filter the data and fit.

sherpa> data qso.pha
sherpa> foo0=get_photon_energy_axes()
sherpa> print(foo0)                  
NULL
sherpa> source = xsphabs[abs]*pow[p1]
abs.nH parameter value [0.1] 
p1.gamma parameter value [1] 
p1.ref parameter value [1] 
p1.ampl parameter value [0.00059008] 
sherpa> 
sherpa> ignore energy :0.2,10:
sherpa> fit
 LVMQT: V2.0
 LVMQT: initial statistic value = 297162
 LVMQT: final statistic value = 275.333 at iteration 7
           abs.nH  0.0245136  10**22 atoms/cm**2  
            p1.gamma  1.53707     
            p1.ampl  5.91298e-05     

Obtain the photon energy axes information into "fooO" and print content of "foo0". Print the value of the 11th low energy in "foo0". The mid is NULL, so the final print command gives an error information.

sherpa> foo0=get_photon_energy_axes()
sherpa> print(foo0)                  
axistype         =  Energy
axisunits        =  keV
lo               =  Float_Type[1077]
hi               =  Float_Type[1077]
mid              =  NULL
sherpa> print(foo0.lo[10])
0.33
sherpa> print(foo0.mid[10])
Type Mismatch: Context requires an array.  Scalar not converted
Type Mismatch: print(foo0.mid[10]);

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.