Skip to the navigation links
Last modified: 1 November 2022

URL: https://cxc.cfa.harvard.edu/sherpa/bugs/save_pha.html

Bugs: save_pha


Bugs

save_pha command fails with fake_pha input

In CIAO 4.4, the Sherpa save_pha command will fail if an attempt is made to write simulated PHA data to file, specifically the output of the fake_pha command.

sherpa> set_source(1, "xsphabs.abs1*xspowerlaw.p1")
sherpa> set_par(abs1.nH, val=0.07, frozen=True)
sherpa> p1.PhoIndex = 0.8
sherpa> fake_pha(1, "source.arf", "source.rmf", 50000)
sherpa> save_pha(1, "simulation1.pha")
AttributeError: 'NoneType' object has no attribute 'copy'

The work-around for this bug involves issuing two 'get_data' commands before the save_pha command, as demonstrated below.

sherpa> get_data(1).header = {}               # Make header an empty dictionary
sherpa> get_data(1).name = "simulation1.pha"  # Update name for save_pha

sherpa> save_pha(1, "simulation1.pha")

This bug will be resolved in a future release of the Sherpa software.