An example Sherpa notebook for CIAO 4.13
This notebook shows a few of the notebook features supported by Sherpa in CIAO 4.13: enhanced output from a number of commands such as get_data, get_source, and get_conf_results.
Download the notebook.
In [1]:
from sherpa.astro.ui import *
In [2]:
load_pha('clus.pi')
read ARF file clus.arf read RMF file clus.rmf read ARF (background) file clus_bkg.arf read RMF (background) file clus_bkg.rmf read background file clus_bkg.pi
In [3]:
set_stat('chi2datavar')
subtract()
notice(0.5, 7)
group_counts(20, tabStops=~get_data().mask)
In [4]:
set_source(xsphabs.gal * powlaw1d.pl)
In [5]:
fit()
Dataset = 1 Method = levmar Statistic = chi2datavar Initial fit statistic = 1.25982e+11 Final fit statistic = 50.5635 at function evaluation 73 Data points = 63 Degrees of freedom = 60 Probability [Q-value] = 0.802202 Reduced statistic = 0.842724 Change in statistic = 1.25982e+11 gal.nH 0.14659 +/- 0.0446808 pl.gamma 1.85068 +/- 0.118991 pl.ampl 0.00012673 +/- 1.48143e-05
In [6]:
conf()
gal.nH lower bound: -0.0440345 pl.gamma lower bound: -0.117356 gal.nH upper bound: 0.047472 pl.gamma upper bound: 0.122478 pl.ampl lower bound: -1.40835e-05 pl.ampl upper bound: 1.61961e-05 Dataset = 1 Confidence Method = confidence Iterative Fit Method = None Fitting Method = levmar Statistic = chi2datavar confidence 1-sigma (68.2689%) bounds: Param Best-Fit Lower Bound Upper Bound ----- -------- ----------- ----------- gal.nH 0.14659 -0.0440345 0.047472 pl.gamma 1.85068 -0.117356 0.122478 pl.ampl 0.00012673 -1.40835e-05 1.61961e-05
In [7]:
get_data()
Out[7]:
<DataPHA data set instance 'clus.pi'>
<sherpa.astro.plot.DataPHAPlot object at 0x7faaa8dbd4f0>
PHA Plot
Summary (8)
Identifier
clus.pi
Exposure
20791.6 s
Number of bins
1024
Channel range
1 - 1024
Count range
0.0 - 65.0
Background
Subtracted
Grouping
Applied (641 groups)
Using
0.5475-6.8109 Energy (keV) with 63 groups
Metadata (10)
Mission or Satellite
CHANDRA
Instrument or Detector
ACIS
Object
Xclass 2305
Program description
Resolving the central region of a very luminous galaxy cluster at z~ 0.7
Observation date
2015-02-21T18:24:46
Program that created the PHA
dmextract - Version CIAO 4.13
The channel type
PI
Data stored
TOTAL
Data format
TYPE:I
PHA format
COUNT
In [8]:
get_source()
Out[8]:
<BinaryOpModel model instance '(xsphabs.gal * powlaw1d.pl)'>
Model
Component | Parameter | Thawed | Value | Min | Max | Units |
---|---|---|---|---|---|---|
gal | nH | 0.14658975072513303 | 0.0 | 100000.0 | 10^22 atoms / cm^2 | |
pl | gamma | 1.8506815973567554 | -10.0 | 10.0 | ||
ref | 1.0 | -MAX | MAX | |||
ampl | 0.00012672991732433196 | 0.0 | MAX |
In [9]:
get_fit_results()
Out[9]:
<Fit results instance>
Fit parameters
Parameter | Best-fit value | Approximate error |
---|---|---|
gal.nH | 0.14659 | ± 0.0446808 |
pl.gamma | 1.85068 | ± 0.118991 |
pl.ampl | 0.00012673 | ± 1.48143e-05 |
Summary (11)
Dataset
1
Method
levmar
Statistic
chi2datavar
Final statistic
50.5635
Number of evaluations
73
Reduced statistic
0.842724
Probability (Q-value)
0.802202
Initial statistic
1.25982e+11
Δ statistic
1.25982e+11
Number of data points
63
Degrees of freedom
60
In [10]:
get_conf_results()
Out[10]:
<confidence results instance>
confidence 1σ (68.2689%) bounds
Parameter | Best-fit value | Lower Bound | Upper Bound |
---|---|---|---|
gal.nH | 0.14659 | -0.0440345 | 0.047472 |
pl.gamma | 1.85068 | -0.117356 | 0.122478 |
pl.ampl | 0.00012673 | -1.40835e-05 | 1.61961e-05 |
Summary (3)
Dataset
1
Fitting Method
levmar
Statistic
chi2datavar
Download the notebook.