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

Skip the navigation links
Last modified: 21 September 2006

URL: http://cxc.harvard.edu/sherpa3.4/bugs/so_output.html
Hardcopy (PDF): A4 | Letter

State Object Bugs: sherpa.output


Bugs

  1. Precision field in sherpa.output state object


Bugs

  1. Precision field in sherpa.output state object

    The ahelp file for the sherpa.output state object says that the precision field is "number of digits after decimal point." This works correctly when results are printed to the screen:

    sherpa> sherpa.output.precision = 2
    sherpa> write data
    Write X-Axis: Bin Y-Axis: Flux (Counts)
           -0.5 1.39
            0.5 1.81 
    

    When they are written to a file, however, they are incorrectly truncated:

    sherpa> sherpa.output.precision=2
    sherpa> write data prec_2.dat ascii
    Write X-Axis: Bin Y-Axis: Flux (Counts)
    
    unix% cat prec_2.dat
           -0.5 1.4
            0.5 1.8
            1.5 2.3
    

    Workaround:

    set the precision to be one step higher than the desired number of decimal places:

    sherpa> sherpa.output.precision=3
    sherpa> write data prec_3.dat ascii
    Write X-Axis: Bin Y-Axis: Flux (Counts)
    
    unix% cat prec_3.dat
           -0.5 1.39
            0.5 1.81
            1.5 2.26
    
Hardcopy (PDF): A4 | Letter
Last modified: 21 September 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.