Commit 574f9a40a0f2cbe35f4036dbb4f90247d06aadd3
1 parent
b6d6429e
Finish update of first section of How tos
Showing
1 changed file
with
35 additions
and
34 deletions
doc/source/users/tutorials/howto/howto_xspec.rst
| ... | ... | @@ -20,14 +20,15 @@ package, you can use that package to fit CTA data that were prepared for an |
| 20 | 20 | On/Off analysis. |
| 21 | 21 | |
| 22 | 22 | To illustrate how you can do this, let's simulate an observation of the Crab |
| 23 | -nebula with a pointing direction that is offset by 1 deg: | |
| 23 | +nebula with a pointing direction that is offset by 1 deg. We also use energy | |
| 24 | +dispersion in the simulation as an On/Off analysis always | |
| 24 | 25 | |
| 25 | 26 | .. code-block:: bash |
| 26 | 27 | |
| 27 | - $ ctobssim | |
| 28 | + $ ctobssim edisp=yes | |
| 28 | 29 | RA of pointing (degrees) (0-360) [83.63] |
| 29 | - Dec of pointing (degrees) (-90-90) [22.01] 21.01 | |
| 30 | - Radius of FOV (degrees) (0-180) [5] | |
| 30 | + Dec of pointing (degrees) (-90-90) [22.51] 21.01 | |
| 31 | + Radius of FOV (degrees) (0-180) [5.0] | |
| 31 | 32 | Start time (UTC string, JD, MJD or MET in seconds) [2020-01-01T00:00:00] |
| 32 | 33 | Stop time (UTC string, JD, MJD or MET in seconds) [2020-01-01T00:30:00] |
| 33 | 34 | Lower energy limit (TeV) [0.1] |
| ... | ... | @@ -47,18 +48,19 @@ Off counts spectrum: |
| 47 | 48 | Input event list or observation definition XML file [obs.xml] events.fits |
| 48 | 49 | Calibration database [prod2] |
| 49 | 50 | Instrument response function [South_0.5h] |
| 50 | - Start value for first energy bin in TeV [0.1] | |
| 51 | - Stop value for last energy bin in TeV [100] | |
| 52 | - Radius of source region circle (deg) (0-180) [0.2] | |
| 53 | 51 | Input model definition XML file (if NONE, use point source) [NONE] |
| 54 | 52 | Algorithm for defining energy bins (FILE|LIN|LOG) [LOG] |
| 55 | - Number of energy bins [20] | |
| 53 | + Start value for first energy bin in TeV [0.1] | |
| 54 | + Stop value for last energy bin in TeV [100.0] | |
| 55 | + Number of energy bins [120] 20 | |
| 56 | 56 | Stack multiple observations into single PHA, ARF and RMF files? [no] |
| 57 | 57 | Output observation definition XML file [onoff_obs.xml] |
| 58 | + Output model definition XML file [onoff_model.xml] | |
| 58 | 59 | Method for background estimation (REFLECTED|CUSTOM) [REFLECTED] |
| 59 | 60 | Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] |
| 60 | 61 | Right Ascension of source region centre (deg) (0-360) [83.63] |
| 61 | 62 | Declination of source region centre (deg) (-90-90) [22.01] |
| 63 | + Radius of source region circle (deg) (0-180) [0.2] | |
| 62 | 64 | |
| 63 | 65 | Now you can start |
| 64 | 66 | `Xspec <https://heasarc.nasa.gov/xanadu/xspec/>`_ |
| ... | ... | @@ -67,10 +69,9 @@ for model fitting. |
| 67 | 69 | .. code-block:: bash |
| 68 | 70 | |
| 69 | 71 | $ xspec |
| 70 | - Creating a $HOME/.xspec directory for you | |
| 71 | 72 | |
| 72 | - XSPEC version: 12.10.0c | |
| 73 | - Build Date/Time: Tue Jun 12 12:46:58 2018 | |
| 73 | + XSPEC version: 12.10.1 | |
| 74 | + Build Date/Time: Mon Jan 7 12:38:07 2019 | |
| 74 | 75 | |
| 75 | 76 | XSPEC12> |
| 76 | 77 | |
| ... | ... | @@ -87,10 +88,10 @@ First load the On file ``onoff_pha_on.fits`` using the ``data`` command: |
| 87 | 88 | 1 spectrum in use |
| 88 | 89 | |
| 89 | 90 | Spectral Data File: onoff_pha_on.fits Spectrum 1 |
| 90 | - Net count rate (cts/s) for Spectrum:1 1.585e+00 +/- 3.099e-02 (94.0 % total) | |
| 91 | + Net count rate (cts/s) for Spectrum:1 1.619e+00 +/- 3.135e-02 (93.9 % total) | |
| 91 | 92 | Assigned to Data Group 1 and Plot Group 1 |
| 92 | 93 | Noticed Channels: 1-20 |
| 93 | - Telescope: unknown Instrument: unknown Channel Type: PI | |
| 94 | + Telescope: CTA Instrument: PROD2 Channel Type: PI | |
| 94 | 95 | Exposure Time: 1764 sec |
| 95 | 96 | Using fit statistic: chi |
| 96 | 97 | Using test statistic: chi |
| ... | ... | @@ -135,11 +136,11 @@ model using |
| 135 | 136 | ________________________________________________________________________ |
| 136 | 137 | |
| 137 | 138 | |
| 138 | - Fit statistic : C-Statistic = 712.82 using 20 PHA bins and 18 degrees of freedom. | |
| 139 | + Fit statistic : C-Statistic = 727.46 using 20 PHA bins and 18 degrees of freedom. | |
| 139 | 140 | |
| 140 | - Test statistic : Chi-Squared = 605.26 using 20 PHA bins. | |
| 141 | - Reduced chi-squared = 33.625 for 18 degrees of freedom | |
| 142 | - Null hypothesis probability = 6.662146e-117 | |
| 141 | + Test statistic : Chi-Squared = 548.66 using 20 PHA bins. | |
| 142 | + Reduced chi-squared = 30.481 for 18 degrees of freedom | |
| 143 | + Null hypothesis probability = 5.939476e-105 | |
| 143 | 144 | |
| 144 | 145 | ***Warning: Chi-square may not be valid due to bins with zero variance |
| 145 | 146 | in spectrum number(s): 1 |
| ... | ... | @@ -159,39 +160,39 @@ command: |
| 159 | 160 | XSPEC12>fit |
| 160 | 161 | Parameters |
| 161 | 162 | C-Statistic |beta|/N Lvl 1:PhoIndex 2:norm |
| 162 | - 85.7044 11239.1 -3 2.49284 654.424 | |
| 163 | - 25.1265 3951.81 -4 2.48007 578.148 | |
| 164 | - 23.0302 769.247 -5 2.47567 541.654 | |
| 165 | - 22.9323 165.457 -6 2.47509 538.451 | |
| 166 | - 22.9315 13.9094 -7 2.47503 538.072 | |
| 163 | + 96.8692 11494.2 -3 2.49807 711.693 | |
| 164 | + 12.0065 4626.2 -4 2.49140 735.585 | |
| 165 | + 10.9389 553.368 -5 2.48822 701.803 | |
| 166 | + 10.8978 108.533 -6 2.48774 697.592 | |
| 167 | + 10.8974 11.7189 -7 2.48768 697.003 | |
| 167 | 168 | ============================== |
| 168 | 169 | Variances and Principal Axes |
| 169 | 170 | 1 2 |
| 170 | - 8.8843E-07| -1.0000 0.0001 | |
| 171 | - 2.8990E+04| -0.0001 -1.0000 | |
| 171 | + 8.7349E-07| -1.0000 0.0001 | |
| 172 | + 4.6499E+04| -0.0001 -1.0000 | |
| 172 | 173 | ------------------------------ |
| 173 | 174 | |
| 174 | 175 | ======================== |
| 175 | 176 | Covariance Matrix |
| 176 | 177 | 1 2 |
| 177 | - 2.326e-04 2.592e+00 | |
| 178 | - 2.592e+00 2.899e+04 | |
| 178 | + 2.228e-04 3.212e+00 | |
| 179 | + 3.212e+00 4.650e+04 | |
| 179 | 180 | ------------------------ |
| 180 | 181 | |
| 181 | 182 | ======================================================================== |
| 182 | 183 | Model powerlaw<1> Source No.: 1 Active/On |
| 183 | 184 | Model Model Component Parameter Unit Value |
| 184 | 185 | par comp |
| 185 | - 1 1 powerlaw PhoIndex 2.47503 +/- 1.52504E-02 | |
| 186 | - 2 1 powerlaw norm 538.072 +/- 170.265 | |
| 186 | + 1 1 powerlaw PhoIndex 2.48768 +/- 1.49258E-02 | |
| 187 | + 2 1 powerlaw norm 697.003 +/- 215.637 | |
| 187 | 188 | ________________________________________________________________________ |
| 188 | 189 | |
| 189 | 190 | |
| 190 | - Fit statistic : C-Statistic = 22.93 using 20 PHA bins and 18 degrees of freedom. | |
| 191 | + Fit statistic : C-Statistic = 10.90 using 20 PHA bins and 18 degrees of freedom. | |
| 191 | 192 | |
| 192 | - Test statistic : Chi-Squared = 437.54 using 20 PHA bins. | |
| 193 | - Reduced chi-squared = 24.308 for 18 degrees of freedom | |
| 194 | - Null hypothesis probability = 1.317221e-81 | |
| 193 | + Test statistic : Chi-Squared = 126.30 using 20 PHA bins. | |
| 194 | + Reduced chi-squared = 7.0169 for 18 degrees of freedom | |
| 195 | + Null hypothesis probability = 2.683238e-18 | |
| 195 | 196 | |
| 196 | 197 | ***Warning: Chi-square may not be valid due to bins with zero variance |
| 197 | 198 | in spectrum number(s): 1 |
| ... | ... | @@ -208,7 +209,7 @@ obtained using :ref:`ctlike`. |
| 208 | 209 | +-----------+-------+-----------------+-----------------+ |
| 209 | 210 | | Parameter | Truth | Xspec | ctlike | |
| 210 | 211 | +===========+=======+=================+=================+ |
| 211 | - | Prefactor | 601.4 | 538.0 +/- 170.3 | 536.4 +/- 184.2 | | |
| 212 | + | Prefactor | 601.4 | 697.0 +/- 215.6 | 697.5 +/- 234.5 | | |
| 212 | 213 | +-----------+-------+-----------------+-----------------+ |
| 213 | - | Index | 2.48 | 2.475 +/- 0.015 | 2.475 +/- 0.017 | | |
| 214 | + | Index | 2.48 | 2.488 +/- 0.015 | 2.488 +/- 0.017 | | |
| 214 | 215 | +-----------+-------+-----------------+-----------------+ | ... | ... |