From d8bfe7c2c0f01861a4f1bd37c05c8d43ebd2834d Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 29 Jun 2016 22:51:04 +0200 Subject: [PATCH] Update the Getting Started section of the User documentation --- doc/source/develop/git/index.rst | 18 +++++++++--------- doc/source/users/user_manual/getting.rst | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------- doc/source/users/user_manual/getting_started/beyond_combine.rst | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------- doc/source/users/user_manual/getting_started/beyond_irf.rst | 259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------- doc/source/users/user_manual/getting_started/beyond_residual.rst | 6 +++--- doc/source/users/user_manual/getting_started/beyond_stacked.rst | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------- doc/source/users/user_manual/getting_started/beyond_tsmap.rst | 14 +++++++------- doc/source/users/user_manual/getting_started/binning.rst | 83 +++++++++++++++++++++++++++++++++++++++++++++-------------------------------------- doc/source/users/user_manual/getting_started/butterfly.rst | 4 ++-- doc/source/users/user_manual/getting_started/cntmap-fits.jpg | Bin 48122 -> 0 bytes doc/source/users/user_manual/getting_started/energy_dispersion.rst | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/source/users/user_manual/getting_started/fitting.rst | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------ doc/source/users/user_manual/getting_started/python.rst | 85 +++++++++++++++++++++++-------------------------------------------------------------- doc/source/users/user_manual/getting_started/quickstart.rst | 8 +++++--- doc/source/users/user_manual/getting_started/simulating.rst | 66 ++++++++++++++++++++++++++++++++++++++++-------------------------- doc/source/users/user_manual/getting_started/unbinned.rst | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------- 16 files changed, 855 insertions(+), 763 deletions(-) create mode 100644 doc/source/users/user_manual/getting_started/energy_dispersion.rst diff --git a/doc/source/develop/git/index.rst b/doc/source/develop/git/index.rst index 8b4a8df..4d9201a 100644 --- a/doc/source/develop/git/index.rst +++ b/doc/source/develop/git/index.rst @@ -33,14 +33,14 @@ Before you start Make sure you configured your `Git `_ using your user name and e-mail address (you only need to do this once on your machine): -.. code-block:: sh +.. code-block:: bash $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com In addition, you may need to add -.. code-block:: sh +.. code-block:: bash $ git config --global http.sslverify "false" @@ -95,7 +95,7 @@ ownership. Now you can clone this fork using -.. code-block:: sh +.. code-block:: bash $ git clone https://cta-gitlab.irap.omp.eu/[user]/ctools.git @@ -106,13 +106,13 @@ user name. To keep in sync with the ctools repository you should add it as a remote repository using -.. code-block:: sh +.. code-block:: bash $ git remote add upstream https://cta-gitlab.irap.omp.eu/ctools/ctools.git You can then type -.. code-block:: sh +.. code-block:: bash $ git pull upstream devel @@ -127,7 +127,7 @@ To work on a new feature or to correct a bug you should always create a new branch. You do this by typing -.. code-block:: sh +.. code-block:: bash $ git checkout devel $ git pull upstream devel @@ -150,13 +150,13 @@ Once you have verified that the bug is correct you should commit your changes. First stage the files you want to commit: -.. code-block:: sh +.. code-block:: bash $ git add src/ctselect/ctselect.cpp and then commit your change: -.. code-block:: sh +.. code-block:: bash $ git commit -m "Corrected event selection in ctselect (#5783) > @@ -176,7 +176,7 @@ changes into your repository. You do this by typing -.. code-block:: sh +.. code-block:: bash $ git push origin 5783-correct-event-selection diff --git a/doc/source/users/user_manual/getting.rst b/doc/source/users/user_manual/getting.rst index 699e0c3..1bb73db 100644 --- a/doc/source/users/user_manual/getting.rst +++ b/doc/source/users/user_manual/getting.rst @@ -63,7 +63,7 @@ in an appropriate location (for example ``$HOME/builds``), and type .. code-block:: bash - $ tar xvfz gammalib-1.0.0.tar.gz + $ tar xvfz gammalib-1.1.0.tar.gz (the ``$`` symbol indicates the console prompt and is not part of the command that you should type in). @@ -73,7 +73,7 @@ typing .. code-block:: bash - $ cd gammalib-1.0.0 + $ cd gammalib-1.1.0 $ ./configure $ make $ make check @@ -135,7 +135,7 @@ an appropriate location (for example ``$HOME/builds``), and type .. code-block:: bash - $ tar xvfz ctools-1.0.0.tar.gz + $ tar xvfz ctools-1.1.0.tar.gz (the ``$`` symbol indicates the console prompt and is not part of the command that you should type in). @@ -144,7 +144,7 @@ Step in the directory and build the ctools by typing .. code-block:: bash - $ cd ctools-1.0.0 + $ cd ctools-1.1.0 $ ./configure $ make @@ -178,95 +178,61 @@ following output at the end of the unit testing: .. code-block:: bash - PASS: test_ctools.sh - PASS: test_cscripts.sh - PASS: test_python.py - make[4]: Nothing to be done for `all'. - ============================================================================ - Testsuite summary for ctools 1.0.0 - ============================================================================ - # TOTAL: 3 - # PASS: 3 - # SKIP: 0 - # XFAIL: 0 - # FAIL: 0 - # XPASS: 0 - # ERROR: 0 - ============================================================================ + PASS: test_python_ctools.sh + PASS: test_python_cscripts.sh + PASS: test_examples.py + ============================================================================ + Testsuite summary for ctools 1.1.0 + ============================================================================ + # TOTAL: 3 + # PASS: 3 + # SKIP: 0 + # XFAIL: 0 + # FAIL: 0 + # XPASS: 0 + # ERROR: 0 + ============================================================================ For older automake version, you should see .. code-block:: bash - *************** - * Test ctools * - *************** - Test ctobssim: .. ok - Test ctskymap: .. ok - Test ctbin: .... ok - Test ctexpcube: .... ok - Test ctpsfcube: .... ok - Test ctbkgcube: ...... ok - Test ctmodel: ...... ok - Test ctselect: .. ok - Test ctlike: ...... ok - Test cttsmap: .. ok - Test ctcubemask: .. ok - Test ctbutterfly: .. ok - Test ctulimit: .. ok - Test cterror: .. ok - PASS: test_ctools.sh - - ***************** - * Test cscripts * - ***************** - Test csobsdef: .. ok - Test csobs2caldb: .. ok - Test csobsinfo: .. ok - Test csiactobs: .. ok - Test csmodelinfo: .. ok - Test csmodelmerge (space-separated): .. ok - Test csmodelmerge (comma-separated): .. ok - Test csmodelmerge (wildcard string): .. ok - Test csmodelmerge (ascii-file): .. ok - Test cstsmapmerge (comma-separated): .. ok - Test cstsmapmerge (space-separated): .. ok - Test cstsmapmerge (wildcard string): .. ok - Test cstsmapmerge (ascii-file): .. ok - Test cspull: .. ok - Test cssens: .. ok - Test cstsdist: .. ok - Test csresmap: .. ok - Test csspec (unbinned): .. ok - Test csspec (binned): .. ok - Test cslightcrv (unbinned): .. ok - Test cslightcrv (binned): .. ok - PASS: test_cscripts.sh - - *********************** - * ctools unit testing * - *********************** - Test ctobssim functionality: .......... ok - Test ctobssim on observation container: .... ok - Test ctselect functionality: ... ok - Test ctbin functionality: ... ok - Test ctlike functionality: ... ok - Test cttsmap functionality: ... ok - Test ctmodel functionality: ... ok - Test ctskymap functionality: ... ok - Test ctexpcube functionality: ... ok - Test ctpsfcube functionality: ... ok - Test ctbkgcube functionality: ... ok - Test ctcubemask functionality: ... ok - Test ctbutterfly functionality: ... ok - Test ctulimit functionality: ... ok - Test cterror functionality: ... ok - Test unbinned pipeline with FITS file saving: .... ok - Test unbinned in-memory pipeline: .... ok - PASS: test_python.py - ================== - All 3 tests passed - ================== + *********************** + * ctools unit testing * + *********************** + Test ctobssim on command line: ..... ok + Test ctobssim from Python: ................................................. ok + Test ctselect on command line: ....... ok + Test ctselect from Python: ..... ok + Test ctbin on command line: ..... ok + Test ctbin from Python: ............................................. ok + ... + PASS test_python_ctools.sh + + ************************* + * cscripts unit testing * + ************************* + Test cscaldb on command line: .. ok + Test cscaldb from Python: . ok + Test cslightcrv on command line: ............... ok + Test cslightcrv from Python: ................................................. ok + Test csmodelinfo on command line: ..... ok + Test csmodelinfo from Python: ..... ok + ... + PASS test_python_cscripts.sh + + ******************** + * Examples testing * + ******************** + Test generate_prod3_irfs.py: .. ok + Test make_pointings.py: ....... ok + Test make_spectrum.py: .. ok + Test make_ts_distributions.py: .. ok + ... + PASS test_examples.py + ================== + All 3 tests passed + ================== The same detailed information is also available for the newer automake versions, but there it is written in log files that you can find in the @@ -274,9 +240,9 @@ versions, but there it is written in log files that you can find in the .. code-block:: bash - test_ctools.sh.log - test_cscripts.sh.log - test_python.py.log + test_python_ctools.sh.log + test_python_cscripts.sh.log + test_examples.py.log If you do not see the same output, but a failure message, please check first the :ref:`issues` section. If you cannot fix the problem, please diff --git a/doc/source/users/user_manual/getting_started/beyond_combine.rst b/doc/source/users/user_manual/getting_started/beyond_combine.rst index 63cc418..00fca4c 100644 --- a/doc/source/users/user_manual/getting_started/beyond_combine.rst +++ b/doc/source/users/user_manual/getting_started/beyond_combine.rst @@ -12,7 +12,7 @@ in a single shot. Here is an example that illustrates how to do that. Let's start with the simulation of two 30 min long observations of the Crab -nebula, each offset by 0.5 deg from the nebula in opposite directions: +nebula, each offset by 0.5° from the nebula in opposite directions: .. code-block:: bash @@ -79,11 +79,10 @@ ctools knows which instrument specific functions need to be called.** .. note:: The instrument string for a CTA observation is obviously ``CTA``. - In case that data from any existing Imaging Air Cherenkov Telescope - are provided in the correct format, the instrument strings - ``HESS``, ``MAGIC`` and ``VERITAS`` are also recognised. This opens - the obvious possibility to combine data from different - Imaging Air Cherenkov Telescope in a joint analysis. + In case that you want to analyse data from an existing Imaging Air + Cherenkov Telescope you can also set the instrument string to ``HESS``, + ``MAGIC``, or ``VERITAS``. You may also combine observations from different + telescopes for a joint analysis in an observation definition file. **Please recall that instrument strings are case sensitive.** Now you are ready to do a joint maximum likelihood analysis using @@ -98,128 +97,127 @@ Now you are ready to do a joint maximum likelihood analysis using Input model XML file [$CTOOLS/share/models/crab.xml] Output model XML file [crab_results.xml] -Instead of providing an event list or a counts cube, you now provided the +Instead of providing an event list or a counts cube, you now provide the filename of the observation definition XML file (here ``obs.xml``) as input parameter. :ref:`ctlike` recognises this format and automatically performs a -joint analysis. To see the result of this you needed to specify the -``chatter=3`` parameter so that the chattiness is increased in the log -file: +joint maximum likelihood analysis. To see the result of this you needed to +specify the ``chatter=3`` parameter so that the chattiness is increased in +the log file: -.. code-block:: xml +.. code-block:: none - 2015-12-07T21:23:07: +==============+ - 2015-12-07T21:23:07: | Observations | - 2015-12-07T21:23:07: +==============+ - 2015-12-07T21:23:07: === GObservations === - 2015-12-07T21:23:07: Number of observations ....: 2 - 2015-12-07T21:23:07: Number of models ..........: 2 - 2015-12-07T21:23:07: Number of predicted events : 0 - 2015-12-07T21:23:07: === GCTAObservation === - 2015-12-07T21:23:07: Name ......................: Crab - 2015-12-07T21:23:07: Identifier ................: 00001 - 2015-12-07T21:23:07: Instrument ................: CTA - 2015-12-07T21:23:07: Event file ................: events1.fits - 2015-12-07T21:23:07: Event type ................: EventList - 2015-12-07T21:23:07: Statistics ................: Poisson - 2015-12-07T21:23:07: Ontime ....................: 1800 s - 2015-12-07T21:23:07: Livetime ..................: 1710 s - 2015-12-07T21:23:07: Deadtime correction .......: 0.95 - 2015-12-07T21:23:07: User energy range .........: undefined - 2015-12-07T21:23:07: === GCTAPointing === - 2015-12-07T21:23:07: Pointing direction ........: (RA,Dec)=(83.63,21.51) - 2015-12-07T21:23:07: === GCTAResponseIrf === - 2015-12-07T21:23:07: Caldb mission .............: cta - 2015-12-07T21:23:07: Caldb instrument ..........: prod2 - 2015-12-07T21:23:07: Response name .............: South_0.5h - 2015-12-07T21:23:07: Energy dispersion .........: Not used - 2015-12-07T21:23:07: Save energy range .........: undefined - 2015-12-07T21:23:07: === GCTAEventList === - 2015-12-07T21:23:07: Number of events ..........: 22593 - 2015-12-07T21:23:07: Time interval .............: 51544.5 - 51544.5 days - 2015-12-07T21:23:07: Energy interval ...........: 0.1 - 100 TeV - 2015-12-07T21:23:07: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg - 2015-12-07T21:23:07: === GCTAObservation === - 2015-12-07T21:23:07: Name ......................: Crab - 2015-12-07T21:23:07: Identifier ................: 00002 - 2015-12-07T21:23:07: Instrument ................: CTA - 2015-12-07T21:23:07: Event file ................: events2.fits - 2015-12-07T21:23:07: Event type ................: EventList - 2015-12-07T21:23:07: Statistics ................: Poisson - 2015-12-07T21:23:07: Ontime ....................: 1800 s - 2015-12-07T21:23:07: Livetime ..................: 1710 s - 2015-12-07T21:23:07: Deadtime correction .......: 0.95 - 2015-12-07T21:23:07: User energy range .........: undefined - 2015-12-07T21:23:07: === GCTAPointing === - 2015-12-07T21:23:07: Pointing direction ........: (RA,Dec)=(83.63,22.51) - 2015-12-07T21:23:07: === GCTAResponseIrf === - 2015-12-07T21:23:07: Caldb mission .............: cta - 2015-12-07T21:23:07: Caldb instrument ..........: prod2 - 2015-12-07T21:23:07: Response name .............: South_0.5h - 2015-12-07T21:23:07: Energy dispersion .........: Not used - 2015-12-07T21:23:07: Save energy range .........: undefined - 2015-12-07T21:23:07: === GCTAEventList === - 2015-12-07T21:23:07: Number of events ..........: 22529 - 2015-12-07T21:23:07: Time interval .............: 51544.5 - 51544.5 days - 2015-12-07T21:23:07: Energy interval ...........: 0.1 - 100 TeV - 2015-12-07T21:23:07: Region of interest ........: RA=83.63, DEC=22.51 [0,0] Radius=5 deg - ... - 2015-12-07T21:23:07: +=================================+ - 2015-12-07T21:23:07: | Maximum likelihood optimisation | - 2015-12-07T21:23:07: +=================================+ - 2015-12-07T21:23:07: >Iteration 0: -logL=304176.886, Lambda=1.0e-03 - 2015-12-07T21:23:08: >Iteration 1: -logL=304161.799, Lambda=1.0e-03, delta=15.088, max(|grad|)=12.922804 [Index:3] - 2015-12-07T21:23:08: >Iteration 2: -logL=304161.783, Lambda=1.0e-04, delta=0.015, max(|grad|)=0.098155 [Index:3] - 2015-12-07T21:23:08: >Iteration 3: -logL=304161.783, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000598 [Index:3] + 2016-06-29T19:14:38: +==============+ + 2016-06-29T19:14:38: | Observations | + 2016-06-29T19:14:38: +==============+ + 2016-06-29T19:14:38: === GObservations === + 2016-06-29T19:14:38: Number of observations ....: 2 + 2016-06-29T19:14:38: Number of models ..........: 2 + 2016-06-29T19:14:38: Number of observed events .: 46028 + 2016-06-29T19:14:38: Number of predicted events : 0 + 2016-06-29T19:14:38: === GCTAObservation === + 2016-06-29T19:14:38: Name ......................: Crab + 2016-06-29T19:14:38: Identifier ................: 00001 + 2016-06-29T19:14:38: Instrument ................: CTA + 2016-06-29T19:14:38: Event file ................: events1.fits + 2016-06-29T19:14:38: Event type ................: EventList + 2016-06-29T19:14:38: Statistics ................: Poisson + 2016-06-29T19:14:38: Ontime ....................: 1800 s + 2016-06-29T19:14:38: Livetime ..................: 1710 s + 2016-06-29T19:14:38: Deadtime correction .......: 0.95 + 2016-06-29T19:14:38: User energy range .........: undefined + 2016-06-29T19:14:38: === GCTAPointing === + 2016-06-29T19:14:38: Pointing direction ........: (RA,Dec)=(83.63,21.51) + 2016-06-29T19:14:38: === GCTAResponseIrf === + 2016-06-29T19:14:38: Caldb mission .............: cta + 2016-06-29T19:14:38: Caldb instrument ..........: prod2 + 2016-06-29T19:14:38: Response name .............: South_0.5h + 2016-06-29T19:14:38: Energy dispersion .........: Not used + 2016-06-29T19:14:38: Save energy range .........: undefined + 2016-06-29T19:14:38: === GCTAEventList === + 2016-06-29T19:14:38: Number of events ..........: 23014 (disposed in "events1.fits") + 2016-06-29T19:14:38: Time interval .............: 51544.5 - 51544.5 days + 2016-06-29T19:14:38: Energy interval ...........: 0.1 - 100 TeV + 2016-06-29T19:14:38: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg + 2016-06-29T19:14:38: === GCTAObservation === + 2016-06-29T19:14:38: Name ......................: Crab + 2016-06-29T19:14:38: Identifier ................: 00002 + 2016-06-29T19:14:38: Instrument ................: CTA + 2016-06-29T19:14:38: Event file ................: events2.fits + 2016-06-29T19:14:38: Event type ................: EventList + 2016-06-29T19:14:38: Statistics ................: Poisson + 2016-06-29T19:14:38: Ontime ....................: 1800 s + 2016-06-29T19:14:38: Livetime ..................: 1710 s + 2016-06-29T19:14:38: Deadtime correction .......: 0.95 + 2016-06-29T19:14:38: User energy range .........: undefined + 2016-06-29T19:14:38: === GCTAPointing === + 2016-06-29T19:14:38: Pointing direction ........: (RA,Dec)=(83.63,21.51) + 2016-06-29T19:14:38: === GCTAResponseIrf === + 2016-06-29T19:14:38: Caldb mission .............: cta + 2016-06-29T19:14:38: Caldb instrument ..........: prod2 + 2016-06-29T19:14:38: Response name .............: South_0.5h + 2016-06-29T19:14:38: Energy dispersion .........: Not used + 2016-06-29T19:14:38: Save energy range .........: undefined + 2016-06-29T19:14:38: === GCTAEventList === + 2016-06-29T19:14:38: Number of events ..........: 23014 (disposed in "events2.fits") + 2016-06-29T19:14:38: Time interval .............: 51544.5 - 51544.5 days + 2016-06-29T19:14:38: Energy interval ...........: 0.1 - 100 TeV + 2016-06-29T19:14:38: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg + 2016-06-29T19:14:38: + 2016-06-29T19:14:38: +=================================+ + 2016-06-29T19:14:38: | Maximum likelihood optimisation | + 2016-06-29T19:14:38: +=================================+ + 2016-06-29T19:14:38: >Iteration 0: -logL=309355.758, Lambda=1.0e-03 + 2016-06-29T19:14:38: >Iteration 1: -logL=309352.158, Lambda=1.0e-03, delta=3.600, max(|grad|)=7.976081 [Index:7] + 2016-06-29T19:14:38: >Iteration 2: -logL=309352.157, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.033525 [Index:3] ... - - 2015-12-07T21:23:08: +=========================================+ - 2015-12-07T21:23:08: | Maximum likelihood optimisation results | - 2015-12-07T21:23:08: +=========================================+ - 2015-12-07T21:23:08: === GOptimizerLM === - 2015-12-07T21:23:08: Optimized function value ..: 304161.783 - 2015-12-07T21:23:08: Absolute precision ........: 0.005 - 2015-12-07T21:23:08: Acceptable value decrease .: 2 - 2015-12-07T21:23:08: Optimization status .......: converged - 2015-12-07T21:23:08: Number of parameters ......: 10 - 2015-12-07T21:23:08: Number of free parameters .: 4 - 2015-12-07T21:23:08: Number of iterations ......: 3 - 2015-12-07T21:23:08: Lambda ....................: 1e-06 - 2015-12-07T21:23:08: Maximum log likelihood ....: -304161.783 - 2015-12-07T21:23:08: Observed events (Nobs) ...: 45122.000 - 2015-12-07T21:23:08: Predicted events (Npred) ..: 45122.000 (Nobs - Npred = 1.04131e-06) - 2015-12-07T21:23:08: === GModels === - 2015-12-07T21:23:08: Number of models ..........: 2 - 2015-12-07T21:23:08: Number of parameters ......: 10 - 2015-12-07T21:23:08: === GModelSky === - 2015-12-07T21:23:08: Name ......................: Crab - 2015-12-07T21:23:08: Instruments ...............: all - 2015-12-07T21:23:08: Instrument scale factors ..: unity - 2015-12-07T21:23:08: Observation identifiers ...: all - 2015-12-07T21:23:08: Model type ................: PointSource - 2015-12-07T21:23:08: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" - 2015-12-07T21:23:08: Number of parameters ......: 6 - 2015-12-07T21:23:08: Number of spatial par's ...: 2 - 2015-12-07T21:23:08: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) - 2015-12-07T21:23:08: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) - 2015-12-07T21:23:08: Number of spectral par's ..: 3 - 2015-12-07T21:23:08: Prefactor ................: 5.78382e-16 +/- 7.27218e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - 2015-12-07T21:23:08: Index ....................: -2.5314 +/- 0.0112546 [-0,-5] (free,scale=-1,gradient) - 2015-12-07T21:23:08: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:23:08: Number of temporal par's ..: 1 - 2015-12-07T21:23:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - 2015-12-07T21:23:08: === GCTAModelIrfBackground === - 2015-12-07T21:23:08: Name ......................: CTABackgroundModel - 2015-12-07T21:23:08: Instruments ...............: CTA - 2015-12-07T21:23:08: Instrument scale factors ..: unity - 2015-12-07T21:23:08: Observation identifiers ...: all - 2015-12-07T21:23:08: Model type ................: "PowerLaw" * "Constant" - 2015-12-07T21:23:08: Number of parameters ......: 4 - 2015-12-07T21:23:08: Number of spectral par's ..: 3 - 2015-12-07T21:23:08: Prefactor ................: 1.0008 +/- 0.00839192 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) - 2015-12-07T21:23:08: Index ....................: 0.0102998 +/- 0.0051965 [-5,5] (free,scale=1,gradient) - 2015-12-07T21:23:08: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:23:08: Number of temporal par's ..: 1 - 2015-12-07T21:23:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T19:14:38: +=========================================+ + 2016-06-29T19:14:38: | Maximum likelihood optimisation results | + 2016-06-29T19:14:38: +=========================================+ + 2016-06-29T19:14:38: === GOptimizerLM === + 2016-06-29T19:14:38: Optimized function value ..: 309352.157 + 2016-06-29T19:14:38: Absolute precision ........: 0.005 + 2016-06-29T19:14:38: Acceptable value decrease .: 2 + 2016-06-29T19:14:38: Optimization status .......: converged + 2016-06-29T19:14:38: Number of parameters ......: 10 + 2016-06-29T19:14:38: Number of free parameters .: 4 + 2016-06-29T19:14:38: Number of iterations ......: 2 + 2016-06-29T19:14:38: Lambda ....................: 1e-05 + 2016-06-29T19:14:38: Maximum log likelihood ....: -309352.157 + 2016-06-29T19:14:38: Observed events (Nobs) ...: 46028.000 + 2016-06-29T19:14:38: Predicted events (Npred) ..: 46027.996 (Nobs - Npred = 0.00423575) + 2016-06-29T19:14:38: === GModels === + 2016-06-29T19:14:38: Number of models ..........: 2 + 2016-06-29T19:14:38: Number of parameters ......: 10 + 2016-06-29T19:14:38: === GModelSky === + 2016-06-29T19:14:38: Name ......................: Crab + 2016-06-29T19:14:38: Instruments ...............: all + 2016-06-29T19:14:38: Instrument scale factors ..: unity + 2016-06-29T19:14:38: Observation identifiers ...: all + 2016-06-29T19:14:38: Model type ................: PointSource + 2016-06-29T19:14:38: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T19:14:38: Number of parameters ......: 6 + 2016-06-29T19:14:38: Number of spatial par's ...: 2 + 2016-06-29T19:14:38: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T19:14:38: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T19:14:38: Number of spectral par's ..: 3 + 2016-06-29T19:14:38: Prefactor ................: 5.7909e-16 +/- 7.3315e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T19:14:38: Index ....................: -2.47181 +/- 0.0109973 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T19:14:38: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T19:14:38: Number of temporal par's ..: 1 + 2016-06-29T19:14:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T19:14:38: === GCTAModelIrfBackground === + 2016-06-29T19:14:38: Name ......................: CTABackgroundModel + 2016-06-29T19:14:38: Instruments ...............: CTA + 2016-06-29T19:14:38: Instrument scale factors ..: unity + 2016-06-29T19:14:38: Observation identifiers ...: all + 2016-06-29T19:14:38: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T19:14:38: Number of parameters ......: 4 + 2016-06-29T19:14:38: Number of spectral par's ..: 3 + 2016-06-29T19:14:38: Prefactor ................: 1.01608 +/- 0.0084739 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T19:14:38: Index ....................: 0.00524546 +/- 0.00516392 [-5,5] (free,scale=1,gradient) + 2016-06-29T19:14:38: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T19:14:38: Number of temporal par's ..: 1 + 2016-06-29T19:14:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) The log file indicates that the fit converged quickly, the spectral parameters of the Crab nebula have now been constrained using the events @@ -233,7 +231,7 @@ data from multiple observations should be combined.** Combining observations is not limited to unbinned data (i.e. event lists) but may also be applied to binned data (i.e. counts cubes). -Using :ref:`ctbin` we can create counts cubes from both event lists which +Using :ref:`ctbin` you can create counts cubes from both event lists which may then be combined in an observation definition XML file: .. code-block:: xml diff --git a/doc/source/users/user_manual/getting_started/beyond_irf.rst b/doc/source/users/user_manual/getting_started/beyond_irf.rst index 2275168..68d6751 100644 --- a/doc/source/users/user_manual/getting_started/beyond_irf.rst +++ b/doc/source/users/user_manual/getting_started/beyond_irf.rst @@ -3,17 +3,17 @@ Connecting observations to dedicated instrument response functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -So far the same instrument response function has been used for all -observations in our analysis examples. -You may have recognised that we always specified the calibration database -``prod2`` and the instrument response function ``South_0.5h`` that -are shipped with ctools. +So far you used the same instrument response function for all observations. +You always specified the calibration database ``prod2`` and the instrument +response function ``South_0.5h`` that are shipped with ctools in all +examples. When combining multiple observations in a joint analysis you may however need to specify dedicated instrument response functions for the different observations. -Let's simulate two observations of the Crab nebula, one done with -the northern array and the other with the southern array: +To illustrate how you can do this, let's simulate two observations of the +Crab nebula, one done with the northern array and the other with the southern +array: .. code-block:: bash @@ -70,26 +70,26 @@ option to get the output of the script on the console): .. code-block:: bash - $ cscaldb debug=yes - Parfile cscaldb.par not found. Create default parfile. - 2015-05-22T21:35:39: +============+ - 2015-05-22T21:35:39: | Parameters | - 2015-05-22T21:35:39: +============+ - 2015-05-22T21:35:39: chatter ...................: 2 - 2015-05-22T21:35:39: clobber ...................: yes - 2015-05-22T21:35:39: debug .....................: yes - 2015-05-22T21:35:39: mode ......................: ql - 2015-05-22T21:35:39: - 2015-05-22T21:35:39: +==============+ - 2015-05-22T21:35:39: | Mission: cta | - 2015-05-22T21:35:39: +==============+ - 2015-05-22T21:35:40: === Response functions in database "prod2" === - 2015-05-22T21:35:40: North_0.5h - 2015-05-22T21:35:40: North_50h - 2015-05-22T21:35:40: North_5h - 2015-05-22T21:35:40: South_0.5h - 2015-05-22T21:35:40: South_50h - 2015-05-22T21:35:40: South_5h + $ cscaldb debug=yes + 2016-06-29T20:09:44: +============+ + 2016-06-29T20:09:44: | Parameters | + 2016-06-29T20:09:44: +============+ + 2016-06-29T20:09:44: chatter ...................: 2 + 2016-06-29T20:09:44: clobber ...................: yes + 2016-06-29T20:09:44: debug .....................: yes + 2016-06-29T20:09:44: mode ......................: ql + 2016-06-29T20:09:44: logfile ...................: cscaldb.log + 2016-06-29T20:09:44: + 2016-06-29T20:09:44: +==============+ + 2016-06-29T20:09:44: | Mission: cta | + 2016-06-29T20:09:44: +==============+ + 2016-06-29T20:09:44: === Response functions in database "prod2" === + 2016-06-29T20:09:44: North_0.5h + 2016-06-29T20:09:44: North_50h + 2016-06-29T20:09:44: North_5h + 2016-06-29T20:09:44: South_0.5h + 2016-06-29T20:09:44: South_50h + 2016-06-29T20:09:44: South_5h You will see that ctools ships with one database for the CTA observatory. This is the ``prod2`` database. @@ -101,7 +101,7 @@ You now jointly fit both observations using :ref:`ctlike`: .. code-block:: bash - $ ctlike chatter=3 + $ ctlike chatter=3 Input event list, counts cube or observation definition XML file [events.fits] obs_irf.xml Input model XML file [$CTOOLS/share/models/crab.xml] Output model XML file [crab_results.xml] @@ -113,122 +113,95 @@ You will notice that each observation now has a specific response function and that the filename of the response information differs for both observations. -.. code-block:: xml - - 2015-12-07T22:22:18: +==============+ - 2015-12-07T22:22:18: | Observations | - 2015-12-07T22:22:18: +==============+ - 2015-12-07T22:22:18: === GObservations === - 2015-12-07T22:22:18: Number of observations ....: 2 - 2015-12-07T22:22:18: Number of models ..........: 2 - 2015-12-07T22:22:18: Number of predicted events : 0 - 2015-12-07T22:22:18: === GCTAObservation === - 2015-12-07T22:22:18: Name ......................: Crab - 2015-12-07T22:22:18: Identifier ................: 00001 - 2015-12-07T22:22:18: Instrument ................: CTA - 2015-12-07T22:22:18: Event file ................: north.fits - 2015-12-07T22:22:18: Event type ................: EventList - 2015-12-07T22:22:18: Statistics ................: Poisson - 2015-12-07T22:22:18: Ontime ....................: 1800 s - 2015-12-07T22:22:18: Livetime ..................: 1710 s - 2015-12-07T22:22:18: Deadtime correction .......: 0.95 - 2015-12-07T22:22:18: User energy range .........: undefined - 2015-12-07T22:22:18: === GCTAPointing === - 2015-12-07T22:22:18: Pointing direction ........: (RA,Dec)=(83.63,21.51) - 2015-12-07T22:22:18: === GCTAResponseIrf === - 2015-12-07T22:22:18: Caldb mission .............: cta - 2015-12-07T22:22:18: Caldb instrument ..........: prod2 - 2015-12-07T22:22:18: Response name .............: North_0.5h - 2015-12-07T22:22:18: Energy dispersion .........: Not used - 2015-12-07T22:22:18: Save energy range .........: undefined - 2015-12-07T22:22:18: === GCTAEventList === - 2015-12-07T22:22:18: Number of events ..........: 8469 - 2015-12-07T22:22:18: Time interval .............: 51544.5 - 51544.5 days - 2015-12-07T22:22:18: Energy interval ...........: 0.1 - 100 TeV - 2015-12-07T22:22:18: Region of interest ........: RA=83.63, DEC=21.51 [0,0] Radius=5 deg - 2015-12-07T22:22:18: === GCTAObservation === - 2015-12-07T22:22:18: Name ......................: Crab - 2015-12-07T22:22:18: Identifier ................: 00002 - 2015-12-07T22:22:18: Instrument ................: CTA - 2015-12-07T22:22:18: Event file ................: south.fits - 2015-12-07T22:22:18: Event type ................: EventList - 2015-12-07T22:22:18: Statistics ................: Poisson - 2015-12-07T22:22:18: Ontime ....................: 1800 s - 2015-12-07T22:22:18: Livetime ..................: 1710 s - 2015-12-07T22:22:18: Deadtime correction .......: 0.95 - 2015-12-07T22:22:18: User energy range .........: undefined - 2015-12-07T22:22:18: === GCTAPointing === - 2015-12-07T22:22:18: Pointing direction ........: (RA,Dec)=(83.63,22.51) - 2015-12-07T22:22:18: === GCTAResponseIrf === - 2015-12-07T22:22:18: Caldb mission .............: cta - 2015-12-07T22:22:18: Caldb instrument ..........: prod2 - 2015-12-07T22:22:18: Response name .............: South_0.5h - 2015-12-07T22:22:18: Energy dispersion .........: Not used - 2015-12-07T22:22:18: Save energy range .........: undefined - 2015-12-07T22:22:18: === GCTAEventList === - 2015-12-07T22:22:18: Number of events ..........: 22529 - 2015-12-07T22:22:18: Time interval .............: 51544.5 - 51544.5 days - 2015-12-07T22:22:18: Energy interval ...........: 0.1 - 100 TeV - 2015-12-07T22:22:18: Region of interest ........: RA=83.63, DEC=22.51 [0,0] Radius=5 deg +.. code-block:: none + + 2016-06-29T20:10:29: +==============+ + 2016-06-29T20:10:29: | Observations | + 2016-06-29T20:10:29: +==============+ + 2016-06-29T20:10:29: === GObservations === + 2016-06-29T20:10:29: Number of observations ....: 2 + 2016-06-29T20:10:29: Number of models ..........: 2 + 2016-06-29T20:10:29: Number of observed events .: 31270 + 2016-06-29T20:10:29: Number of predicted events : 0 + 2016-06-29T20:10:29: === GCTAObservation === + 2016-06-29T20:10:29: Name ......................: Crab + 2016-06-29T20:10:29: Identifier ................: 00001 ... - 2015-12-07T22:22:18: +=================================+ - 2015-12-07T22:22:18: | Maximum likelihood optimisation | - 2015-12-07T22:22:18: +=================================+ - 2015-12-07T22:22:18: >Iteration 0: -logL=214691.468, Lambda=1.0e-03 - 2015-12-07T22:22:18: >Iteration 1: -logL=214679.380, Lambda=1.0e-03, delta=12.088, max(|grad|)=9.713100 [Index:3] - 2015-12-07T22:22:18: >Iteration 2: -logL=214679.365, Lambda=1.0e-04, delta=0.015, max(|grad|)=0.092975 [Index:3] - 2015-12-07T22:22:18: >Iteration 3: -logL=214679.365, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000749 [Index:3] + 2016-06-29T20:10:29: === GCTAResponseIrf === + 2016-06-29T20:10:29: Caldb mission .............: cta + 2016-06-29T20:10:29: Caldb instrument ..........: prod2 + 2016-06-29T20:10:29: Response name .............: North_0.5h + 2016-06-29T20:10:29: Energy dispersion .........: Not used + 2016-06-29T20:10:29: Save energy range .........: undefined ... - 2015-12-07T22:22:18: +=========================================+ - 2015-12-07T22:22:18: | Maximum likelihood optimisation results | - 2015-12-07T22:22:18: +=========================================+ - 2015-12-07T22:22:18: === GOptimizerLM === - 2015-12-07T22:22:18: Optimized function value ..: 214679.365 - 2015-12-07T22:22:18: Absolute precision ........: 0.005 - 2015-12-07T22:22:18: Acceptable value decrease .: 2 - 2015-12-07T22:22:18: Optimization status .......: converged - 2015-12-07T22:22:18: Number of parameters ......: 10 - 2015-12-07T22:22:18: Number of free parameters .: 4 - 2015-12-07T22:22:18: Number of iterations ......: 3 - 2015-12-07T22:22:18: Lambda ....................: 1e-06 - 2015-12-07T22:22:18: Maximum log likelihood ....: -214679.365 - 2015-12-07T22:22:18: Observed events (Nobs) ...: 30998.000 - 2015-12-07T22:22:18: Predicted events (Npred) ..: 30998.000 (Nobs - Npred = 1.02755e-06) - 2015-12-07T22:22:18: === GModels === - 2015-12-07T22:22:18: Number of models ..........: 2 - 2015-12-07T22:22:18: Number of parameters ......: 10 - 2015-12-07T22:22:18: === GModelSky === - 2015-12-07T22:22:18: Name ......................: Crab - 2015-12-07T22:22:18: Instruments ...............: all - 2015-12-07T22:22:18: Instrument scale factors ..: unity - 2015-12-07T22:22:18: Observation identifiers ...: all - 2015-12-07T22:22:18: Model type ................: PointSource - 2015-12-07T22:22:18: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" - 2015-12-07T22:22:18: Number of parameters ......: 6 - 2015-12-07T22:22:18: Number of spatial par's ...: 2 - 2015-12-07T22:22:18: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) - 2015-12-07T22:22:18: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) - 2015-12-07T22:22:18: Number of spectral par's ..: 3 - 2015-12-07T22:22:18: Prefactor ................: 5.81237e-16 +/- 8.63534e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - 2015-12-07T22:22:18: Index ....................: -2.53954 +/- 0.0137432 [-0,-5] (free,scale=-1,gradient) - 2015-12-07T22:22:18: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T22:22:18: Number of temporal par's ..: 1 - 2015-12-07T22:22:18: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - 2015-12-07T22:22:18: === GCTAModelIrfBackground === - 2015-12-07T22:22:18: Name ......................: CTABackgroundModel - 2015-12-07T22:22:18: Instruments ...............: CTA - 2015-12-07T22:22:18: Instrument scale factors ..: unity - 2015-12-07T22:22:18: Observation identifiers ...: all - 2015-12-07T22:22:18: Model type ................: "PowerLaw" * "Constant" - 2015-12-07T22:22:18: Number of parameters ......: 4 - 2015-12-07T22:22:18: Number of spectral par's ..: 3 - 2015-12-07T22:22:18: Prefactor ................: 1.01067 +/- 0.0103997 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) - 2015-12-07T22:22:18: Index ....................: 0.0135414 +/- 0.0064452 [-5,5] (free,scale=1,gradient) - 2015-12-07T22:22:18: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T22:22:18: Number of temporal par's ..: 1 - 2015-12-07T22:22:18: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - -A more fine grained control over the response function can be achieved by + 2016-06-29T20:10:29: === GCTAObservation === + 2016-06-29T20:10:29: Name ......................: Crab + 2016-06-29T20:10:29: Identifier ................: 00002 + ... + 2016-06-29T20:10:29: === GCTAResponseIrf === + 2016-06-29T20:10:29: Caldb mission .............: cta + 2016-06-29T20:10:29: Caldb instrument ..........: prod2 + 2016-06-29T20:10:29: Response name .............: South_0.5h + 2016-06-29T20:10:29: Energy dispersion .........: Not used + 2016-06-29T20:10:29: Save energy range .........: undefined + ... + 2016-06-29T20:10:29: +=================================+ + 2016-06-29T20:10:29: | Maximum likelihood optimisation | + 2016-06-29T20:10:29: +=================================+ + 2016-06-29T20:10:30: >Iteration 0: -logL=216208.923, Lambda=1.0e-03 + 2016-06-29T20:10:30: >Iteration 1: -logL=216207.021, Lambda=1.0e-03, delta=1.902, max(|grad|)=4.436064 [Index:7] + 2016-06-29T20:10:30: >Iteration 2: -logL=216207.021, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.012146 [Index:7] + ... + 2016-06-29T20:10:30: +=========================================+ + 2016-06-29T20:10:30: | Maximum likelihood optimisation results | + 2016-06-29T20:10:30: +=========================================+ + 2016-06-29T20:10:30: === GOptimizerLM === + 2016-06-29T20:10:30: Optimized function value ..: 216207.021 + 2016-06-29T20:10:30: Absolute precision ........: 0.005 + 2016-06-29T20:10:30: Acceptable value decrease .: 2 + 2016-06-29T20:10:30: Optimization status .......: converged + 2016-06-29T20:10:30: Number of parameters ......: 10 + 2016-06-29T20:10:30: Number of free parameters .: 4 + 2016-06-29T20:10:30: Number of iterations ......: 2 + 2016-06-29T20:10:30: Lambda ....................: 1e-05 + 2016-06-29T20:10:30: Maximum log likelihood ....: -216207.021 + 2016-06-29T20:10:30: Observed events (Nobs) ...: 31270.000 + 2016-06-29T20:10:30: Predicted events (Npred) ..: 31269.998 (Nobs - Npred = 0.00190254) + 2016-06-29T20:10:30: === GModels === + 2016-06-29T20:10:30: Number of models ..........: 2 + 2016-06-29T20:10:30: Number of parameters ......: 10 + 2016-06-29T20:10:30: === GModelSky === + 2016-06-29T20:10:30: Name ......................: Crab + 2016-06-29T20:10:30: Instruments ...............: all + 2016-06-29T20:10:30: Instrument scale factors ..: unity + 2016-06-29T20:10:30: Observation identifiers ...: all + 2016-06-29T20:10:30: Model type ................: PointSource + 2016-06-29T20:10:30: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T20:10:30: Number of parameters ......: 6 + 2016-06-29T20:10:30: Number of spatial par's ...: 2 + 2016-06-29T20:10:30: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T20:10:30: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T20:10:30: Number of spectral par's ..: 3 + 2016-06-29T20:10:30: Prefactor ................: 5.7247e-16 +/- 8.64521e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T20:10:30: Index ....................: -2.46519 +/- 0.013273 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T20:10:30: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T20:10:30: Number of temporal par's ..: 1 + 2016-06-29T20:10:30: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T20:10:30: === GCTAModelIrfBackground === + 2016-06-29T20:10:30: Name ......................: CTABackgroundModel + 2016-06-29T20:10:30: Instruments ...............: CTA + 2016-06-29T20:10:30: Instrument scale factors ..: unity + 2016-06-29T20:10:30: Observation identifiers ...: all + 2016-06-29T20:10:30: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T20:10:30: Number of parameters ......: 4 + 2016-06-29T20:10:30: Number of spectral par's ..: 3 + 2016-06-29T20:10:30: Prefactor ................: 1.01522 +/- 0.0104442 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T20:10:30: Index ....................: 0.00802507 +/- 0.00643391 [-5,5] (free,scale=1,gradient) + 2016-06-29T20:10:30: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T20:10:30: Number of temporal par's ..: 1 + 2016-06-29T20:10:30: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + +You can have a more fine grained control over the response function by specifying individual filenames for the various response components. An example for an observation definition XML file is shown below. This is definitely expert mode, to be used with utmost care. @@ -265,12 +238,14 @@ file is given below: + + diff --git a/doc/source/users/user_manual/getting_started/beyond_residual.rst b/doc/source/users/user_manual/getting_started/beyond_residual.rst index aa8749e..22d96a0 100644 --- a/doc/source/users/user_manual/getting_started/beyond_residual.rst +++ b/doc/source/users/user_manual/getting_started/beyond_residual.rst @@ -48,8 +48,8 @@ The :ref:`csresmap` script is then used as follows: Output residual map file [resmap.fits] Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT) [SUBDIV] -In our example, the map will cover a field of 4 x 4 degrees centred on the -Crab nebula at a pixel scale of 0.02 degrees per pixel. +In our example, the map will cover a field of 4° x 4° centred on the +Crab nebula at a pixel scale of 0.02° per pixel. The resulting residual map ``resmap.fits``, smoothed with a Gaussian kernel of 3 pixels to enhance features, is shown in the following figure. Obviously, the map is free from any significant residuals. @@ -58,5 +58,5 @@ Obviously, the map is free from any significant residuals. :height: 400px :align: center - *Residual map of the Crab region* + *Residual map of the Crab nebula region* diff --git a/doc/source/users/user_manual/getting_started/beyond_stacked.rst b/doc/source/users/user_manual/getting_started/beyond_stacked.rst index 537d443..9adf29e 100644 --- a/doc/source/users/user_manual/getting_started/beyond_stacked.rst +++ b/doc/source/users/user_manual/getting_started/beyond_stacked.rst @@ -29,17 +29,20 @@ into a single counts cube: Output counts cube file [cntcube.fits] You now have a stacked counts cube ``cntcube.fits`` on disk. -Before you can use that counts cube in a maximum likelihood -analysis, you have to compute the instrument response and the -background model that are needed to describe the stacked data. - -For the former, you have to compute the total exposure for the stacked -cube (i.e. the sum of the effective areas for each observation multiplied -by the corresponding livetimes) and an effective point spread function -(i.e. the point spread function of the different observations weighted by -the corresponding exposures). -To get both informations you use the :ref:`ctexpcube` and -:ref:`ctpsfcube` tools: +Before you can use that counts cube in a maximum likelihood analysis, you have +to compute the instrument response function and the background model that is +needed for the analysis. + +For the instrument response function, you have to compute the total exposure +for the stacked cube (i.e. the sum of the effective areas for each observation +multiplied by the corresponding livetimes) and an effective point spread +function (i.e. the point spread function of the different observations +weighted by the corresponding exposures). +Optionally, you can also compute an effective energy dispersion (i.e. the +energy dispersion of the different observations weighted by the corresponding +exposures). +To get these informations you use the :ref:`ctexpcube`, :ref:`ctpsfcube` and +:ref:`ctedispcube` tools: .. code-block:: bash @@ -69,22 +72,47 @@ To get both informations you use the :ref:`ctexpcube` and Number of energy bins [20] Output PSF cube file [psfcube.fits] -The ``obs.xml`` file has been provided on input to specify for both tools -which observations have been combined. -You further provided the counts cube on input so that :ref:`ctexpcube` can -read the cub definition from that file and apply it to the exposure cube. -This is a trick to reduce the number of user parameters that you need to -provide. - -You do not apply this trick when using :ref:`ctpsfcube` as this -would lead to a hugh output file owing to the fine spatial -pixelisation of the counts cube. -Such a fine binning is not needed for the PSF cube, as the PSF evolves -only slowly over the field of view. -It is thus sufficient to compute a PSF cube with a rather coarse spatial -binning; here you used a spatial binning of 1 degree covering a grid of -10 x 10 degrees. +.. code-block:: bash + + $ ctedispcube + Input event list or observation definition XML file [NONE] obs.xml + Calibration database [prod2] + Instrument response function [South_0.5h] + Input counts cube file to extract energy dispersion cube definition [NONE] + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63] + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01] + Projection method (AIT|AZP|CAR|MER|MOL|STG|TAN) [CAR] + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] + Image scale (in degrees/pixel) [1.0] + Size of the X axis in pixels [10] + Size of the Y axis in pixels [10] + Lower energy limit (TeV) [0.1] + Upper energy limit (TeV) [100.0] + Number of energy bins [20] + Output energy dispersion cube file [edispcube.fits] + +.. note:: + + You may have noticed that for :ref:`ctexpcube` you provided an input counts + cube, while for the other tools you specified ``NONE``. + By providing an input counts cube you instructed :ref:`ctexpcube` to + extract the definition of the exposure cube from the counts cube. This is + a convenient trick to reduce the number of user parameters that you need + to specify. You did however not apply this trick for + :ref:`ctpsfcube` and :ref:`ctedispcube`. In fact, the point spread function + and energy dispersion do not vary significantly on spatial scales of 0.02°, + and using the counts cube definition for these cubes would lead to large + response cube files with a spatial precision that is actually not needed + (the point spread function and energy dispersion cubes are actually + 4-dimensional data cubes, hence their size increases quickly for a large + number of spatial pixels). Therefore, you have specified a larger image + scale of 1° for both cubes and only a small number of 10x10 spatial pixels, + leading to point spread function and energy dispersion cubes of modest size + (a few MB). +You provided the ``obs.xml`` file that defines all observations on input +so that the tools know which observations were combined in the :ref:`ctbin` +run. As final step of the analysis preparation, you need to generate a background cube using the :ref:`ctbkgcube` tool: @@ -100,13 +128,13 @@ background cube using the :ref:`ctbkgcube` tool: Output model XML file [NONE] model.xml The usage of :ref:`ctbkgcube` is very similar to that of :ref:`ctexpcube`, -yet it takes the model XML file as an additional input parameter. +yet it takes the model definition XML file as an additional input parameter. You used here the usual ``$CTOOLS/share/models/crab.xml`` model file that is shipped with the ctools. :ref:`ctbkgcube` provides on output the background cube file -``bkgcube.fits`` and the model XML file ``model.xml`` that can +``bkgcube.fits`` and the model definition XML file ``model.xml`` that can be used for further analysis. -Having a look at ``model.xml`` illustrates how the background +Having a look at the ``model.xml`` file illustrates how the background modelling works: .. code-block:: xml @@ -147,11 +175,10 @@ as an appropriate multiplicator to the background cube. .. note:: There is no constraint on providing the same spatial binning or - the same energy binning for an exposure cube, a PSF cube, - a background cube and a counts cube. - ctools interpolates internally the exposure cube, PSF cube and - background cube values, hence any arbitrary appropriate binning may - be used. + the same energy binning for an exposure cube, a PSF cube, an energy + dispersion cube, a background cube and a counts cube. + ctools interpolates internally all response cubes hence any arbitrary + appropriate binning may be used. Using the same binning for the exposure cube, the background cube and the counts cube is only a convenience. @@ -170,73 +197,86 @@ analysis using the :ref:`ctlike` tool: :ref:`ctlike` recognises that a counts cube should be analysed and queries for the exposure cube, the PSF cube, and the background cube file names. -You specified here the names of the files produced by the :ref:`ctexpcube`, -the :ref:`ctpsfcube` and the :ref:`ctbkgcube` tools. -Furthermore you provided as model the ``model.xml`` file that has been -generated by the :ref:`ctbkgcube` tool. - -The log file of the :ref:`ctlike` run is shown below. -Note that the spectral model that is multiplied with the background -cube has a Prefactor of 0.998 +/- 0.011 and an Index of 0.006 +/- 0.007, -indicating a very small correction to the actual spectrum of the background -cube. -Real life situations may of course require larger correction factors. +If you want to consider also the energy dispersion during the maximum likelihood +fitting you should pass the hidden ``edisp`` parameter to ctlike, and the tool +will also query of the energy dispersion cube: -.. code-block:: xml +.. code-block:: bash + + $ ctlike edisp=yes + Input event list, counts cube or observation definition XML file [cntcube.fits] + Input exposure cube file (only needed for stacked analysis) [expcube.fits] + Input PSF cube file (only needed for stacked analysis) [psfcube.fits] + Input background cube file (only needed for stacked analysis) [bkgcube.fits] + Input energy dispersion cube file (only needed for stacked analysis) [NONE] edispcube.fits + Input model XML file [model.xml] + Output model XML file [crab_results.xml] + +.. warning:: + + The maximum likelihood computations including energy dispersion are + relatively time consuming, and in many situations the impact of the + energy dispersion on the analysis results will be very small. So make + sure that you really need energy dispersion before you are using it. + +The log file of the :ref:`ctlike` run (without energy dispersion) is shown +below. + +.. code-block:: none - 2015-12-07T21:37:45: +=================================+ - 2015-12-07T21:37:45: | Maximum likelihood optimisation | - 2015-12-07T21:37:45: +=================================+ - 2015-12-07T21:37:46: >Iteration 0: -logL=83748.453, Lambda=1.0e-03 - 2015-12-07T21:37:47: >Iteration 1: -logL=83736.039, Lambda=1.0e-03, delta=12.413, max(|grad|)=15.134616 [Index:3] - 2015-12-07T21:37:48: >Iteration 2: -logL=83736.021, Lambda=1.0e-04, delta=0.018, max(|grad|)=0.108613 [Index:3] - 2015-12-07T21:37:49: >Iteration 3: -logL=83736.021, Lambda=1.0e-05, delta=0.000, max(|grad|)=0.000570 [Index:3] + 2016-06-29T19:54:14: +=================================+ + 2016-06-29T19:54:14: | Maximum likelihood optimisation | + 2016-06-29T19:54:14: +=================================+ + 2016-06-29T19:54:15: >Iteration 0: -logL=83633.454, Lambda=1.0e-03 + 2016-06-29T19:54:15: >Iteration 1: -logL=83561.979, Lambda=1.0e-03, delta=71.475, max(|grad|)=153.136163 [Index:7] + 2016-06-29T19:54:16: >Iteration 2: -logL=83561.823, Lambda=1.0e-04, delta=0.156, max(|grad|)=-0.183495 [Prefactor:6] + 2016-06-29T19:54:16: >Iteration 3: -logL=83561.823, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.003347 [Index:3] ... - 2015-12-07T21:37:51: +=========================================+ - 2015-12-07T21:37:51: | Maximum likelihood optimisation results | - 2015-12-07T21:37:51: +=========================================+ - 2015-12-07T21:37:51: === GOptimizerLM === - 2015-12-07T21:37:51: Optimized function value ..: 83736.021 - 2015-12-07T21:37:51: Absolute precision ........: 0.005 - 2015-12-07T21:37:51: Acceptable value decrease .: 2 - 2015-12-07T21:37:51: Optimization status .......: converged - 2015-12-07T21:37:51: Number of parameters ......: 10 - 2015-12-07T21:37:51: Number of free parameters .: 4 - 2015-12-07T21:37:51: Number of iterations ......: 3 - 2015-12-07T21:37:51: Lambda ....................: 1e-06 - 2015-12-07T21:37:51: Maximum log likelihood ....: -83736.021 - 2015-12-07T21:37:51: Observed events (Nobs) ...: 35198.000 - 2015-12-07T21:37:51: Predicted events (Npred) ..: 35198.000 (Nobs - Npred = 7.6773e-07) - 2015-12-07T21:37:51: === GModels === - 2015-12-07T21:37:51: Number of models ..........: 2 - 2015-12-07T21:37:51: Number of parameters ......: 10 - 2015-12-07T21:37:51: === GModelSky === - 2015-12-07T21:37:51: Name ......................: Crab - 2015-12-07T21:37:51: Instruments ...............: all - 2015-12-07T21:37:51: Instrument scale factors ..: unity - 2015-12-07T21:37:51: Observation identifiers ...: all - 2015-12-07T21:37:51: Model type ................: PointSource - 2015-12-07T21:37:51: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" - 2015-12-07T21:37:51: Number of parameters ......: 6 - 2015-12-07T21:37:51: Number of spatial par's ...: 2 - 2015-12-07T21:37:51: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) - 2015-12-07T21:37:51: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) - 2015-12-07T21:37:51: Number of spectral par's ..: 3 - 2015-12-07T21:37:51: Prefactor ................: 5.75289e-16 +/- 7.24749e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - 2015-12-07T21:37:51: Index ....................: -2.53122 +/- 0.0113068 [-0,-5] (free,scale=-1,gradient) - 2015-12-07T21:37:51: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:37:51: Number of temporal par's ..: 1 - 2015-12-07T21:37:51: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - 2015-12-07T21:37:51: === GCTAModelCubeBackground === - 2015-12-07T21:37:51: Name ......................: BackgroundModel - 2015-12-07T21:37:51: Instruments ...............: CTA, HESS, MAGIC, VERITAS - 2015-12-07T21:37:51: Instrument scale factors ..: unity - 2015-12-07T21:37:51: Observation identifiers ...: all - 2015-12-07T21:37:51: Model type ................: "PowerLaw" * "Constant" - 2015-12-07T21:37:51: Number of parameters ......: 4 - 2015-12-07T21:37:51: Number of spectral par's ..: 3 - 2015-12-07T21:37:51: Prefactor ................: 0.998055 +/- 0.0114979 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient) - 2015-12-07T21:37:51: Index ....................: 0.00648796 +/- 0.00697365 [-5,5] (free,scale=1,gradient) - 2015-12-07T21:37:51: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:37:51: Number of temporal par's ..: 1 - 2015-12-07T21:37:51: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T19:54:17: +=========================================+ + 2016-06-29T19:54:17: | Maximum likelihood optimisation results | + 2016-06-29T19:54:17: +=========================================+ + 2016-06-29T19:54:17: === GOptimizerLM === + 2016-06-29T19:54:17: Optimized function value ..: 83561.823 + 2016-06-29T19:54:17: Absolute precision ........: 0.005 + 2016-06-29T19:54:17: Acceptable value decrease .: 2 + 2016-06-29T19:54:17: Optimization status .......: converged + 2016-06-29T19:54:17: Number of parameters ......: 10 + 2016-06-29T19:54:17: Number of free parameters .: 4 + 2016-06-29T19:54:17: Number of iterations ......: 3 + 2016-06-29T19:54:17: Lambda ....................: 1e-06 + 2016-06-29T19:54:17: Maximum log likelihood ....: -83561.823 + 2016-06-29T19:54:17: Observed events (Nobs) ...: 35946.000 + 2016-06-29T19:54:17: Predicted events (Npred) ..: 35946.000 (Nobs - Npred = 1.56502e-05) + 2016-06-29T19:54:17: === GModels === + 2016-06-29T19:54:17: Number of models ..........: 2 + 2016-06-29T19:54:17: Number of parameters ......: 10 + 2016-06-29T19:54:17: === GModelSky === + 2016-06-29T19:54:17: Name ......................: Crab + 2016-06-29T19:54:17: Instruments ...............: all + 2016-06-29T19:54:17: Instrument scale factors ..: unity + 2016-06-29T19:54:17: Observation identifiers ...: all + 2016-06-29T19:54:17: Model type ................: PointSource + 2016-06-29T19:54:17: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T19:54:17: Number of parameters ......: 6 + 2016-06-29T19:54:17: Number of spatial par's ...: 2 + 2016-06-29T19:54:17: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T19:54:17: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T19:54:17: Number of spectral par's ..: 3 + 2016-06-29T19:54:17: Prefactor ................: 5.70255e-16 +/- 7.24185e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T19:54:17: Index ....................: -2.46568 +/- 0.0110458 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T19:54:17: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T19:54:17: Number of temporal par's ..: 1 + 2016-06-29T19:54:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T19:54:17: === GCTAModelCubeBackground === + 2016-06-29T19:54:17: Name ......................: BackgroundModel + 2016-06-29T19:54:17: Instruments ...............: CTA, HESS, MAGIC, VERITAS + 2016-06-29T19:54:17: Instrument scale factors ..: unity + 2016-06-29T19:54:17: Observation identifiers ...: all + 2016-06-29T19:54:17: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T19:54:17: Number of parameters ......: 4 + 2016-06-29T19:54:17: Number of spectral par's ..: 3 + 2016-06-29T19:54:17: Prefactor ................: 0.964885 +/- 0.0109395 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T19:54:17: Index ....................: 0.0220427 +/- 0.00686292 [-5,5] (free,scale=1,gradient) + 2016-06-29T19:54:17: PivotEnergy ..............: 1e+06 MeV (fixed,scale=1e+06,gradient) + 2016-06-29T19:54:17: Number of temporal par's ..: 1 + 2016-06-29T19:54:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) diff --git a/doc/source/users/user_manual/getting_started/beyond_tsmap.rst b/doc/source/users/user_manual/getting_started/beyond_tsmap.rst index 6d5bd17..02ff853 100644 --- a/doc/source/users/user_manual/getting_started/beyond_tsmap.rst +++ b/doc/source/users/user_manual/getting_started/beyond_tsmap.rst @@ -9,7 +9,7 @@ necessarily be the case. You thus need a means to search for significant excess emission in your data. One possibility to accomplish this task is to compute the Test Statistic for a specific source at a grid of trial positions. -The :ref:`cttsmap` tool will exactly do that job. +The :ref:`cttsmap` tool will do exactly that job. The Test Statistic is defined as twice the log-likelihood difference between fitting a source at a given position on top of a model or fitting @@ -20,14 +20,14 @@ exact relation depends somewhat on the formulation of the statistical problem. Here an example of how to apply the :ref:`cttsmap` tool to the two -simulated observations of the Crab in unbinned mode. -On input we provide a source model XML file and the name of the source +simulated observations of the Crab nebula in unbinned mode. +On input you provide a source model XML file and the name of the source in the XML file that should be moved on a grid of test positions. This means that the position of the source given in the XML file is in fact ignored and replaced by the grid positions that are defined by the user parameters. -In the example we defined a grid of 10 x 10 positions around the -nominal position of the Crab nebula with a grid spacing of 0.02 degrees. +In the example you defined a grid of 10 x 10 positions around the +nominal position of the Crab nebula with a grid spacing of 0.02°. .. code-block:: bash @@ -51,7 +51,7 @@ that contains one extension for the Test Statistic value and further extensions for the spectral parameters that have been fitted for the source at each position of the grid. The figure below show the Test Statistic map which reaches a maximum -value of 40733 near the centre of the map. +value of 42622 near the centre of the map. .. figure:: tsmap-crab.png :height: 400px @@ -61,7 +61,7 @@ value of 40733 near the centre of the map. .. note:: - Alike :ref:`ctlike`, the :ref:`cttsmap` tool works either for unbinned, + Similar to :ref:`ctlike` the :ref:`cttsmap` tool works either for unbinned, binned or stacked analysis. On input it takes either a single event list, a single counts cube, or an observation definition XML file that allows a joint analysis of multiple observations. diff --git a/doc/source/users/user_manual/getting_started/binning.rst b/doc/source/users/user_manual/getting_started/binning.rst index 35fac63..b0ac1f5 100644 --- a/doc/source/users/user_manual/getting_started/binning.rst +++ b/doc/source/users/user_manual/getting_started/binning.rst @@ -3,12 +3,11 @@ Binning CTA data ~~~~~~~~~~~~~~~~ -As next analysis step you will bin the data in a counts cube using +As next analysis step you will bin the data into a counts cube using :ref:`ctbin`. -A counts cube is a 3 dimensional data cube, spanned by +A counts cube is a 3-dimensional data cube, spanned by Right Ascension (or Galactic longitude), Declination (or Galactic latitude), -and energy (typically logarithmically spaced, but this is under user -control). +and energy (by default logarithmically spaced, but this is under your control). :ref:`ctbin` is executed by typing: @@ -29,28 +28,37 @@ control). Number of energy bins [20] Output counts cube file [cntcube.fits] -The counts cube will be centred on the location of the Crab (Right Ascension -83.63 degrees, Declination 22.01 degrees) and will be aligned in celestial -coordinates. A cartesian projection has been selected. The counts cube has -200 x 200 spatial pixels of 0.02 x 0.02 degrees in size, hence it covers a -total area of 4 x 4 degrees. - -The counts cube will contain 20 maps, which are logarithmically spaced -in energy, and which cover the energy range from 0.1 TeV to 100 TeV. In this -example, the counts cube will be saved as ``cntcube.fits`` in the working -directory. In addition to the counts cube, that is stored as the primary -image extension, the FITS file also contains an extension named ``EBOUNDS`` -that defines the energy boundaries that were used, and an extension ``GTI`` -that defines the Good Time Intervals that have been used. The following -image shows the resulting FITS file. The ``EBOUNDS`` table has 20 rows, one -for each energy bin, while the ``GTI`` table has just a single row, indicating -the start and stop time of the simulated data. +In this example the events from file ``events.fits`` will be binned into +a counts cube stored into the file ``cntcube.fits``. The counts cube +is centred on the location of the Crab nebula (Right Ascension 83.63°, +Declination 22.01°). A cartesian projection aligned in celestial +coordinates is used and the counts cube has +200 x 200 spatial pixels of 0.02 x 0.02 degrees in size, covering +an area of 4° x 4°, and 20 logarithmically spaced energy bins, covering +an energy range from 0.1 TeV to 100 TeV. + +The ``cntcube.fits`` file produced by :ref:`ctbin` contains four extensions: + +* A primary 3-dimensional image extension providing the number of events + per counts cube bin, +* a 3-dimensional image extension ``WEIGHT`` where each bin gives the + fractional overlap between a counts cube bin and the Region of Interest + covered by the event list, +* a table extension ``EBOUNDS`` that defines the energy boundaries of the + counts cube, and +* a table extension ``GTI`` that defines the Good Time Intervals of the counts + cube. + +The following image shows the ``cntcube.fits`` file produced in the example +above. The ``EBOUNDS`` table has 20 rows, one for each energy bin, while the +``GTI`` table has just a single row, indicating the start and stop time of the +simulated data. .. figure:: cntmap-fits.jpg :width: 600px :align: center - *Counts cube FITS file* + *Extensions of a counts cube FITS file* An image of the first bin, covering the energy range 100 - 141 GeV, is @@ -60,24 +68,23 @@ shown below: :height: 400px :align: center - *Counts cube for first energy bin* + *Image of first energy bin of a counts cube* For illustration, the last few lines of the log file ``ctbin.log`` are reproduced below: -.. code-block:: xml - - 2015-12-07T20:52:41: +=================+ - 2015-12-07T20:52:41: | Bin observation | - 2015-12-07T20:52:41: +=================+ - 2015-12-07T20:52:41: === CTA observation === - 2015-12-07T20:52:41: Events in list ............: 22685 - 2015-12-07T20:52:41: Events in cube ............: 18195 - 2015-12-07T20:52:41: Event bins outside RoI ....: 0 - 2015-12-07T20:52:41: Events outside cube area ..: 4490 - 2015-12-07T20:52:41: Events outside energy bins : 0 - -From the 22685 events that have been simulated and stored in the -``events.fits`` file, 18195 lie within the cube boundaries and are thus put -into the resulting counts cube. The counts cube is stored in a cartesian -projection in a World Coordinate System (WCS) compliant format. +.. code-block:: none + + 2016-06-29T10:33:23: +=================+ + 2016-06-29T10:33:23: | Bin observation | + 2016-06-29T10:33:23: +=================+ + 2016-06-29T10:33:23: === CTA observation === + 2016-06-29T10:33:23: Events in list ............: 23099 + 2016-06-29T10:33:23: Events in cube ............: 18532 + 2016-06-29T10:33:23: Event bins outside RoI ....: 0 + 2016-06-29T10:33:23: Events outside cube area ..: 4567 + 2016-06-29T10:33:23: Events outside energy bins : 0 + +From the 23099 events that have been simulated and stored in the +``events.fits`` file, 18532 lie within the cube boundaries and are thus put +into the resulting counts cube. diff --git a/doc/source/users/user_manual/getting_started/butterfly.rst b/doc/source/users/user_manual/getting_started/butterfly.rst index 26b2b02..4e1b664 100644 --- a/doc/source/users/user_manual/getting_started/butterfly.rst +++ b/doc/source/users/user_manual/getting_started/butterfly.rst @@ -39,7 +39,7 @@ to make this work. To launch the script, type: .. code-block:: bash - python $CTOOLS/share/examples/python/show_butterfly.py butterfly.txt + $CTOOLS/share/examples/python/show_butterfly.py butterfly.txt This will result in a canvas which should look like the following: @@ -47,5 +47,5 @@ This will result in a canvas which should look like the following: :height: 400px :align: center - *Confidence band of the fit* + *Confidence band of the power law fit* \ No newline at end of file diff --git a/doc/source/users/user_manual/getting_started/cntmap-fits.jpg b/doc/source/users/user_manual/getting_started/cntmap-fits.jpg index f9c73aa..265cf59 100644 Binary files a/doc/source/users/user_manual/getting_started/cntmap-fits.jpg and b/doc/source/users/user_manual/getting_started/cntmap-fits.jpg differ diff --git a/doc/source/users/user_manual/getting_started/energy_dispersion.rst b/doc/source/users/user_manual/getting_started/energy_dispersion.rst new file mode 100644 index 0000000..733f8c1 --- /dev/null +++ b/doc/source/users/user_manual/getting_started/energy_dispersion.rst @@ -0,0 +1,129 @@ +.. _sec_edisp_cta: + +Taking into account energy dispersion +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You may not have recognised it, but the examples you have exercised so far +have neglected the impact of energy dispersion on the analysis. In reality, +however, the reconstructed event energy will differ from the true photon energy, +and this effect will become particularily important at low energies. There are +therefore cases where you want to take the effects of energy dispersion into +account, and you can do this in all ctools that make use of the instrument +response functions by setting the hidden ``edisp`` parameter to ``yes``. + +.. warning:: + + The maximum likelihood computations including energy dispersion are + relatively time consuming, and in many situations the impact of the + energy dispersion on the analysis results will be very small. For this + reason, energy dispersion is by default disabled in ctools. + +To simulate events taking into account the energy dispersion you should +run the :ref:`ctobssim` tool with ``edisp=yes`` parameter: + +.. code-block:: bash + + $ ctobssim edisp=yes + RA of pointing (degrees) (0-360) [83.63] + Dec of pointing (degrees) (-90-90) [22.01] + Radius of FOV (degrees) (0-180) [5.0] + Start time (MET in s) [0.0] + End time (MET in s) [1800.0] + Lower energy limit (TeV) [0.1] + Upper energy limit (TeV) [100.0] + Calibration database [prod2] + Instrument response function [South_0.5h] + Input model XML file [$CTOOLS/share/models/crab.xml] + Output event data file or observation definition XML file [events.fits] + +You may then select events as before using the :ref:`ctselect` tool +(since this tool does not need the instrument response function it has no +hidden ``edisp`` parameter): + +.. code-block:: bash + + $ ctselect + Input event list or observation definition XML file [events.fits] + RA for ROI centre (degrees) (0-360) [83.63] + Dec for ROI centre (degrees) (-90-90) [22.01] + Radius of ROI (degrees) (0-180) [3.0] + Start time (CTA MET in seconds) [0.0] + End time (CTA MET in seconds) [0.0] + Lower energy limit (TeV) [0.1] + Upper energy limit (TeV) [100.0] + Output event list or observation definition XML file [selected_events.fits] + +You then perform a maximum likelihood fit using the :ref:`ctlike` tool +with ``edisp=yes`` so that energy dispersion is correctly taken into account +in the likelihood computation: + +.. code-block:: bash + + $ ctlike edisp=yes + Input event list, counts cube or observation definition XML file [selected_events.fits] + Calibration database [prod2] + Instrument response function [South_0.5h] + Input model XML file [$CTOOLS/share/models/crab.xml] + Output model XML file [crab_results.xml] + +Below you see the output from the ``ctlike.log`` file. + +.. code-block:: none + + 2016-06-29T20:33:36: +=================================+ + 2016-06-29T20:33:36: | Maximum likelihood optimisation | + 2016-06-29T20:33:36: +=================================+ + 2016-06-29T20:33:39: >Iteration 0: -logL=133777.933, Lambda=1.0e-03 + 2016-06-29T20:33:42: >Iteration 1: -logL=133772.125, Lambda=1.0e-03, delta=5.808, max(|grad|)=23.221525 [Index:7] + 2016-06-29T20:33:45: >Iteration 2: -logL=133772.111, Lambda=1.0e-04, delta=0.013, max(|grad|)=-0.042654 [Prefactor:6] + 2016-06-29T20:33:48: >Iteration 3: -logL=133772.111, Lambda=1.0e-05, delta=0.000, max(|grad|)=-0.000611 [Index:3] + ... + 2016-06-29T20:33:50: +=========================================+ + 2016-06-29T20:33:50: | Maximum likelihood optimisation results | + 2016-06-29T20:33:50: +=========================================+ + 2016-06-29T20:33:50: === GOptimizerLM === + 2016-06-29T20:33:50: Optimized function value ..: 133772.111 + 2016-06-29T20:33:50: Absolute precision ........: 0.005 + 2016-06-29T20:33:50: Acceptable value decrease .: 2 + 2016-06-29T20:33:50: Optimization status .......: converged + 2016-06-29T20:33:50: Number of parameters ......: 10 + 2016-06-29T20:33:50: Number of free parameters .: 4 + 2016-06-29T20:33:50: Number of iterations ......: 3 + 2016-06-29T20:33:50: Lambda ....................: 1e-06 + 2016-06-29T20:33:50: Maximum log likelihood ....: -133772.111 + 2016-06-29T20:33:50: Observed events (Nobs) ...: 20952.000 + 2016-06-29T20:33:50: Predicted events (Npred) ..: 20952.000 (Nobs - Npred = 1.01277e-06) + 2016-06-29T20:33:50: === GModels === + 2016-06-29T20:33:50: Number of models ..........: 2 + 2016-06-29T20:33:50: Number of parameters ......: 10 + 2016-06-29T20:33:50: === GModelSky === + 2016-06-29T20:33:50: Name ......................: Crab + 2016-06-29T20:33:50: Instruments ...............: all + 2016-06-29T20:33:50: Instrument scale factors ..: unity + 2016-06-29T20:33:50: Observation identifiers ...: all + 2016-06-29T20:33:50: Model type ................: PointSource + 2016-06-29T20:33:50: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T20:33:50: Number of parameters ......: 6 + 2016-06-29T20:33:50: Number of spatial par's ...: 2 + 2016-06-29T20:33:50: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T20:33:50: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T20:33:50: Number of spectral par's ..: 3 + 2016-06-29T20:33:50: Prefactor ................: 5.74029e-16 +/- 1.04025e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T20:33:50: Index ....................: -2.49899 +/- 0.015621 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T20:33:50: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T20:33:50: Number of temporal par's ..: 1 + 2016-06-29T20:33:50: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T20:33:50: === GCTAModelIrfBackground === + 2016-06-29T20:33:50: Name ......................: CTABackgroundModel + 2016-06-29T20:33:50: Instruments ...............: CTA + 2016-06-29T20:33:50: Instrument scale factors ..: unity + 2016-06-29T20:33:50: Observation identifiers ...: all + 2016-06-29T20:33:50: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T20:33:50: Number of parameters ......: 4 + 2016-06-29T20:33:50: Number of spectral par's ..: 3 + 2016-06-29T20:33:50: Prefactor ................: 0.959074 +/- 0.0134496 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T20:33:50: Index ....................: -0.0162199 +/- 0.00850751 [-5,5] (free,scale=1,gradient) + 2016-06-29T20:33:50: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T20:33:50: Number of temporal par's ..: 1 + 2016-06-29T20:33:50: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + diff --git a/doc/source/users/user_manual/getting_started/fitting.rst b/doc/source/users/user_manual/getting_started/fitting.rst index 43e05ad..aef7a03 100644 --- a/doc/source/users/user_manual/getting_started/fitting.rst +++ b/doc/source/users/user_manual/getting_started/fitting.rst @@ -3,10 +3,10 @@ Fitting CTA data ~~~~~~~~~~~~~~~~ -Now we are ready to fit the simulated data with a model. For simplicity -we use in this example the same model that we used to simulate the data +Now you are ready to fit the simulated data with a model. For simplicity +the same model is used in the example that you used to simulate the data with :ref:`ctobssim`. Model fitting is done using the :ref:`ctlike` tool, -and we do the fit by typing: +and you do the fit by typing: .. code-block:: bash @@ -40,8 +40,8 @@ Below we show the XML result file that has been produced by the run: - - + + @@ -51,17 +51,17 @@ Below we show the XML result file that has been produced by the run: - - + + In this example, the ``Prefactor`` and ``Index`` of the spectral model for the -Crab as well as the ``Prefactor`` and ``Index`` of the background spectral +Crab nebula as well as the ``Prefactor`` and ``Index`` of the background spectral model have been fitted (all parameters having the attribute ``free="1"`` are -fitted). Now we see also the effect of having multiplied the background +fitted). Now you see also the effect of having multiplied the background model with a power law. In that way, the amplitude of the background as well as it's spectral slope is adjusted by the fit. Obviously, in this example the adjustment compensates only for the statistical fluctuations @@ -79,67 +79,66 @@ To get more details about the model fitting you can inspect the log file. Below the last lines of the ctlike.log log file that has been produced by this run: -.. code-block:: xml +.. code-block:: none - 2015-12-07T20:55:32: +=================================+ - 2015-12-07T20:55:32: | Maximum likelihood optimisation | - 2015-12-07T20:55:32: +=================================+ - 2015-12-07T20:55:33: >Iteration 0: -logL=54877.412, Lambda=1.0e-03 - 2015-12-07T20:55:35: >Iteration 1: -logL=54875.025, Lambda=1.0e-03, delta=2.387, max(|grad|)=1.856683 [Index:7] - 2015-12-07T20:55:36: >Iteration 2: -logL=54875.024, Lambda=1.0e-04, delta=0.001, max(|grad|)=-0.024661 [Index:3] - 2015-12-07T20:55:36: + 2016-06-29T16:11:05: +=================================+ + 2016-06-29T16:11:05: | Maximum likelihood optimisation | + 2016-06-29T16:11:05: +=================================+ + 2016-06-29T16:11:06: >Iteration 0: -logL=55574.937, Lambda=1.0e-03 + 2016-06-29T16:11:06: >Iteration 1: -logL=55573.383, Lambda=1.0e-03, delta=1.555, max(|grad|)=3.170837 [Index:7] + 2016-06-29T16:11:07: >Iteration 2: -logL=55573.382, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.056280 [Index:3] ... - 2015-12-07T20:55:38: +=========================================+ - 2015-12-07T20:55:38: | Maximum likelihood optimisation results | - 2015-12-07T20:55:38: +=========================================+ - 2015-12-07T20:55:38: === GOptimizerLM === - 2015-12-07T20:55:38: Optimized function value ..: 54875.024 - 2015-12-07T20:55:38: Absolute precision ........: 0.005 - 2015-12-07T20:55:38: Acceptable value decrease .: 2 - 2015-12-07T20:55:38: Optimization status .......: converged - 2015-12-07T20:55:38: Number of parameters ......: 10 - 2015-12-07T20:55:38: Number of free parameters .: 4 - 2015-12-07T20:55:38: Number of iterations ......: 2 - 2015-12-07T20:55:38: Lambda ....................: 1e-05 - 2015-12-07T20:55:38: Maximum log likelihood ....: -54875.024 - 2015-12-07T20:55:38: Observed events (Nobs) ...: 18195.000 - 2015-12-07T20:55:38: Predicted events (Npred) ..: 18194.999 (Nobs - Npred = 0.00146383) - 2015-12-07T20:55:38: === GModels === - 2015-12-07T20:55:38: Number of models ..........: 2 - 2015-12-07T20:55:38: Number of parameters ......: 10 - 2015-12-07T20:55:38: === GModelSky === - 2015-12-07T20:55:38: Name ......................: Crab - 2015-12-07T20:55:38: Instruments ...............: all - 2015-12-07T20:55:38: Instrument scale factors ..: unity - 2015-12-07T20:55:38: Observation identifiers ...: all - 2015-12-07T20:55:38: Model type ................: PointSource - 2015-12-07T20:55:38: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" - 2015-12-07T20:55:38: Number of parameters ......: 6 - 2015-12-07T20:55:38: Number of spatial par's ...: 2 - 2015-12-07T20:55:38: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) - 2015-12-07T20:55:38: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) - 2015-12-07T20:55:38: Number of spectral par's ..: 3 - 2015-12-07T20:55:38: Prefactor ................: 5.78443e-16 +/- 1.01348e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - 2015-12-07T20:55:38: Index ....................: -2.50664 +/- 0.0153631 [-0,-5] (free,scale=-1,gradient) - 2015-12-07T20:55:38: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T20:55:38: Number of temporal par's ..: 1 - 2015-12-07T20:55:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - 2015-12-07T20:55:38: === GCTAModelIrfBackground === - 2015-12-07T20:55:38: Name ......................: CTABackgroundModel - 2015-12-07T20:55:38: Instruments ...............: CTA - 2015-12-07T20:55:38: Instrument scale factors ..: unity - 2015-12-07T20:55:38: Observation identifiers ...: all - 2015-12-07T20:55:38: Model type ................: "PowerLaw" * "Constant" - 2015-12-07T20:55:38: Number of parameters ......: 4 - 2015-12-07T20:55:38: Number of spectral par's ..: 3 - 2015-12-07T20:55:38: Prefactor ................: 0.993018 +/- 0.0160113 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) - 2015-12-07T20:55:38: Index ....................: 0.00269761 +/- 0.00973921 [-5,5] (free,scale=1,gradient) - 2015-12-07T20:55:38: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T20:55:38: Number of temporal par's ..: 1 - 2015-12-07T20:55:38: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T16:11:08: +=========================================+ + 2016-06-29T16:11:08: | Maximum likelihood optimisation results | + 2016-06-29T16:11:08: +=========================================+ + 2016-06-29T16:11:08: === GOptimizerLM === + 2016-06-29T16:11:08: Optimized function value ..: 55573.382 + 2016-06-29T16:11:08: Absolute precision ........: 0.005 + 2016-06-29T16:11:08: Acceptable value decrease .: 2 + 2016-06-29T16:11:08: Optimization status .......: converged + 2016-06-29T16:11:08: Number of parameters ......: 10 + 2016-06-29T16:11:08: Number of free parameters .: 4 + 2016-06-29T16:11:08: Number of iterations ......: 2 + 2016-06-29T16:11:08: Lambda ....................: 1e-05 + 2016-06-29T16:11:08: Maximum log likelihood ....: -55573.382 + 2016-06-29T16:11:08: Observed events (Nobs) ...: 18532.000 + 2016-06-29T16:11:08: Predicted events (Npred) ..: 18531.998 (Nobs - Npred = 0.00243959) + 2016-06-29T16:11:08: === GModels === + 2016-06-29T16:11:08: Number of models ..........: 2 + 2016-06-29T16:11:08: Number of parameters ......: 10 + 2016-06-29T16:11:08: === GModelSky === + 2016-06-29T16:11:08: Name ......................: Crab + 2016-06-29T16:11:08: Instruments ...............: all + 2016-06-29T16:11:08: Instrument scale factors ..: unity + 2016-06-29T16:11:08: Observation identifiers ...: all + 2016-06-29T16:11:08: Model type ................: PointSource + 2016-06-29T16:11:08: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T16:11:08: Number of parameters ......: 6 + 2016-06-29T16:11:08: Number of spatial par's ...: 2 + 2016-06-29T16:11:08: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T16:11:08: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T16:11:08: Number of spectral par's ..: 3 + 2016-06-29T16:11:08: Prefactor ................: 5.79064e-16 +/- 1.01828e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T16:11:08: Index ....................: -2.47177 +/- 0.0154935 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T16:11:08: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T16:11:08: Number of temporal par's ..: 1 + 2016-06-29T16:11:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T16:11:08: === GCTAModelIrfBackground === + 2016-06-29T16:11:08: Name ......................: CTABackgroundModel + 2016-06-29T16:11:08: Instruments ...............: CTA + 2016-06-29T16:11:08: Instrument scale factors ..: unity + 2016-06-29T16:11:08: Observation identifiers ...: all + 2016-06-29T16:11:08: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T16:11:08: Number of parameters ......: 4 + 2016-06-29T16:11:08: Number of spectral par's ..: 3 + 2016-06-29T16:11:08: Prefactor ................: 1.01642 +/- 0.0162226 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T16:11:08: Index ....................: 0.00462945 +/- 0.00964737 [-5,5] (free,scale=1,gradient) + 2016-06-29T16:11:08: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T16:11:08: Number of temporal par's ..: 1 + 2016-06-29T16:11:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) The maximum likelihood optimizer required 2 iterations to converge. This -is pretty fast, but recall that we used the same model file for the simulation +is pretty fast, but recall that you used the same model file for the simulation and for fitting, hence the initial parameter values were already very close to the best fitting values. To see the impact of the initial parameters on the fit result, you may re-run :ref:`ctlike` using another copy of the model @@ -180,16 +179,16 @@ are not too far from the best fitting values). :ref:`ctlike` will then compute the Test Statistic value for that source and dump the result in the log file: - .. code-block:: xml + .. code-block:: none - 2015-12-07T20:58:45: === GModelSky === - 2015-12-07T20:58:45: Name ......................: Crab - 2015-12-07T20:58:45: Instruments ...............: all - 2015-12-07T20:58:45: Test Statistic ............: 21164.4 + 2016-06-29T16:17:38: === GModelSky === + 2016-06-29T16:17:38: Name ......................: Crab + 2016-06-29T16:17:38: Instruments ...............: all + 2016-06-29T16:17:38: Test Statistic ............: 21778.8 The Test Statistic value will also be added as new attribute ``ts`` to the XML result file: .. code-block:: xml - + diff --git a/doc/source/users/user_manual/getting_started/python.rst b/doc/source/users/user_manual/getting_started/python.rst index 49b1638..aaf6fed 100644 --- a/doc/source/users/user_manual/getting_started/python.rst +++ b/doc/source/users/user_manual/getting_started/python.rst @@ -64,26 +64,9 @@ To visualise this container, type: >>> print(sim.obs()) === GObservations === Number of observations ....: 1 + Number of models ..........: 2 + Number of observed events .: 23099 Number of predicted events : 0 - === GCTAObservation === - Name ......................: - Identifier ................: - Instrument ................: CTA - Event file ................: events.fits - Event type ................: EventList - Statistics ................: Poisson - Ontime ....................: 1800 s - Livetime ..................: 1710 s - Deadtime correction .......: 0.95 - User energy range .........: undefined - === GCTAPointing === - Pointing direction ........: (RA,Dec)=(83.63,22.01) - === GCTAResponseIrf === - Caldb mission .............: cta - Caldb instrument ..........: prod2 - Response name .............: South_0.5h - Energy dispersion .........: Not used - Save energy range .........: undefined There is one CTA observation in the container and to visualise the events in that observation you may type: @@ -92,7 +75,7 @@ in that observation you may type: >>> print(sim.obs()[0].events()) === GCTAEventList === - Number of events ..........: 45370 + Number of events ..........: 23099 (disposed in "events.fits") Time interval .............: 51544.5 - 51544.5 days === GEbounds === Number of intervals .......: 1 @@ -125,38 +108,11 @@ terrestrial times (TT) of all events. >>> for event in events: ... print(event) ... - Dir=RA=83.5743, DEC=21.9746 [-0.000617357,-0.000902194] Energy=328.153 GeV Time=-3.15576e+08 s (TT) - Dir=RA=83.5756, DEC=22.0127 [4.78931e-05,-0.000879886] Energy=353.264 GeV Time=-3.15576e+08 s (TT) - Dir=RA=83.6811, DEC=22.0034 [-0.000114612,0.000826825] Energy=550.35 GeV Time=-3.15576e+08 s (TT) + Dir=RA=83.6308, DEC=21.8881 [-0.00212759,1.33661e-05] Energy=106.465 GeV Time=-3.15576e+08 s (TT) + Dir=RA=83.7518, DEC=21.8064 [-0.0035525,0.00197398] Energy=117.706 GeV Time=-3.15576e+08 s (TT) + Dir=RA=83.5545, DEC=22.0933 [0.00145377,-0.00122121] Energy=138.624 GeV Time=-3.15576e+08 s (TT) ... -.. note:: - - If you inspect the event list in detail you may recognise that all - events appear twice in the event list. - This is because we ran :ref:`ctobssim` twice (a first time when calling - the ``execute()`` method and a second time when calling the ``run()`` - method). - **ctobssim will append simulated events to any pre-existing - events in an observation container.** - To get a single simulation you should clear the observation container - and re-run :ref:`ctobssim`: - - .. code-block:: python - - >>> sim.obs().clear() - >>> sim.run() - >>> print(sim.obs()[0].events()) - === GCTAEventList === - Number of events ..........: 22685 - Time interval .............: 51544.5 - 51544.5 days - === GEbounds === - Number of intervals .......: 1 - Energy range ..............: 100 GeV - 100 TeV - === GCTARoi === - ROI centre ................: RA=83.63, DEC=22.01 [0,0] - ROI radius ................: 5 deg - Performing a maximum likelihood analysis in Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -187,7 +143,7 @@ To check how the fit went you can inspect the optimiser used by >>> print(like.opt()) === GOptimizerLM === - Optimized function value ..: 152299.205 + Optimized function value ..: 154553.422 Absolute precision ........: 0.005 Acceptable value decrease .: 2 Optimization status .......: converged @@ -220,8 +176,8 @@ member of the observation container: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) Number of spectral par's ..: 3 - Prefactor ................: 5.81591e-16 +/- 1.01725e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - Index ....................: -2.50618 +/- 0.0153538 [-0,-5] (free,scale=-1,gradient) + Prefactor ................: 5.82698e-16 +/- 1.02186e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + Index ....................: -2.47534 +/- 0.0154764 [-0,-5] (free,scale=-1,gradient) PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) Number of temporal par's ..: 1 Normalization ............: 1 (relative value) (fixed,scale=1,gradient) @@ -233,8 +189,8 @@ member of the observation container: Model type ................: "PowerLaw" * "Constant" Number of parameters ......: 4 Number of spectral par's ..: 3 - Prefactor ................: 0.998788 +/- 0.0118567 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) - Index ....................: 0.00990034 +/- 0.00735768 [-5,5] (free,scale=1,gradient) + Prefactor ................: 1.01266 +/- 0.0119676 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + Index ....................: 0.00474762 +/- 0.00731725 [-5,5] (free,scale=1,gradient) PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) Number of temporal par's ..: 1 Normalization ............: 1 (relative value) (fixed,scale=1,gradient) @@ -250,8 +206,8 @@ This is easy from Python: >>> like.run() >>> print(like.obs().models()) ... - RA .......................: 83.6334 +/- 0.000917669 [-360,360] deg (free,scale=1) - DEC ......................: 22.0144 +/- 0.000836554 [-90,90] deg (free,scale=1) + RA .......................: 83.6327 +/- 0.000916983 [-360,360] deg (free,scale=1) + DEC ......................: 22.0141 +/- 0.00086378 [-90,90] deg (free,scale=1) The ``like.obs().models()`` method provides the model container, using the ``["Crab"]`` operator we access the Crab model in that container and using @@ -293,7 +249,9 @@ the ``fix()`` method. >>> print(like.obs()) === GObservations === Number of observations ....: 1 - Number of predicted events : 22685 + Number of models ..........: 2 + Number of observed events .: 23099 + Number of predicted events : 23099 is okay as the ``ctools.ctlike(sim.obs())`` constructor will create a copy of the observation container that lives within the :ref:`ctlike` @@ -309,6 +267,8 @@ the ``fix()`` method. >>> print(obs) === GObservations === Number of observations ....: 1 + Number of models ..........: 2 + Number of observed events .: 23099 Number of predicted events : 0 @@ -338,8 +298,9 @@ Here an example of how to use ``obsutils``: >>> print(obs) === GObservations === Number of observations ....: 4 + Number of models ..........: 0 + Number of observed events .: 0 Number of predicted events : 0 - ... >>> obs.models(gammalib.GModels("${CTOOLS}/share/models/crab.xml")) >>> obs = obsutils.sim(obs) >>> like = obsutils.fit(obs) @@ -355,8 +316,8 @@ pattern of four observations located at offset angles of 1 degree from the nominal location of the Crab nebula. The ``obsutils.set_obs_list()`` will build an observation container from that pattern where each pointing will have a duration of 1800 seconds, -cover the 0.1-100 TeV energy range and a field of view of 5 degrees. -The standard dummy CTA calibration information will be used. +cover the 0.1-100 TeV energy range and a field of view of 5°. +The ``South_0.5h`` IRF from the Prod2 calibration database will be used. A model is then appended to the observation container using the ``obs.models()`` method. The ``obsutils.sim()`` function then simulates the event data, the @@ -484,4 +445,4 @@ Beyond the first steps You now have learned the basics of using ctools and GammaLib within Python. To go beyond these initial steps you may check the Python scripts in the ``examples`` folder that provide useful analysis examples. -Check the ``README`` file in that folder for an explanation of the scripts. +Check the ``README.md`` file in that folder for an explanation of the scripts. diff --git a/doc/source/users/user_manual/getting_started/quickstart.rst b/doc/source/users/user_manual/getting_started/quickstart.rst index 5e8cc69..8a297f7 100644 --- a/doc/source/users/user_manual/getting_started/quickstart.rst +++ b/doc/source/users/user_manual/getting_started/quickstart.rst @@ -9,9 +9,10 @@ half an hour long CTA observation of the Crab nebula as the single point source within the CTA field of view. You will learn how to bin the event data into a counts cube and how to fit a spatial and spectral model to the data. You will also learn how to analyse directly event lists -without binning the events into a counts cube. Finally we will show how -you can create a butterfly diagram that shows the confidence band of the -fitted spectral model. +without binning the events into a counts cube. We will show how you can +create a butterfly diagram that shows the confidence band of the +fitted spectral model. And you will learn how to take energy dispersion +into account. .. toctree:: :maxdepth: 2 @@ -21,3 +22,4 @@ fitted spectral model. fitting unbinned butterfly + energy_dispersion diff --git a/doc/source/users/user_manual/getting_started/simulating.rst b/doc/source/users/user_manual/getting_started/simulating.rst index 32d42c5..0799cbe 100644 --- a/doc/source/users/user_manual/getting_started/simulating.rst +++ b/doc/source/users/user_manual/getting_started/simulating.rst @@ -153,34 +153,48 @@ The second file produced by :ref:`ctobssim` is a human readable log file that contains information about the job execution. As example, the last lines from this file are shown here: -.. code-block:: xml - - 2015-12-07T20:48:30: +======================+ - 2015-12-07T20:48:30: | Simulate observation | - 2015-12-07T20:48:30: +======================+ - 2015-12-07T20:48:30: === CTA observation === - 2015-12-07T20:48:30: Simulation area ...........: 1.9635e+11 cm2 - 2015-12-07T20:48:30: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, r=5.5 deg - 2015-12-07T20:48:30: Time interval .............: 0 - 1800 s - 2015-12-07T20:48:30: Photon energy range .......: 100 GeV - 100 TeV - 2015-12-07T20:48:30: Event energy range ........: 100 GeV - 100 TeV - 2015-12-07T20:48:30: Use model .................: Crab - 2015-12-07T20:48:30: Normalization .............: 1 [Crab] - 2015-12-07T20:48:30: Flux ......................: 5.87297e-10 [Crab] photons/cm2/s - 2015-12-07T20:48:30: Normalized flux ...........: 5.87297e-10 [Crab] photons/cm2/s - 2015-12-07T20:48:30: Photon rate ...............: 115.316 photons/s [Crab] - 2015-12-07T20:48:31: MC source photons .........: 207547 [Crab] - 2015-12-07T20:48:31: MC source events ..........: 3646 [Crab] - 2015-12-07T20:48:31: MC source events ..........: 3646 (all source models) - 2015-12-07T20:48:33: MC events outside ROI .....: 0 - 2015-12-07T20:48:33: MC background events ......: 19039 - 2015-12-07T20:48:33: MC events .................: 22685 (all models) +.. code-block:: none + + 2016-06-29T10:21:57: +======================+ + 2016-06-29T10:21:57: | Simulate observation | + 2016-06-29T10:21:57: +======================+ + 2016-06-29T10:21:57: === CTA observation === + 2016-06-29T10:21:57: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, radius=5.5 deg + 2016-06-29T10:21:57: Time interval .............: 0 - 1800 s + 2016-06-29T10:21:57: Photon energy range .......: 100 GeV - 199.526 GeV + 2016-06-29T10:21:57: Event energy range ........: 100 GeV - 199.526 GeV + 2016-06-29T10:21:57: Simulation area ..........: 5.75561e+09 cm2 + 2016-06-29T10:21:57: Use model ................: Crab + 2016-06-29T10:21:57: Normalization ............: 1 [Crab] + 2016-06-29T10:21:57: Flux .....................: 3.76031e-10 [Crab] photons/cm2/s + 2016-06-29T10:21:57: Normalized flux ..........: 3.76031e-10 [Crab] photons/cm2/s + 2016-06-29T10:21:57: Photon rate ..............: 2.16429 photons/s [Crab] + 2016-06-29T10:21:57: MC source photons ........: 3889 [Crab] + 2016-06-29T10:21:57: MC source events .........: 1226 [Crab] + 2016-06-29T10:21:57: MC source events .........: 1226 (all source models) + 2016-06-29T10:21:57: Photon energy range .......: 199.526 GeV - 398.107 GeV + ... + 2016-06-29T10:21:57: MC source photons .........: 10759 [Crab] + 2016-06-29T10:21:57: MC source events ..........: 3686 [Crab] + 2016-06-29T10:21:57: MC events outside ROI .....: 0 + 2016-06-29T10:21:57: MC background events ......: 19413 + 2016-06-29T10:21:57: MC events .................: 23099 (all models) Each line starts with the UTC time at which the line has been written. In -this run, 207547 Crab photons have been thrown over an area of 19.6 square -kilometres during a time interval of 1800 seconds. 3646 of these photons have -been registered by CTA as events. In the same time interval, 19039 background -events have been registred by CTA. +this run, 10759 Crab photons have been thrown during a time interval of 1800 +seconds. 3686 of these photons have been registered by CTA as events. In the +same time interval, 19413 background events have been registred by CTA. + +.. note:: + + :ref:`ctobssim` will split the simulated energy range into a number of + slices, controlled via the hidden ``eslices`` parameter (ten energy slices + are used by default). For each energy slice, the simulation area + will be adapted to the effective area of the array in that energy slice, + which helps to keep the computing time low. The log file will provide + information about the simulation in each slice. In the example above, the + simulation results for the first energy slice are shown, followed by a + summary of the results for all slices. You may change the name of the log file using the hidden parameter ``logfile``: diff --git a/doc/source/users/user_manual/getting_started/unbinned.rst b/doc/source/users/user_manual/getting_started/unbinned.rst index 636758e..850bf26 100644 --- a/doc/source/users/user_manual/getting_started/unbinned.rst +++ b/doc/source/users/user_manual/getting_started/unbinned.rst @@ -7,7 +7,7 @@ As gamma-ray events are rare, the counts cubes generated by :ref:`ctbin` will in general be sparsly populated, having many empty pixels, in particular at high energies. An alternative analysis technique consists of working directly on the event -list without binning the events in a counts cube. We will see the benefit of +list without binning the events in a counts cube. You will see the benefit of such an analysis later once you re-run :ref:`ctlike` in unbinned mode. For unbinned analysis you first have to define the data space region over @@ -66,19 +66,22 @@ If they don't exist, :ref:`ctlike` will not execute in unbinned mode. Below some lines of the ``ctselect.log`` file that show the data selection part: -.. code-block:: xml - - 2015-12-06T23:44:52: +=================+ - 2015-12-06T23:44:52: | Event selection | - 2015-12-06T23:44:52: +=================+ - 2015-12-06T23:44:52: === CTA observation === - 2015-12-06T23:44:52: Selected energy range .....: 0.1 - 100 TeV - 2015-12-06T23:44:52: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg - 2015-12-06T23:44:52: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg - 2015-12-06T23:44:52: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg - 2015-12-06T23:44:52: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000 - 2015-12-06T23:44:52: FITS filename .............: /var/tmp/tmp.0.jHg5hJ[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000] - +.. code-block:: none + + 2016-06-29T16:20:10: +=================+ + 2016-06-29T16:20:10: | Event selection | + 2016-06-29T16:20:10: +=================+ + 2016-06-29T16:20:10: === CTA observation === + 2016-06-29T16:20:10: Input filename ............: events.fits + 2016-06-29T16:20:10: Event extension name ......: EVENTS + 2016-06-29T16:20:10: GTI extension name ........: GTI + 2016-06-29T16:20:10: Selected energy range .....: 0.1 - 100 TeV + 2016-06-29T16:20:10: Requested ROI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg + 2016-06-29T16:20:10: ROI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg + 2016-06-29T16:20:10: Selected ROI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg + 2016-06-29T16:20:10: cfitsio selection .........: ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000 + 2016-06-29T16:20:10: FITS filename .............: /var/tmp/tmp.0.3aUIXn[EVENTS][ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000] + .. note:: :ref:`ctobssim` will also write data selection keywords in the event @@ -94,15 +97,14 @@ part: selection, any existing selections, and the selection that was finally applied. -.. warning:: +.. note:: :ref:`ctselect` may of course also be used for event selection prior to binned analysis, for example to select events for a given period in - time. **If you use** :ref:`ctselect` **however to make a spatial or energy - selection, make sure that the counts cube is fully enclosed in the - selection intervals.** Otherwise you will get empty zones in the counts - cube of which the ctools are not aware of, and the subsequent analysis - results will be wrong. + time. The ``WEIGHT`` extension of the counts cube will track the overlap + between the ROI applied by :ref:`ctselect` and the counts cube, and this + information will be transparently used in any further analysis to restrict + the analysis on counts cube bins that contain data. Now that you have selected the events of interest, you can run ctlike in unbinned mode. To do this you have to specify the selected event list @@ -120,19 +122,19 @@ instead of the counts cube: You will recognise that :ref:`ctlike` runs much faster in unbinned mode compared to binned mode. This is understandable as the selected event list contains -only 21203 events, while the binned counts cube we used before had -200 x 200 x 20 = 800000 pixels. As unbinned maximum likelihood fitting loops -over the events (while binned maximum likelihood loops over the pixels), +only 21604 events, while the binned counts cube you used before had +200 x 200 x 20 = 800000 bins. As unbinned maximum likelihood fitting loops +over the events (while binned maximum likelihood loops over the bins), there are much less operations to perform in unbinned than in binned mode (there is some additional overhead in unbinned mode that comes from integrating the models over the region of interest, yet this is negligible compared to the operations needed when looping over all pixels). So as long as you work with small event lists, unbinned mode is faster (this -typically holds up to 100 hours of observing time). +typically holds up to 50 hours of observing time for point sources). Unbinned :ref:`ctlike` should also be more precise as no binning is performed, hence there is no loss of information due to histogramming. -Below you see the corresponding output from the ctlike.log file. The fitted +Below you see the corresponding output from the ``ctlike.log`` file. The fitted parameters are essentially identical to the ones found in binned mode. The slight difference with respect to the binned analysis may be explained by the different event sample that has been used for the analysis: while @@ -140,61 +142,60 @@ binned likelihood works on rectangular counts cubes, unbinned likelihood works on circular event selection regions. It is thus not possible to select exactly the same events for both analyses. -.. code-block:: xml - - 2015-12-07T21:02:17: +=================================+ - 2015-12-07T21:02:17: | Maximum likelihood optimisation | - 2015-12-07T21:02:17: +=================================+ - 2015-12-07T21:02:17: >Iteration 0: -logL=135278.644, Lambda=1.0e-03 - 2015-12-07T21:02:17: >Iteration 1: -logL=135274.475, Lambda=1.0e-03, delta=4.168, max(|grad|)=5.806873 [Index:7] - 2015-12-07T21:02:17: >Iteration 2: -logL=135274.474, Lambda=1.0e-04, delta=0.001, max(|grad|)=-0.009463 [Index:7] - 2015-12-07T21:02:17: - ... - 2015-12-07T21:02:17: +=========================================+ - 2015-12-07T21:02:17: | Maximum likelihood optimisation results | - 2015-12-07T21:02:17: +=========================================+ - 2015-12-07T21:02:17: === GOptimizerLM === - 2015-12-07T21:02:17: Optimized function value ..: 135274.474 - 2015-12-07T21:02:17: Absolute precision ........: 0.005 - 2015-12-07T21:02:17: Acceptable value decrease .: 2 - 2015-12-07T21:02:17: Optimization status .......: converged - 2015-12-07T21:02:17: Number of parameters ......: 10 - 2015-12-07T21:02:17: Number of free parameters .: 4 - 2015-12-07T21:02:17: Number of iterations ......: 2 - 2015-12-07T21:02:17: Lambda ....................: 1e-05 - 2015-12-07T21:02:17: Maximum log likelihood ....: -135274.474 - 2015-12-07T21:02:17: Observed events (Nobs) ...: 21203.000 - 2015-12-07T21:02:17: Predicted events (Npred) ..: 21202.998 (Nobs - Npred = 0.00198937) - 2015-12-07T21:02:17: === GModels === - 2015-12-07T21:02:17: Number of models ..........: 2 - 2015-12-07T21:02:17: Number of parameters ......: 10 - 2015-12-07T21:02:17: === GModelSky === - 2015-12-07T21:02:17: Name ......................: Crab - 2015-12-07T21:02:17: Instruments ...............: all - 2015-12-07T21:02:17: Instrument scale factors ..: unity - 2015-12-07T21:02:17: Observation identifiers ...: all - 2015-12-07T21:02:17: Model type ................: PointSource - 2015-12-07T21:02:17: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" - 2015-12-07T21:02:17: Number of parameters ......: 6 - 2015-12-07T21:02:17: Number of spatial par's ...: 2 - 2015-12-07T21:02:17: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) - 2015-12-07T21:02:17: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) - 2015-12-07T21:02:17: Number of spectral par's ..: 3 - 2015-12-07T21:02:17: Prefactor ................: 5.81583e-16 +/- 1.01727e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) - 2015-12-07T21:02:17: Index ....................: -2.50611 +/- 0.0153542 [-0,-5] (free,scale=-1,gradient) - 2015-12-07T21:02:17: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:02:17: Number of temporal par's ..: 1 - 2015-12-07T21:02:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) - 2015-12-07T21:02:17: === GCTAModelIrfBackground === - 2015-12-07T21:02:17: Name ......................: CTABackgroundModel - 2015-12-07T21:02:17: Instruments ...............: CTA - 2015-12-07T21:02:17: Instrument scale factors ..: unity - 2015-12-07T21:02:17: Observation identifiers ...: all - 2015-12-07T21:02:17: Model type ................: "PowerLaw" * "Constant" - 2015-12-07T21:02:17: Number of parameters ......: 4 - 2015-12-07T21:02:17: Number of spectral par's ..: 3 - 2015-12-07T21:02:17: Prefactor ................: 0.990866 +/- 0.0136406 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) - 2015-12-07T21:02:17: Index ....................: 0.00536014 +/- 0.00839916 [-5,5] (free,scale=1,gradient) - 2015-12-07T21:02:17: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) - 2015-12-07T21:02:17: Number of temporal par's ..: 1 - 2015-12-07T21:02:17: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) +.. code-block:: none + + 2016-06-29T16:24:44: +=================================+ + 2016-06-29T16:24:44: | Maximum likelihood optimisation | + 2016-06-29T16:24:44: +=================================+ + 2016-06-29T16:24:45: >Iteration 0: -logL=137562.094, Lambda=1.0e-03 + 2016-06-29T16:24:45: >Iteration 1: -logL=137560.613, Lambda=1.0e-03, delta=1.481, max(|grad|)=2.548241 [Index:7] + 2016-06-29T16:24:45: >Iteration 2: -logL=137560.613, Lambda=1.0e-04, delta=0.001, max(|grad|)=0.027191 [Index:3] + ... + 2016-06-29T16:24:45: +=========================================+ + 2016-06-29T16:24:45: | Maximum likelihood optimisation results | + 2016-06-29T16:24:45: +=========================================+ + 2016-06-29T16:24:45: === GOptimizerLM === + 2016-06-29T16:24:45: Optimized function value ..: 137560.613 + 2016-06-29T16:24:45: Absolute precision ........: 0.005 + 2016-06-29T16:24:45: Acceptable value decrease .: 2 + 2016-06-29T16:24:45: Optimization status .......: converged + 2016-06-29T16:24:45: Number of parameters ......: 10 + 2016-06-29T16:24:45: Number of free parameters .: 4 + 2016-06-29T16:24:45: Number of iterations ......: 2 + 2016-06-29T16:24:45: Lambda ....................: 1e-05 + 2016-06-29T16:24:45: Maximum log likelihood ....: -137560.613 + 2016-06-29T16:24:45: Observed events (Nobs) ...: 21604.000 + 2016-06-29T16:24:45: Predicted events (Npred) ..: 21603.998 (Nobs - Npred = 0.00202556) + 2016-06-29T16:24:45: === GModels === + 2016-06-29T16:24:45: Number of models ..........: 2 + 2016-06-29T16:24:45: Number of parameters ......: 10 + 2016-06-29T16:24:45: === GModelSky === + 2016-06-29T16:24:45: Name ......................: Crab + 2016-06-29T16:24:45: Instruments ...............: all + 2016-06-29T16:24:45: Instrument scale factors ..: unity + 2016-06-29T16:24:45: Observation identifiers ...: all + 2016-06-29T16:24:45: Model type ................: PointSource + 2016-06-29T16:24:45: Model components ..........: "SkyDirFunction" * "PowerLaw" * "Constant" + 2016-06-29T16:24:45: Number of parameters ......: 6 + 2016-06-29T16:24:45: Number of spatial par's ...: 2 + 2016-06-29T16:24:45: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1) + 2016-06-29T16:24:45: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1) + 2016-06-29T16:24:45: Number of spectral par's ..: 3 + 2016-06-29T16:24:45: Prefactor ................: 5.828e-16 +/- 1.0219e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient) + 2016-06-29T16:24:45: Index ....................: -2.47546 +/- 0.0154751 [-0,-5] (free,scale=-1,gradient) + 2016-06-29T16:24:45: PivotEnergy ..............: 300000 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T16:24:45: Number of temporal par's ..: 1 + 2016-06-29T16:24:45: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) + 2016-06-29T16:24:45: === GCTAModelIrfBackground === + 2016-06-29T16:24:45: Name ......................: CTABackgroundModel + 2016-06-29T16:24:45: Instruments ...............: CTA + 2016-06-29T16:24:45: Instrument scale factors ..: unity + 2016-06-29T16:24:45: Observation identifiers ...: all + 2016-06-29T16:24:45: Model type ................: "PowerLaw" * "Constant" + 2016-06-29T16:24:45: Number of parameters ......: 4 + 2016-06-29T16:24:45: Number of spectral par's ..: 3 + 2016-06-29T16:24:45: Prefactor ................: 1.0132 +/- 0.0138017 [0.001,1000] ph/cm2/s/MeV (free,scale=1,gradient) + 2016-06-29T16:24:45: Index ....................: 0.00653002 +/- 0.00831374 [-5,5] (free,scale=1,gradient) + 2016-06-29T16:24:45: PivotEnergy ..............: 1e+06 [10000,1e+09] MeV (fixed,scale=1e+06,gradient) + 2016-06-29T16:24:45: Number of temporal par's ..: 1 + 2016-06-29T16:24:45: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) -- libgit2 0.21.4