specstack

Manipulate a stack of spectra in Sherpa.

The methods in the SpecStack class provide a way to automatically apply familiar Sherpa commands such as set_par or freeze or plot_fit to a stack of PHA spectra. This simplifies simultaneous fitting of multiple spectra.

Note that the specstack module is currently distributed within with the deproject package. Specstack is not yet fully documented or tested outside the context of deproject.

Copyright:Smithsonian Astrophysical Observatory (2009)
Author:Tom Aldcroft (aldcroft@head.cfa.harvard.edu)

Classes

class specstack.SpecStack

Bases: object

Manipulate a stack of spectra in Sherpa.

dummyfunc(*args, **kwargs)
find_norm(shell)

Find the normalization value for the shell model. Check for multiple or missing norms.

Parameters:shell – shell index
Return type:norm value
find_parval(parname)

Find the value of the first parameter with the given parname. Ignore case when matching.

Parameters:parname – parameter name
Return type:parameter value
freeze(par)

Apply freeze command to specified parameter for each dataset.

Parameters:par – parameter specifier in format <model_type>.<par_name>
Return type:None
get_par(par)

Get array of parameter values for datasets.

Parameters:
  • par – parameter specifier in format <model_type>.<par_name>
  • val – parameter value
Return type:

numpy array of parameter value ordered by dataset

ignore(*args)

Apply Sherpa ignore command to each dataset.

linear_scale(*args, **kwargs)
load_pha(specfile, annulus)

Load a pha file and add to the datasets for stacked analysis.

Parameters:
  • specfile – extracted source PHA/PI spectrum file
  • annulus – annulus for spectrum file
log_scale(*args, **kwargs)
n_datasets

Return the number of datasets :rtype: int

notice(*args)

Apply Sherpa notice command to each dataset.

plot_arf(*args, **kwargs)
plot_bkg(*args, **kwargs)
plot_bkg_chisqr(*args, **kwargs)
plot_bkg_delchi(*args, **kwargs)
plot_bkg_fit(*args, **kwargs)
plot_bkg_fit_delchi(*args, **kwargs)
plot_bkg_fit_resid(*args, **kwargs)
plot_bkg_model(*args, **kwargs)
plot_bkg_ratio(*args, **kwargs)
plot_bkg_resid(*args, **kwargs)
plot_bkg_source(*args, **kwargs)
plot_bkg_unconvolved(*args, **kwargs)
plot_chisqr(*args, **kwargs)
plot_data(*args, **kwargs)
plot_delchi(*args, **kwargs)
plot_fit(*args, **kwargs)
plot_fit_delchi(*args, **kwargs)
plot_fit_resid(*args, **kwargs)
plot_model(*args, **kwargs)
plot_order(*args, **kwargs)
plot_psf(*args, **kwargs)
plot_ratio(*args, **kwargs)
plot_resid(*args, **kwargs)
plot_source(*args, **kwargs)
print_window(*args, **kwargs)

Print window for each dataset.

Parameters:
  • args – list arguments to pass to print_window
  • kwargs – named (keyword) arguments to pass to print_window
Return type:

None

set_par(par, val)

Set parameter value for each dataset.

Parameters:
  • par – parameter specifier in format <model_type>.<par_name>
  • val – parameter value
Return type:

None

subtract(*args)

Subtract background from each dataset

thaw(par)

Apply thaw command to specified parameter for each dataset.

Parameters:par – parameter specifier in format <model_type>.<par_name>
Return type:None

Table Of Contents

Previous topic

deproject

Next topic

cosmocalc