Commit f7d1a4b47b1af0a2cc3ce3ee32501d314c33a141

Authored by Luigi Tibaldo
1 parent 1480f370

redoing quickstart with off-axis observation to add On/Off

doc/source/users/tutorials/quickstart/butterfly.rst
... ... @@ -37,12 +37,12 @@ default is set to 100. Below an excerpt of the first lines of the
37 37 ``butterfly.txt`` file:
38 38  
39 39 .. code-block:: none
  40 +
  41 + 103514.216667934 8.08876441182872e-15 7.86364405017512e-15 8.31388477348232e-15
  42 + 110917.48152624 6.81370736945431e-15 6.62965024227895e-15 6.99776449662967e-15
  43 + 118850.222743702 5.73964152654309e-15 5.58918876927557e-15 5.89009428381061e-15
  44 + 127350.308101666 4.83488401643174e-15 4.71191629605204e-15 4.95785173681143e-15
40 45  
41   - 103514.216667934 7.65729960995773e-15 7.45677281959723e-15 7.85782640031824e-15
42   - 110917.48152624 6.46256412586182e-15 6.2982352355303e-15 6.62689301619334e-15
43   - 118850.222743702 5.45423807455102e-15 5.3195999976704e-15 5.58887615143164e-15
44   - 127350.308101666 4.6032367949486e-15 4.49293900723421e-15 4.71353458266298e-15
45   - 136458.313658893 3.88501358040058e-15 3.7946590323386e-15 3.97536812846257e-15
46 46 ...
47 47  
48 48 A graphical display of the results is shown below:
... ...
doc/source/users/tutorials/quickstart/cntmap-map.jpg

22.7 KB | W: | H:

3.89 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/quickstart/fitting.rst
... ... @@ -24,12 +24,16 @@ typing:
24 24 Output model definition XML file [crab_results.xml]
25 25  
26 26 The data are fitted in *binned* mode, which means that the events
27   -have been binned into a counts cube and the fit computes the log-likelihood
  27 +have been binned into a 3D counts cube and the fit computes the log-likelihood
28 28 function by summing over all 200 x 200 x 20 bins of the counts cube. There is
29 29 an alternative method, the so called *unbinned* mode, where the events are
30 30 not binned into a counts cube and the log-likelihood is computed directly by
31 31 summing over all events.
32   -:ref:`We will explore the unbinned mode later <start_unbinned>`.
  32 +:ref:`We will explore the unbinned mode later <start_unbinned>`. Yet a
  33 +third alternative method (*On/Off* mode) consists in binning the events only in energy
  34 +integrating over arrival direction within a Source (On) and one or
  35 +more Background (Off) regions to minimise the dependency on the IRF
  36 +background model. :ref:`We will explore the On/Off mode later <start_onoff>`
33 37  
34 38 The :ref:`ctlike` tool produced a
35 39 :ref:`model definition XML output file <glossary_moddef>`
... ... @@ -45,27 +49,27 @@ that was produced by the run:
45 49  
46 50 .. code-block:: xml
47 51  
48   - <?xml version="1.0" encoding="UTF-8" standalone="no"?>
49   - <source_library title="source library">
50   - <source name="Crab" type="PointSource">
51   - <spectrum type="PowerLaw">
52   - <parameter name="Prefactor" value="5.61368377731832" error="0.0982975197293023" scale="1e-16" min="1e-07" max="1000" free="1" />
53   - <parameter name="Index" value="2.45569249143075" error="0.0145471260625612" scale="-1" min="0" max="5" free="1" />
54   - <parameter name="PivotEnergy" value="0.3" scale="1000000" min="0.01" max="1000" free="0" />
55   - </spectrum>
56   - <spatialModel type="PointSource">
57   - <parameter name="RA" value="83.6331" scale="1" min="-360" max="360" free="0" />
58   - <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" />
59   - </spatialModel>
60   - </source>
61   - <source name="BackgroundModel" type="CTACubeBackground" instrument="CTA,HESS,MAGIC,VERITAS">
62   - <spectrum type="PowerLaw">
63   - <parameter name="Prefactor" value="0.945994938701748" error="0.0148673466828289" scale="1" min="0.01" max="100" free="1" />
64   - <parameter name="Index" value="0.0198073832868029" error="0.00948925246912034" scale="1" min="-5" max="5" free="1" />
65   - <parameter name="PivotEnergy" value="1" scale="1000000" free="0" />
66   - </spectrum>
67   - </source>
68   - </source_library>
  52 + <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  53 + <source_library title="source library">
  54 + <source name="Crab" type="PointSource">
  55 + <spectrum type="PowerLaw">
  56 + <parameter name="Prefactor" value="5.75838848465398" error="0.106769545262219" scale="1e-16" min="1e-07" max="1000" free="1" />
  57 + <parameter name="Index" value="2.48329029246896" error="0.0156629819926589" scale="-1" min="0" max="5" free="1" />
  58 + <parameter name="PivotEnergy" value="0.3" scale="1000000" min="0.01" max="1000" free="0" />
  59 + </spectrum>
  60 + <spatialModel type="PointSource">
  61 + <parameter name="RA" value="83.6331" scale="1" min="-360" max="360" free="0" />
  62 + <parameter name="DEC" value="22.0145" scale="1" min="-90" max="90" free="0" />
  63 + </spatialModel>
  64 + </source>
  65 + <source name="BackgroundModel" type="CTACubeBackground" instrument="CTA,HESS,MAGIC,VERITAS">
  66 + <spectrum type="PowerLaw">
  67 + <parameter name="Prefactor" value="1.01452697987952" error="0.0164053949309481" scale="1" min="0.01" max="100" free="1" />
  68 + <parameter name="Index" value="0.0139985850735283" error="0.00978611932246665" scale="1" min="-5" max="5" free="1" />
  69 + <parameter name="PivotEnergy" value="1" scale="1000000" free="0" />
  70 + </spectrum>
  71 + </source>
  72 + </source_library>
69 73  
70 74 In this example, the ``Prefactor`` and ``Index`` of the spectral model for the
71 75 Crab nebula as well as the ``Prefactor`` and ``Index`` of the background spectral
... ... @@ -98,62 +102,63 @@ Below the last lines of the log file that was produced by this run:
98 102  
99 103 .. code-block:: none
100 104  
101   - 2017-08-08T20:24:06: +=================================+
102   - 2017-08-08T20:24:06: | Maximum likelihood optimisation |
103   - 2017-08-08T20:24:06: +=================================+
104   - 2017-08-08T20:24:07: >Iteration 0: -logL=56488.484, Lambda=1.0e-03
105   - 2017-08-08T20:24:07: >Iteration 1: -logL=56431.025, Lambda=1.0e-03, delta=57.459, step=1.0e+00, max(|grad|)=128.772103 [Index:7]
106   - 2017-08-08T20:24:08: >Iteration 2: -logL=56430.794, Lambda=1.0e-04, delta=0.232, step=1.0e+00, max(|grad|)=0.505741 [Index:7]
107   - 2017-08-08T20:24:09: >Iteration 3: -logL=56430.794, Lambda=1.0e-05, delta=0.000, step=1.0e+00, max(|grad|)=0.017423 [Index:3]
108   - 2017-08-08T20:24:09:
109   - 2017-08-08T20:24:09: +=========================================+
110   - 2017-08-08T20:24:09: | Maximum likelihood optimisation results |
111   - 2017-08-08T20:24:09: +=========================================+
112   - 2017-08-08T20:24:09: === GOptimizerLM ===
113   - 2017-08-08T20:24:09: Optimized function value ..: 56430.794
114   - 2017-08-08T20:24:09: Absolute precision ........: 0.005
115   - 2017-08-08T20:24:09: Acceptable value decrease .: 2
116   - 2017-08-08T20:24:09: Optimization status .......: converged
117   - 2017-08-08T20:24:09: Number of parameters ......: 10
118   - 2017-08-08T20:24:09: Number of free parameters .: 4
119   - 2017-08-08T20:24:09: Number of iterations ......: 3
120   - 2017-08-08T20:24:09: Lambda ....................: 1e-06
121   - 2017-08-08T20:24:09: Maximum log likelihood ....: -56430.794
122   - 2017-08-08T20:24:09: Observed events (Nobs) ...: 18827.000
123   - 2017-08-08T20:24:09: Predicted events (Npred) ..: 18827.000 (Nobs - Npred = 1.92705083463807e-05)
124   - 2017-08-08T20:24:09: === GModels ===
125   - 2017-08-08T20:24:09: Number of models ..........: 2
126   - 2017-08-08T20:24:09: Number of parameters ......: 10
127   - 2017-08-08T20:24:09: === GModelSky ===
128   - 2017-08-08T20:24:09: Name ......................: Crab
129   - 2017-08-08T20:24:09: Instruments ...............: all
130   - 2017-08-08T20:24:09: Instrument scale factors ..: unity
131   - 2017-08-08T20:24:09: Observation identifiers ...: all
132   - 2017-08-08T20:24:09: Model type ................: PointSource
133   - 2017-08-08T20:24:09: Model components ..........: "PointSource" * "PowerLaw" * "Constant"
134   - 2017-08-08T20:24:09: Number of parameters ......: 6
135   - 2017-08-08T20:24:09: Number of spatial par's ...: 2
136   - 2017-08-08T20:24:09: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
137   - 2017-08-08T20:24:09: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
138   - 2017-08-08T20:24:09: Number of spectral par's ..: 3
139   - 2017-08-08T20:24:09: Prefactor ................: 5.61368377731832e-16 +/- 9.82975197293023e-18 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
140   - 2017-08-08T20:24:09: Index ....................: -2.45569249143075 +/- 0.0145471260625612 [-0,-5] (free,scale=-1,gradient)
141   - 2017-08-08T20:24:09: PivotEnergy ..............: 300000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)
142   - 2017-08-08T20:24:09: Number of temporal par's ..: 1
143   - 2017-08-08T20:24:09: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
144   - 2017-08-08T20:24:09: === GCTAModelCubeBackground ===
145   - 2017-08-08T20:24:09: Name ......................: BackgroundModel
146   - 2017-08-08T20:24:09: Instruments ...............: CTA, HESS, MAGIC, VERITAS
147   - 2017-08-08T20:24:09: Instrument scale factors ..: unity
148   - 2017-08-08T20:24:09: Observation identifiers ...: all
149   - 2017-08-08T20:24:09: Model type ................: "PowerLaw" * "Constant"
150   - 2017-08-08T20:24:09: Number of parameters ......: 4
151   - 2017-08-08T20:24:09: Number of spectral par's ..: 3
152   - 2017-08-08T20:24:09: Prefactor ................: 0.945994938701748 +/- 0.0148673466828289 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient)
153   - 2017-08-08T20:24:09: Index ....................: 0.0198073832868029 +/- 0.00948925246912034 [-5,5] (free,scale=1,gradient)
154   - 2017-08-08T20:24:09: PivotEnergy ..............: 1000000 MeV (fixed,scale=1000000,gradient)
155   - 2017-08-08T20:24:09: Number of temporal par's ..: 1
156   - 2017-08-08T20:24:09: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  105 + 2017-11-28T15:36:34: +=================================+
  106 + 2017-11-28T15:36:34: | Maximum likelihood optimisation |
  107 + 2017-11-28T15:36:34: +=================================+
  108 + 2017-11-28T15:36:34: >Iteration 0: -logL=52917.614, Lambda=1.0e-03
  109 + 2017-11-28T15:36:35: >Iteration 1: -logL=52916.284, Lambda=1.0e-03, delta=1.330, step=1.0e+00, m
  110 + ax(|grad|)=-2.668420 [Prefactor:6]
  111 + 2017-11-28T15:36:35: >Iteration 2: -logL=52916.283, Lambda=1.0e-04, delta=0.001, step=1.0e+00, m
  112 + ax(|grad|)=-0.037269 [Index:7]
  113 + 2017-11-28T15:36:36:
  114 + 2017-11-28T15:36:36: +=========================================+
  115 + 2017-11-28T15:36:36: | Maximum likelihood optimisation results |
  116 + 2017-11-28T15:36:36: +=========================================+
  117 + 2017-11-28T15:36:36: === GOptimizerLM ===
  118 + 2017-11-28T15:36:36: Optimized function value ..: 52916.283
  119 + 2017-11-28T15:36:36: Absolute precision ........: 0.005
  120 + 2017-11-28T15:36:36: Acceptable value decrease .: 2
  121 + 2017-11-28T15:36:36: Optimization status .......: converged
  122 + 2017-11-28T15:36:36: Number of parameters ......: 10
  123 + 2017-11-28T15:36:36: Number of free parameters .: 4
  124 + 2017-11-28T15:36:36: Number of iterations ......: 2
  125 + 2017-11-28T15:36:36: Lambda ....................: 1e-05
  126 + 2017-11-28T15:36:36: Maximum log likelihood ....: -52916.283
  127 + 2017-11-28T15:36:36: Observed events (Nobs) ...: 17279.000
  128 + 2017-11-28T15:36:36: Predicted events (Npred) ..: 17278.995 (Nobs - Npred = 0.00451555556355743)
  129 + 2017-11-28T15:36:36: === GModels ===
  130 + 2017-11-28T15:36:36: Number of models ..........: 2
  131 + 2017-11-28T15:36:36: Number of parameters ......: 10
  132 + 2017-11-28T15:36:36: === GModelSky ===
  133 + 2017-11-28T15:36:36: Name ......................: Crab
  134 + 2017-11-28T15:36:36: Instruments ...............: all
  135 + 2017-11-28T15:36:36: Instrument scale factors ..: unity
  136 + 2017-11-28T15:36:36: Observation identifiers ...: all
  137 + 2017-11-28T15:36:36: Model type ................: PointSource
  138 + 2017-11-28T15:36:36: Model components ..........: "PointSource" * "PowerLaw" * "Constant"
  139 + 2017-11-28T15:36:36: Number of parameters ......: 6
  140 + 2017-11-28T15:36:36: Number of spatial par's ...: 2
  141 + 2017-11-28T15:36:36: RA .......................: 83.6331 [-360,360] deg (fixed,scale=1)
  142 + 2017-11-28T15:36:36: DEC ......................: 22.0145 [-90,90] deg (fixed,scale=1)
  143 + 2017-11-28T15:36:36: Number of spectral par's ..: 3
  144 + 2017-11-28T15:36:36: Prefactor ................: 5.75838848465398e-16 +/- 1.06769545262219e-17 [1e-23,1e-13] ph/cm2/s/MeV (free,scale=1e-16,gradient)
  145 + 2017-11-28T15:36:36: Index ....................: -2.48329029246896 +/- 0.0156629819926589 [-0,-5] (free,scale=-1,gradient)
  146 + 2017-11-28T15:36:36: PivotEnergy ..............: 300000 [10000,1000000000] MeV (fixed,scale=1000000,gradient)
  147 + 2017-11-28T15:36:36: Number of temporal par's ..: 1
  148 + 2017-11-28T15:36:36: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
  149 + 2017-11-28T15:36:36: === GCTAModelCubeBackground ===
  150 + 2017-11-28T15:36:36: Name ......................: BackgroundModel
  151 + 2017-11-28T15:36:36: Instruments ...............: CTA, HESS, MAGIC, VERITAS
  152 + 2017-11-28T15:36:36: Instrument scale factors ..: unity
  153 + 2017-11-28T15:36:36: Observation identifiers ...: all
  154 + 2017-11-28T15:36:36: Model type ................: "PowerLaw" * "Constant"
  155 + 2017-11-28T15:36:36: Number of parameters ......: 4
  156 + 2017-11-28T15:36:36: Number of spectral par's ..: 3
  157 + 2017-11-28T15:36:36: Prefactor ................: 1.01452697987952 +/- 0.0164053949309481 [0.01,100] ph/cm2/s/MeV (free,scale=1,gradient)
  158 + 2017-11-28T15:36:36: Index ....................: 0.0139985850735283 +/- 0.00978611932246665 [-5,5] (free,scale=1,gradient)
  159 + 2017-11-28T15:36:36: PivotEnergy ..............: 1000000 MeV (fixed,scale=1000000,gradient)
  160 + 2017-11-28T15:36:36: Number of temporal par's ..: 1
  161 + 2017-11-28T15:36:36: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
157 162  
158 163 The maximum likelihood optimizer required 3 iterations to converge. This
159 164 is pretty fast, but recall that you used the same model file for the simulation
... ... @@ -182,10 +187,11 @@ are not too far from the best fitting values).
182 187 significance for sources in the XML model. This is done by computing
183 188 the Test Statistic value which is defined as twice the log-likelihood
184 189 difference between fitting a source at a given position on top of a
185   - (background) model or fitting no source. Roughly speaken, the square
  190 + (background) model or fitting no source. As a rule of thumb, the square
186 191 root of the Test Statistic value gives the source detection significance
187   - in Gaussian sigmas, although the exact relation depends somewhat on
188   - the formulation of the statistical problem.
  192 + in Gaussian sigmas, although the actual conversion depends somewhat on
  193 + the formulation of the statistical problem and the number of
  194 + degrees of freedom associated with the source.
189 195  
190 196 To instruct :ref:`ctlike` to compute the Test Statistic value for a
191 197 given source you need to add the attribute ``tscalc="1"`` to the XML
... ... @@ -200,14 +206,14 @@ are not too far from the best fitting values).
200 206  
201 207 .. code-block:: none
202 208  
203   - 2017-08-08T20:34:29: === GModelSky ===
204   - 2017-08-08T20:34:29: Name ......................: Crab
205   - 2017-08-08T20:34:29: Instruments ...............: all
206   - 2017-08-08T20:34:29: Test Statistic ............: 21873.9558591403
  209 + 2017-11-28T15:47:53: Name ......................: Crab
  210 + 2017-11-28T15:47:53: Instruments ...............: all
  211 + 2017-11-28T15:47:53: Test Statistic ............: 19478.9230755261
  212 +
207 213  
208 214 The Test Statistic value will also be added as new attribute
209 215 ``ts`` to the XML result file:
210 216  
211 217 .. code-block:: xml
212 218  
213   - <source name="Crab" type="PointSource" ts="21873.956" tscalc="1">
  219 + <source name="Crab" type="PointSource" ts="19478.923" tscalc="1">
... ...
doc/source/users/tutorials/quickstart/index.rst
... ... @@ -21,5 +21,6 @@ examples should take about an hour, so grab some coffee before you start.
21 21 butterfly
22 22 spectrum
23 23 unbinned
  24 + onoff
24 25 energy_dispersion
25 26 ctools-from-python
... ...
doc/source/users/tutorials/quickstart/onoff.rst 0 โ†’ 100644
  1 +.. _start_onoff:
  2 +
  3 +Doing an On/Off analysis
  4 +--------------------------
  5 +
  6 + .. admonition:: What you will learn
  7 +
  8 + You will learn how to **adjust a parametrised spectral model to
  9 + the events deriving the bacground from the data**.
  10 +
  11 + Gamma-ray events are rare compared to the background events,
  12 + hence small imperfections of the background model can have a
  13 + large impact on the estimated source parameters.
  14 +
  15 + In classical IACT analyses the background has been normally
  16 + derived from the data, by defining On (source) and Off
  17 + (background) regions. An On/Off analysis is recommended if you
  18 + want to assure minimal dependency on the Monte Carlo background model.
  19 +
... ...
doc/source/users/tutorials/quickstart/residuals.jpg

366 KB | W: | H:

16.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/quickstart/selecting.rst
... ... @@ -35,43 +35,46 @@ event selection:
35 35  
36 36 .. code-block:: none
37 37  
38   - 2017-08-08T19:48:43: +===================+
39   - 2017-08-08T19:48:43: | Input observation |
40   - 2017-08-08T19:48:43: +===================+
41   - 2017-08-08T19:48:43: === GObservations ===
42   - 2017-08-08T19:48:43: Number of observations ....: 1
43   - 2017-08-08T19:48:43: Number of models ..........: 0
44   - 2017-08-08T19:48:43: Number of observed events .: 202766
45   - 2017-08-08T19:48:43: Number of predicted events : 0
46   - 2017-08-08T19:48:43:
47   - 2017-08-08T19:48:43: +=================+
48   - 2017-08-08T19:48:43: | Event selection |
49   - 2017-08-08T19:48:43: +=================+
50   - 2017-08-08T19:48:43: === CTA observation ===
51   - 2017-08-08T19:48:43: Input filename ............: events.fits
52   - 2017-08-08T19:48:43: Event extension name ......: EVENTS
53   - 2017-08-08T19:48:43: GTI extension name ........: GTI
54   - 2017-08-08T19:48:43: === Event selection ===
55   - 2017-08-08T19:48:43: Time range (MJD) ..........: 58849.0077451852 - 58849.0285785185 days
56   - 2017-08-08T19:48:43: Time range (UTC) ..........: 2020-01-01T00:10:00 - 2020-01-01T00:40:00
57   - 2017-08-08T19:48:43: Time range (MET) ..........: 631109469.184 - 631111269.184 seconds
58   - 2017-08-08T19:48:43: Selected energy range .....: 0.1 - 100 TeV
59   - 2017-08-08T19:48:43: Requested RoI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
60   - 2017-08-08T19:48:43: RoI of data ...............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=5 deg
61   - 2017-08-08T19:48:43: Selected RoI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
62   - 2017-08-08T19:48:43: cfitsio selection .........: TIME >= 631109469.18399978 && TIME <= 631111269.18400002 && ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000
63   - 2017-08-08T19:48:43: FITS filename .............: /var/tmp/tmp.0.FLddl1[EVENTS][TIME >= 631109469.18399978 && TIME <= 631111269.18400002 && ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000]
64   - 2017-08-08T19:48:43:
65   - 2017-08-08T19:48:43: +====================+
66   - 2017-08-08T19:48:43: | Output observation |
67   - 2017-08-08T19:48:43: +====================+
68   - 2017-08-08T19:48:43: === GObservations ===
69   - 2017-08-08T19:48:43: Number of observations ....: 1
70   - 2017-08-08T19:48:43: Number of models ..........: 0
71   - 2017-08-08T19:48:43: Number of observed events .: 21991
72   - 2017-08-08T19:48:43: Number of predicted events : 0
  38 + 2017-11-28T14:21:57: +===================+
  39 + 2017-11-28T14:21:57: | Input observation |
  40 + 2017-11-28T14:21:57: +===================+
  41 + 2017-11-28T14:21:57: === GObservations ===
  42 + 2017-11-28T14:21:57: Number of observations ....: 1
  43 + 2017-11-28T14:21:57: Number of models ..........: 0
  44 + 2017-11-28T14:21:57: Number of observed events .: 200833
  45 + 2017-11-28T14:21:57: Number of predicted events : 0
  46 + 2017-11-28T14:21:57:
  47 + 2017-11-28T14:21:57: +=================+
  48 + 2017-11-28T14:21:57: | Event selection |
  49 + 2017-11-28T14:21:57: +=================+
  50 + 2017-11-28T14:21:57: === CTA observation ===
  51 + 2017-11-28T14:21:57: Input filename ............: events.fits
  52 + 2017-11-28T14:21:57: Event extension name ......: EVENTS
  53 + 2017-11-28T14:21:57: GTI extension name ........: GTI
  54 + 2017-11-28T14:21:58: === Event selection ===
  55 + 2017-11-28T14:21:58: Time range (MJD) ..........: 58849.0077451852 - 58849.0285785185 days
  56 + 2017-11-28T14:21:58: Time range (UTC) ..........: 2020-01-01T00:10:00 - 2020-01-01T00:40:00
  57 + 2017-11-28T14:21:58: Time range (MET) ..........: 631109469.184 - 631111269.184 seconds
  58 + 2017-11-28T14:21:58: Selected energy range .....: 0.1 - 100 TeV
  59 + 2017-11-28T14:21:58: Requested RoI .............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  60 + 2017-11-28T14:21:58: RoI of data ...............: Centre(RA,DEC)=(83.5, 22.8) deg, Radius=5 deg
  61 + 2017-11-28T14:21:58: Selected RoI ..............: Centre(RA,DEC)=(83.63, 22.01) deg, Radius=3 deg
  62 + 2017-11-28T14:21:58: cfitsio selection .........: TIME >= 631109469.18399978 && TIME <= 631111269.18400002 && ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000
  63 + 2017-11-28T14:21:58: FITS filename .............: /var/tmp/tmp.0.Nc6oWk[EVENTS][TIME >= 631109469.18399978 && TIME <= 631111269.18400002 && ENERGY >= 0.10000000 && ENERGY <= 100.00000000 && ANGSEP(83.630000,22.010000,RA,DEC) <= 3.000000]
  64 + 2017-11-28T14:21:58:
  65 + 2017-11-28T14:21:58: +====================+
  66 + 2017-11-28T14:21:58: | Output observation |
  67 + 2017-11-28T14:21:58: +====================+
  68 + 2017-11-28T14:21:58: === GObservations ===
  69 + 2017-11-28T14:21:58: Number of observations ....: 1
  70 + 2017-11-28T14:21:58: Number of models ..........: 0
  71 + 2017-11-28T14:21:58: Number of observed events .: 20877
  72 + 2017-11-28T14:21:58: Number of predicted events : 0
  73 + 2017-11-28T14:21:58:
  74 + 2017-11-28T14:21:58: +=================+
73 75  
74   -From the 202766 events in the input event list 21991 events were selected.
  76 +
  77 +From the 200833 events in the input event list 20877 events were selected.
75 78  
76 79 .. note::
77 80  
... ...
doc/source/users/tutorials/quickstart/simulating.rst
... ... @@ -24,18 +24,18 @@ characteristics of the simulation:
24 24  
25 25 .. code-block:: bash
26 26  
27   - $ ctobssim
28   - RA of pointing (degrees) (0-360) [83.63]
29   - Dec of pointing (degrees) (-90-90) [22.01]
30   - Radius of FOV (degrees) (0-180) [5.0]
31   - Start time (UTC string, JD, MJD or MET in seconds) [2020-01-01T00:00:00]
32   - Stop time (UTC string, JD, MJD or MET in seconds) [2020-01-01T00:30:00] 2020-01-01T01:00:00
33   - Lower energy limit (TeV) [0.03]
34   - Upper energy limit (TeV) [200.0]
35   - Calibration database [prod2]
36   - Instrument response function [South_0.5h]
37   - Input model XML file [$CTOOLS/share/models/crab.xml]
38   - Output event data file or observation definition XML file [events.fits]
  27 + $ ctobssim
  28 + RA of pointing (degrees) (0-360) [83.63] 83.5
  29 + Dec of pointing (degrees) (-90-90) [22.01] 22.8
  30 + Radius of FOV (degrees) (0-180) [5.0]
  31 + Start time (UTC string, JD, MJD or MET in seconds) [2020-01-01T00:00:00]
  32 + Stop time (UTC string, JD, MJD or MET in seconds) [2020-01-01T01:00:00] 2020-01-01T01:00:00
  33 + Lower energy limit (TeV) [0.03]
  34 + Upper energy limit (TeV) [200.]
  35 + Calibration database [prod2]
  36 + Instrument response function [South_0.5h]
  37 + Input model definition XML file [$CTOOLS/share/models/crab.xml]
  38 + Output event data file or observation definition XML file [events.fits]
39 39  
40 40 Each line represents a query for one parameter value.
41 41 The line starts with a short description of the parameter, followed by
... ... @@ -160,6 +160,12 @@ where the parameters in the XML definition have the following mappings:
160 160 convention that can not be modified. So make sure you always use
161 161 MeV as energy unit in an XML file.
162 162  
  163 + .. note::
  164 + As customary for IACT observations, the pointing direction
  165 + was slightly offset from the source of interest, i.e.,
  166 + the Crab. This makes it possible to better handle systematics due
  167 + to the instrumental background.
  168 +
163 169 The instrumental background of CTA is modelled using the background
164 170 information provided in the
165 171 :ref:`instrument response function <glossary_irf>`
... ... @@ -205,33 +211,33 @@ from this file are shown here:
205 211  
206 212 .. code-block:: none
207 213  
208   - 2017-08-08T19:28:54: === CTA observation ===
209   - 2017-08-08T19:28:54: Simulation cone ...........: RA=83.63 deg, Dec=22.01 deg, radius=5.5 deg
210   - 2017-08-08T19:28:54: Time interval .............: 6.31109e+08 - 6.31112e+08 s
211   - 2017-08-08T19:28:54: Photon energy range .......: 30 GeV - 72.3622611060088 GeV
212   - 2017-08-08T19:28:54: Event energy range ........: 30 GeV - 72.3622611060088 GeV
213   - 2017-08-08T19:28:54: Simulation area ..........: 1.97769e+09 cm2
214   - 2017-08-08T19:28:54: Use model ................: Crab
215   - 2017-08-08T19:28:54: Normalization ............: 1 [Crab]
216   - 2017-08-08T19:28:54: Flux .....................: 2.5413e-09 [Crab] photons/cm2/s
217   - 2017-08-08T19:28:54: Normalized flux ..........: 2.5413e-09 [Crab] photons/cm2/s
218   - 2017-08-08T19:28:54: Photon rate ..............: 5.0259 photons/s [Crab]
219   - 2017-08-08T19:28:54: MC source photons ........: 18186 [Crab]
220   - 2017-08-08T19:28:54: MC source events .........: 4175 [Crab]
221   - 2017-08-08T19:28:54: MC source events .........: 4175 (all source models)
222   - 2017-08-08T19:28:54: Photon energy range .......: 72.3622611060088 GeV - 174.543227745807 GeV
223   - ...
224   - 2017-08-08T19:28:54: MC source photons .........: 47371 [Crab]
225   - 2017-08-08T19:28:54: MC source events ..........: 13227 [Crab]
226   - 2017-08-08T19:29:02: MC events outside ROI .....: 0
227   - 2017-08-08T19:29:02: MC background events ......: 189539
228   - 2017-08-08T19:29:02: MC identifier 1 ...........: Crab
229   - 2017-08-08T19:29:02: MC identifier 2 ...........: CTABackgroundModel
230   - 2017-08-08T19:29:02: MC events .................: 202766 (all models)
  214 + 2017-11-28T14:13:40: === CTA observation ===
  215 + 2017-11-28T14:13:40: Simulation cone ...........: RA=83.5 deg, Dec=22.8 deg, radius=5.5 deg
  216 + 2017-11-28T14:13:40: Time interval .............: 6.31109e+08 - 6.31112e+08 s
  217 + 2017-11-28T14:13:40: Photon energy range .......: 30 GeV - 72.3622611060088 GeV
  218 + 2017-11-28T14:13:40: Event energy range ........: 30 GeV - 72.3622611060088 GeV
  219 + 2017-11-28T14:13:40: Simulation area ..........: 1.97769e+09 cm2
  220 + 2017-11-28T14:13:40: Use model ................: Crab
  221 + 2017-11-28T14:13:40: Normalization ............: 1 [Crab]
  222 + 2017-11-28T14:13:40: Flux .....................: 2.5413e-09 [Crab] photons/cm2/s
  223 + 2017-11-28T14:13:40: Normalized flux ..........: 2.5413e-09 [Crab] photons/cm2/s
  224 + 2017-11-28T14:13:40: Photon rate ..............: 5.0259 photons/s [Crab]
  225 + 2017-11-28T14:13:40: MC source photons ........: 18186 [Crab]
  226 + 2017-11-28T14:13:40: MC source events .........: 3544 [Crab]
  227 + 2017-11-28T14:13:40: MC source events .........: 3544 (all source models)
  228 + 2017-11-28T14:13:40: Photon energy range .......: 72.3622611060088 GeV - 174.543227745807 GeV
  229 + ...
  230 + 2017-11-28T14:13:40: MC source photons .........: 47219 [Crab]
  231 + 2017-11-28T14:13:40: MC source events ..........: 11356 [Crab]
  232 + 2017-11-28T14:13:49: MC events outside ROI .....: 0
  233 + 2017-11-28T14:13:49: MC background events ......: 189477
  234 + 2017-11-28T14:13:49: MC identifier 1 ...........: Crab
  235 + 2017-11-28T14:13:49: MC identifier 2 ...........: CTABackgroundModel
  236 + 2017-11-28T14:13:49: MC events .................: 200833 (all models)
231 237  
232 238 Each line starts with the UTC time at which the line has been written. In
233   -this run, 47371 Crab photons have been thrown. 13227 of these photons have been
234   -registered by CTA as events. In the same time interval, 189539 background
  239 +this run, 47219 Crab photons have been thrown. 11356 of these photons have been
  240 +registered by CTA as events. In the same time interval, 189477 background
235 241 events have been registred by CTA.
236 242  
237 243 .. note::
... ...
doc/source/users/tutorials/quickstart/skymap.jpg

184 KB | W: | H:

7.95 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/quickstart/skymap.rst
... ... @@ -24,7 +24,7 @@ this with the :ref:`ctskymap` tool as follows:
24 24 Size of the Y axis in pixels [200]
25 25 Lower energy limit (TeV) [0.1]
26 26 Upper energy limit (TeV) [100.0]
27   - Background subtraction method (NONE|IRF) [NONE]
  27 + Background subtraction method (NONE|IRF|RING) [NONE]
28 28 Output skymap file [skymap.fits]
29 29  
30 30 The tool produces the file ``skymap.fits`` which contains a sky map of the
... ... @@ -67,7 +67,7 @@ example:
67 67 Size of the Y axis in pixels [200]
68 68 Lower energy limit (TeV) [0.1]
69 69 Upper energy limit (TeV) [100.0]
70   - Background subtraction method (NONE|IRF) [NONE] IRF
  70 + Background subtraction method (NONE|IRF|RING) [NONE] IRF
71 71 Calibration database [prod2]
72 72 Instrument response function [South_0.5h]
73 73 Output skymap file [skymap.fits] skymap_subtracted.fits
... ... @@ -80,5 +80,63 @@ kernel smoothing applied is shown below:
80 80 :width: 400px
81 81 :align: center
82 82  
83   - *Background subtracted sky map of the selected events*
  83 + *Sky map of the selected events with background subtraction from
  84 + the IRFs*
84 85  
  86 +If a reliable model of the instrumental background is not available,
  87 +you can estimate it from the data by running the :ref:`ctskymap` tool with
  88 +the background subtraction method set to `RING``. For each position in
  89 +the map the number of background counts is estimated from a ring,
  90 +scaled accroding to the acceptance model in the :ref:`instrument
  91 +response functions <glossary_irf>`, and subtracted from a circular
  92 +region centred on the trial source region. You need to avoid regions
  93 +with significant gamma-ray emission when deriving the background
  94 +rates, by providing an exclusion region (`ds9 <http://ds9.si.edu>`_
  95 +region file, or FITS map) through the hidden inexclusion parameter.
  96 +
  97 +.. code-block:: bash
  98 +
  99 + $ ctskymap inexclusion=exclusion.reg
  100 + Input event list or observation definition XML file [events.fits] selected_events.fits
  101 + First coordinate of image center in degrees (RA or galactic l) (0-360) [83.63]
  102 + Second coordinate of image center in degrees (DEC or galactic b) (-90-90) [22.01]
  103 + Projection method (AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN) [CAR]
  104 + Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL]
  105 + Image scale (in degrees/pixel) [0.02]
  106 + Size of the X axis in pixels [200]
  107 + Size of the Y axis in pixels [200]
  108 + Lower energy limit (TeV) [0.1]
  109 + Upper energy limit (TeV) [100.0]
  110 + Background subtraction method (NONE|IRF|RING) [NONE] RING
  111 + Source region radius for estimating on-counts (degrees) [0.0] 0.2
  112 + Inner ring radius (degrees) [0.6]
  113 + Outer ring radius (degrees) [0.8]
  114 + Calibration database [prod2]
  115 + Instrument response function [South_0.5h]
  116 + Output skymap file [skymap.fits] skymap_ring.fits
  117 +
  118 +The exclusion file used contained just a circle centered on the Crab
  119 +nebula.
  120 +
  121 +.. code-block:: bash
  122 +
  123 + $ less exclusion.reg
  124 + # Region file format: DS9 version 4.1
  125 + global color=green dashlist=8 3 width=1 font="helvetica 10
  126 + normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1
  127 + delete=1 include=1 source=1
  128 + fk5
  129 + circle(83.63,22.01,720.000")
  130 +
  131 +The resulting sky map, displayed using
  132 +`ds9 <http://ds9.si.edu>`_ in logarithmic color scale is shown below.
  133 +
  134 +.. figure:: skymap_ring.jpg
  135 + :width: 400px
  136 + :align: center
  137 +
  138 + *Sky map of the selected events with background subtraction from
  139 + the ring method*
  140 +
  141 +Note that the map thus obtained is smoothed to the scale of the source
  142 +region size.
... ...
doc/source/users/tutorials/quickstart/skymap_ring.jpg 0 โ†’ 100644

4.81 KB

doc/source/users/tutorials/quickstart/skymap_subtracted.jpg

128 KB | W: | H:

6.97 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/users/tutorials/quickstart/unbinned.rst
... ... @@ -16,11 +16,7 @@ Doing an unbinned analysis
16 16  
17 17 An unbinned analysis is generally preferred over a binned analysis for
18 18 short observation times (a few tens of hours) or if you want to assure
19   - that the analysis results are not biased by the selected binning. Also
20   - the fitting of a light or phase curve is only be possible with an
21   - unbinned maximum likelihood analysis
22   - (see :ref:`light curve <1dc_howto_ligthcurve>` and
23   - :ref:`phase curve <1dc_howto_phasecurve>` fitting).
  19 + that the analysis results are not biased by the selected binning.
24 20  
25 21 An alternative analysis technique consists of working directly on the event
26 22 list without binning the events in a counts cube.
... ...
examples/show_butterfly.py
... ... @@ -84,7 +84,7 @@ def plot_butterfly(filename, plotfile):
84 84 plt.plot(line_x,line_y,color='black',ls='-')
85 85 plt.fill(butterfly_x,butterfly_y,color='green',alpha=0.5)
86 86 plt.xlabel('Energy (TeV)')
87   - plt.ylabel(r'E $\times$ dN/dE (erg cm$^{-2}$ s$^{-1}$)')
  87 + plt.ylabel(r'E$^2$ $\times$ dN/dE (erg cm$^{-2}$ s$^{-1}$)')
88 88  
89 89 # Show spectrum or save it into file
90 90 if len(plotfile) > 0:
... ...