Chandra X-Ray Observatory
Skip to the navigation links
Last modified: 13 March 2017

How can I simulate a PHA data set in Sherpa, with/without added Poisson noise?

The Sherpa fake_pha function is available for simulating a PHA data set, given a user-specified source model, integration time, and instrument response (ARF and RMF or RSP). The model parameters - which may have been previously fitted to an actual data set - are used to create the fake spectrum, which contains Poisson noise determined by the model parameters and integration time.

At the moment, there is no explicit way to prevent fake_pha from adding Poisson noise to the simulated counts; however, artificially increasing the exposure time until the fractional noise level is less than some threshold, would render the added Poisson noise irrelevant. This is the recommended method for faking spectra with integer counts; for non-integer counts, the recommended approach is to evaluate the given model and set the model-predicted counts as the data, using the set_counts function as shown below.

sherpa> set_source("faked", xsphabs.abs1*powlaw1d.p1)   
sherpa> fake_pha("faked", arf="arf.fits", rmf="rmf.fits", exposure=10000)  

sherpa> spectral_coords = get_indep("faked") 
sherpa> mdl = get_model("faked")
sherpa> counts = mdl(*spectral_coords)

sherpa> set_counts("faked", counts)

Last modified: 13 March 2017
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.