About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 28 July 2009

URL: http://cxc.harvard.edu/sherpa4.1/bugs/atten.html

Bugs: atten


Bugs

  1. 'atten' model parameter values are erroneously returned in energy units.


Bugs

  1. 'atten' model parameter values are erroneously returned in energy units.

    Currently, the Sherpa atten (S-Lang or Python help) model erroneously returns model parameter values in energy units, as the internal grid of this model is defined in Angstroms; this will be fixed in a future release. This is the case even if the command set_analysis("wave") (S-Lang or Python help) has been issued.

    Workaround:

    The (Python) workaround involves defining a Sherpa user model which allows atten to be used in wavelength analysis. The user model "atten_wave" is defined in the following example, and is assigned an ID of "abs1". For more on Sherpa user models, see the thread "Sherpa User Models" (S-Lang or Python).

    sherpa> set_analysis("wave")
    sherpa> hc = 12.39841874  #in [keV-Angstrom]
    sherpa> dummy = atten.dummy
    sherpa> dummy.integrate = False
    sherpa> def atten_wave(p, *energ_args, **kwargs):
                wave_args = [hc/arg for arg in energ_args[::-1]]
                return dummy.calc(p, *wave_args, **kwargs)
    
    sherpa> load_user_model(atten_wave, "abs1")
    sherpa> add_user_pars("abs1", ['hcol','heiRatio','heiiRatio'],
                  [dummy.hcol.val,dummy.heiRatio.val,dummy.heiiRatio.val],
                  [dummy.hcol.min,dummy.heiRatio.min,dummy.heiiRatio.min],
                  [dummy.hcol.max,dummy.heiRatio.max,dummy.heiiRatio.max],
                  [dummy.hcol.units,dummy.heiRatio.units,dummy.heiiRatio.units],
                  [False,False,False])
    
    sherpa> set_model(abs1)
    sherpa> fit()
    
Last modified: 28 July 2009


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.