Commit e758b6929e3eeaef70c338e2bf1c8c4424fc87ed

Authored by Luigi Tibaldo
1 parent 72e641d7

Revised to make faster

doc/source/users/tutorials/1dc/classic_analysis_SED.png

35 KB | W: | H:

88.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/1dc/classic_analysis_skymap.png

65.9 KB | W: | H:

66.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/1dc/classic_analysis_skymap_exclusion.png

65.6 KB | W: | H:

66.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/1dc/classic_analysis_skymap_onoff.png

113 KB | W: | H:

96.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/1dc/classical_analysis.rst
... ... @@ -12,11 +12,28 @@ Performing a classical analysis
12 12 from the source region and from one or more background regions, and perform
13 13 a 1D maximum likelihood analysis to derive the source's spectrum.
14 14  
15   -We will assume that you have selected the observations available around your
16   -source of interest. You can do this using the :ref:`csobsselect` script.
17   -
18 15 We will derive the spectrum of a source with known position, i.e., the supernova
19   -remnants Cassiopeia A. First, you want to create a skymap to identify the source
  16 +remnants Cassiopeia A. First, you want to use the :ref:`csobsselect` script to
  17 +preselect observations around our source of interest.
  18 +
  19 +.. code-block:: bash
  20 +
  21 + csobsselect
  22 + Input event list or observation definition XML file [obs.xml] $CTA_DATA/obs/obs_gps_baseline.xml
  23 + Pointing selection region shape (CIRCLE|BOX) [CIRCLE]
  24 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
  25 + Right Ascension of selection centre (deg) (0-360) [83.63] 350.85
  26 + Declination of selection centre (deg) (-90-90) [22.01] 58.815
  27 + Radius of selection circle (deg) (0-180) [5.0] 2.5
  28 + Output observation definition XML file [outobs.xml] obs.xml
  29 +
  30 +.. note::
  31 +
  32 + We are limiting the offset between pointing and source directions to 2.5 deg
  33 + for the sake of a faster execution time for the tutorial. You can/should all
  34 + observations for which the source is within the CTA field of view.
  35 +
  36 +Next, you want to create a skymap to identify the source
20 37 region. You can do this using the :ref:`ctskymap` tool.
21 38  
22 39 .. code-block:: bash
... ... @@ -260,8 +277,8 @@ The output file ``CasA_results.xml`` contains the best fit parameter values.
260 277 <source_library title="source library">
261 278 <source name="Cassiopeia A" type="PointSource">
262 279 <spectrum type="PowerLaw">
263   - <parameter name="Prefactor" value="147.86715202969" error="4.01233122692211" scale="1e-20" min="0" free="1" />
264   - <parameter name="Index" value="2.73053827634155" error="0.0189867116394551" scale="-1" min="-10" max="10" free="1" />
  280 + <parameter name="Prefactor" value="145.578961369814" error="4.93849616822191" scale="1e-20" min="0" free="1" />
  281 + <parameter name="Index" value="2.73210299568622" error="0.0232463328680207" scale="-1" min="-10" max="10" free="1" />
265 282 <parameter name="PivotEnergy" value="1" scale="1000000" free="0" />
266 283 </spectrum>
267 284 <spatialModel type="PointSource">
... ... @@ -271,8 +288,8 @@ The output file ``CasA_results.xml`` contains the best fit parameter values.
271 288 </source>
272 289 <source name="Background model" type="CTAIrfBackground" instrument="CTAOnOff">
273 290 <spectrum type="PowerLaw">
274   - <parameter name="Prefactor" value="1.00396014959491" error="0.00554863257799099" scale="1" min="0.001" max="1000" free="1" />
275   - <parameter name="Index" value="-0.598672934981114" error="0.00337357936472602" scale="1" min="-5" max="5" free="1" />
  291 + <parameter name="Prefactor" value="1.01524362954036" error="0.0084255502742701" scale="1" min="0.001" max="1000" free="1" />
  292 + <parameter name="Index" value="0.00464866003911358" error="0.00484378659736716" scale="1" min="-5" max="5" free="1" />
276 293 <parameter name="Scale" value="1" scale="1000000" min="0.01" max="1000" free="0" />
277 294 </spectrum>
278 295 </source>
... ... @@ -287,23 +304,25 @@ The output file ``CasA_results.xml`` contains the best fit parameter values.
287 304 statistic used for the fit.
288 305  
289 306 - The DEFAULT for OnOff osbervations is CSTAT, i.e., Poisson signal and Poisson
290   - background. A model for the signal and a model for the background are jointly
291   - fit to the On and Off spectra.
  307 + background. A spectral model for the signal and a spectral model for the
  308 + background are jointly fit to the On and Off spectra.
292 309 - WSTAT is a special case of CSTAT, Poisson signal with Poisson background, in
293   - which you do not need to know a spectral model for the background and to have
294   - free parameters associated with it. The background rate in each energy bin is
295   - treated as a nuisance parameter, derived from the On and Off counts by
296   - profiling the likelihood function. Beware that the profiling may yield
297   - unphysical results (negative background counts) if the number of events in the
298   - On and Off spectra are very low or zero. In this case a null number of
299   - expected background events must be enforced, which can result in a bias on the
300   - source's parameters. You can address this issue by stacking
301   - multiple observations, using a coarser binning, or using CSTAT instead. See
302   - the `XSPEC manual Appendix B <https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSappendixStatistics.html>`_
  310 + which you do not need to have a spectral model for the background and
  311 + free parameters associated with it. The number of background counts in each
  312 + energy bin is treated as a nuisance parameter, derived from the On and Off
  313 + counts by profiling the likelihood function. In this case the only assumption
  314 + is that the background rate spectrum is the same in the On and Off regions.
  315 + Beware that the profiling may yield unphysical results (negative background
  316 + counts) if the number of events in the Off spectra are zero.
  317 + In this case a null number of expected background events must be enforced,
  318 + which can result in a bias on the source's parameters. You can address this
  319 + issue by stacking multiple observations, using a coarser energy binning, or
  320 + using CSTAT instead (if you have a spectral model for the background that is
  321 + good enough). See the `XSPEC manual Appendix B <https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSappendixStatistics.html>`_
303 322 for more information.
304 323 - You can also use CHI2, a classical chi square, i.e., a Gaussian signal and
305   - Gaussian background. As for CSTAT, a model for the signal and a model for the
306   - background are jointly fit to the On and Off spectra.
  324 + Gaussian background. As for CSTAT, a spectral model for the signal and a
  325 + spectral model for the background are jointly fit to the On and Off spectra.
307 326  
308 327 The :ref:`ctbutterfly` tool and :ref:`csspec` script can now be used to extract
309 328 the best-fit source spectrum.
... ...