diff --git a/doc/source/users/tutorials/1dc/first_fitting.rst b/doc/source/users/tutorials/1dc/first_fitting.rst index 32a92f5..1e06293 100644 --- a/doc/source/users/tutorials/1dc/first_fitting.rst +++ b/doc/source/users/tutorials/1dc/first_fitting.rst @@ -48,34 +48,33 @@ converged properly, as illustrated in the example below: .. code-block:: bash - 2017-07-27T14:05:58: +=================================+ - 2017-07-27T14:05:58: | Maximum likelihood optimisation | - 2017-07-27T14:05:58: +=================================+ - 2017-07-27T14:06:07: >Iteration 0: -logL=291743.621, Lambda=1.0e-03 - 2017-07-27T14:06:17: >Iteration 1: -logL=266150.955, Lambda=1.0e-03, delta=25592.666, step=1.0e+00, max(|grad|)=65223.588855 [Index:13] - 2017-07-27T14:06:26: >Iteration 2: -logL=260665.430, Lambda=1.0e-04, delta=5485.525, step=1.0e+00, max(|grad|)=10907.804073 [Index:3] - 2017-07-27T14:06:36: >Iteration 3: -logL=258904.835, Lambda=1.0e-05, delta=1760.595, step=1.0e+00, max(|grad|)=6694.957421 [Index:3] - 2017-07-27T14:06:45: >Iteration 4: -logL=258545.054, Lambda=1.0e-06, delta=359.781, step=1.0e+00, max(|grad|)=2242.517259 [RA:0] - 2017-07-27T14:06:55: >Iteration 5: -logL=258531.804, Lambda=1.0e-07, delta=13.250, step=1.0e+00, max(|grad|)=631.774929 [RA:0] - 2017-07-27T14:07:05: >Iteration 6: -logL=258531.685, Lambda=1.0e-08, delta=0.120, step=1.0e+00, max(|grad|)=139.793278 [RA:0] - 2017-07-27T14:07:14: >Iteration 7: -logL=258531.673, Lambda=1.0e-09, delta=0.012, step=1.0e+00, max(|grad|)=62.479910 [DEC:1] - 2017-07-27T14:07:24: >Iteration 8: -logL=258531.670, Lambda=1.0e-10, delta=0.002, step=1.0e+00, max(|grad|)=29.031154 [DEC:1] - 2017-07-27T14:07:33: - 2017-07-27T14:07:33: +=========================================+ - 2017-07-27T14:07:33: | Maximum likelihood optimisation results | - 2017-07-27T14:07:33: +=========================================+ - 2017-07-27T14:07:33: === GOptimizerLM === - 2017-07-27T14:07:33: Optimized function value ..: 258531.670 - 2017-07-27T14:07:33: Absolute precision ........: 0.005 - 2017-07-27T14:07:33: Acceptable value decrease .: 2 - 2017-07-27T14:07:33: Optimization status .......: converged - 2017-07-27T14:07:33: Number of parameters ......: 16 - 2017-07-27T14:07:33: Number of free parameters .: 10 - 2017-07-27T14:07:33: Number of iterations ......: 8 - 2017-07-27T14:07:33: Lambda ....................: 1e-11 - 2017-07-27T14:07:33: Maximum log likelihood ....: -258531.670 - 2017-07-27T14:07:33: Observed events (Nobs) ...: 2069142.000 - 2017-07-27T14:07:33: Predicted events (Npred) ..: 2069141.997 (Nobs - Npred = 0.00287596974521875) + 2017-08-25T17:08:21: +=================================+ + 2017-08-25T17:08:21: | Maximum likelihood optimisation | + 2017-08-25T17:08:21: +=================================+ + 2017-08-25T17:08:29: >Iteration 0: -logL=291914.550, Lambda=1.0e-03 + 2017-08-25T17:08:38: >Iteration 1: -logL=266273.754, Lambda=1.0e-03, delta=25640.797, step=1.0e+00, max(|grad|)=65025.077045 [Index:13] + 2017-08-25T17:08:47: >Iteration 2: -logL=260715.584, Lambda=1.0e-04, delta=5558.169, step=1.0e+00, max(|grad|)=11091.356780 [Index:3] + 2017-08-25T17:08:56: >Iteration 3: -logL=258904.982, Lambda=1.0e-05, delta=1810.602, step=1.0e+00, max(|grad|)=6846.470902 [Index:3] + 2017-08-25T17:09:05: >Iteration 4: -logL=258532.557, Lambda=1.0e-06, delta=372.425, step=1.0e+00, max(|grad|)=1815.217272 [RA:0] + 2017-08-25T17:09:14: >Iteration 5: -logL=258519.171, Lambda=1.0e-07, delta=13.386, step=1.0e+00, max(|grad|)=457.965339 [RA:0] + 2017-08-25T17:09:22: >Iteration 6: -logL=258519.093, Lambda=1.0e-08, delta=0.078, step=1.0e+00, max(|grad|)=106.109881 [RA:0] + 2017-08-25T17:09:31: >Iteration 7: -logL=258519.089, Lambda=1.0e-09, delta=0.004, step=1.0e+00, max(|grad|)=23.002701 [DEC:1] + 2017-08-25T17:09:40: + 2017-08-25T17:09:40: +=========================================+ + 2017-08-25T17:09:40: | Maximum likelihood optimisation results | + 2017-08-25T17:09:40: +=========================================+ + 2017-08-25T17:09:40: === GOptimizerLM === + 2017-08-25T17:09:40: Optimized function value ..: 258519.089 + 2017-08-25T17:09:40: Absolute precision ........: 0.005 + 2017-08-25T17:09:40: Acceptable value decrease .: 2 + 2017-08-25T17:09:40: Optimization status .......: converged + 2017-08-25T17:09:40: Number of parameters ......: 16 + 2017-08-25T17:09:40: Number of free parameters .: 10 + 2017-08-25T17:09:40: Number of iterations ......: 7 + 2017-08-25T17:09:40: Lambda ....................: 1e-10 + 2017-08-25T17:09:40: Maximum log likelihood ....: -258519.089 + 2017-08-25T17:09:40: Observed events (Nobs) ...: 2069014.000 + 2017-08-25T17:09:40: Predicted events (Npred) ..: 2069013.992 (Nobs - Npred = 0.00783161679282784) You may also convert the fitted model positions into a `ds9 `_ region file using the :ref:`csmodelinfo` script so that you can overlay the diff --git a/doc/source/users/tutorials/1dc/first_improving.rst b/doc/source/users/tutorials/1dc/first_improving.rst index 304d06d..b66533a 100644 --- a/doc/source/users/tutorials/1dc/first_improving.rst +++ b/doc/source/users/tutorials/1dc/first_improving.rst @@ -23,13 +23,13 @@ You do this with the :ref:`csresmap` script by providing the output Input PSF cube file (only needed for stacked analysis) [NONE] psfcube.fits Input background cube file (only needed for stacked analysis) [NONE] bkgcube.fits Input model definition XML file [$CTOOLS/share/models/crab.xml] stacked_results_cutoff.xml - Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT|SIGNIFICANCE) [SUBDIV] SUB + Residual map computation algorithm (SUB|SUBDIV|SUBDIVSQRT|SIGNIFICANCE) [SUBDIV] SIGNIFICANCE Output residual map file [resmap.fits] This produces the file ``resmap.fits`` that contains a residual map that you can display for example with `ds9 `_. The figure below shows the map, with the fitted source positions overlayed -as white circles. +as green circles. .. figure:: first_skymap_residual.png :width: 400px @@ -90,11 +90,9 @@ as illustrated below: Repeating the fit with this model and producing a corresponding residual map produces the map shown below. Now, the residuals near the two point sources -are flatter and the diffuse emission has largely disappeared. The diffuse -emission is in fact a bit oversubtracted, which is probably due to the -additional source components visible in the residual map. It is left as an -exercise to the User to include model components for these additional -sources in the +are flat and the diffuse emission has disappeared. Some additional sources now +become clearly visible. It is left as an exercise to the User to include model +components for these additional sources in the :ref:`model definition file ` in order to reduce the fit residuals. An example for such an exercise is shown diff --git a/doc/source/users/tutorials/1dc/first_select_events.rst b/doc/source/users/tutorials/1dc/first_select_events.rst index 168f292..710e4ea 100644 --- a/doc/source/users/tutorials/1dc/first_select_events.rst +++ b/doc/source/users/tutorials/1dc/first_select_events.rst @@ -53,7 +53,7 @@ displays a summary of the content of this new 2017-07-27T10:02:26: Unbinned observations .....: 57 2017-07-27T10:02:26: Binned observations .......: 0 2017-07-27T10:02:26: === Events === - 2017-07-27T10:02:26: Number of events ..........: 3084639 + 2017-07-27T10:02:26: Number of events ..........: 3084595 2017-07-27T10:02:26: Number of bins ............: 0 2017-07-27T10:02:26: === Pointings === 2017-07-27T10:02:26: Mean offset angle .........: Unknown @@ -72,7 +72,7 @@ displays a summary of the content of this new There are still 57 observations in the :ref:`observation definition file ` but now the events are restricted to the energy interval 100 GeV - 100 TeV. In -total there are 3 084 639 events within this interval in the selected observations. +total there are 3 084 595 events within this interval in the selected observations. The content of ``obs_selected.xml`` will look similar to the content of ``obs.xml`` with the original event list file names replaced by the names of diff --git a/doc/source/users/tutorials/1dc/first_select_obs.rst b/doc/source/users/tutorials/1dc/first_select_obs.rst index 48b3f14..1f6779b 100644 --- a/doc/source/users/tutorials/1dc/first_select_obs.rst +++ b/doc/source/users/tutorials/1dc/first_select_obs.rst @@ -67,7 +67,7 @@ observations into the console: The output of :ref:`csobsinfo` is shown below. :ref:`csobsselect` selected 57 observations from the Galactic Plane Survey data containing a total of -6 046 100 events. +6 045 130 events. .. code-block:: bash @@ -78,7 +78,7 @@ The output of :ref:`csobsinfo` is shown below. :ref:`csobsselect` selected 2017-07-27T09:58:12: Unbinned observations .....: 57 2017-07-27T09:58:12: Binned observations .......: 0 2017-07-27T09:58:12: === Events === - 2017-07-27T09:58:12: Number of events ..........: 6046100 + 2017-07-27T09:58:12: Number of events ..........: 6045130 2017-07-27T09:58:12: Number of bins ............: 0 2017-07-27T09:58:12: === Pointings === 2017-07-27T09:58:12: Mean offset angle .........: Unknown diff --git a/doc/source/users/tutorials/1dc/first_skymap_residual.png b/doc/source/users/tutorials/1dc/first_skymap_residual.png index 80ef4c5..e65a2b9 100644 --- a/doc/source/users/tutorials/1dc/first_skymap_residual.png +++ b/doc/source/users/tutorials/1dc/first_skymap_residual.png diff --git a/doc/source/users/tutorials/1dc/first_skymap_residual_iem.png b/doc/source/users/tutorials/1dc/first_skymap_residual_iem.png index 8078be0..6995f59 100644 --- a/doc/source/users/tutorials/1dc/first_skymap_residual_iem.png +++ b/doc/source/users/tutorials/1dc/first_skymap_residual_iem.png diff --git a/doc/source/users/tutorials/1dc/first_spectrum_cutoff_stacked.png b/doc/source/users/tutorials/1dc/first_spectrum_cutoff_stacked.png index b943cae..4a11506 100644 --- a/doc/source/users/tutorials/1dc/first_spectrum_cutoff_stacked.png +++ b/doc/source/users/tutorials/1dc/first_spectrum_cutoff_stacked.png diff --git a/doc/source/users/tutorials/1dc/first_spectrum_cutoff_unbinned.png b/doc/source/users/tutorials/1dc/first_spectrum_cutoff_unbinned.png index 4b84bf6..cb491fe 100644 --- a/doc/source/users/tutorials/1dc/first_spectrum_cutoff_unbinned.png +++ b/doc/source/users/tutorials/1dc/first_spectrum_cutoff_unbinned.png diff --git a/doc/source/users/tutorials/1dc/first_spectrum_stacked.png b/doc/source/users/tutorials/1dc/first_spectrum_stacked.png index 36e2bb9..979300b 100644 --- a/doc/source/users/tutorials/1dc/first_spectrum_stacked.png +++ b/doc/source/users/tutorials/1dc/first_spectrum_stacked.png diff --git a/doc/source/users/tutorials/1dc/first_unbinned.rst b/doc/source/users/tutorials/1dc/first_unbinned.rst index 193dc32..2b01ab2 100644 --- a/doc/source/users/tutorials/1dc/first_unbinned.rst +++ b/doc/source/users/tutorials/1dc/first_unbinned.rst @@ -47,35 +47,35 @@ converged properly, as illustrated in the example below: .. code-block:: bash - 2017-07-27T16:28:26: +=================================+ - 2017-07-27T16:28:26: | Maximum likelihood optimisation | - 2017-07-27T16:28:26: +=================================+ - 2017-07-27T16:28:54: >Iteration 0: -logL=20949416.217, Lambda=1.0e-03 - 2017-07-27T16:29:21: >Iteration 1: -logL=20918674.227, Lambda=1.0e-03, delta=30741.990, step=1.0e+00, max(|grad|)=74249.049334 [Index:14] - 2017-07-27T16:29:49: >Iteration 2: -logL=20913114.563, Lambda=1.0e-04, delta=5559.664, step=1.0e+00, max(|grad|)=6728.499004 [RA:0] - 2017-07-27T16:30:16: >Iteration 3: -logL=20910994.152, Lambda=1.0e-05, delta=2120.411, step=1.0e+00, max(|grad|)=4949.846735 [RA:0] - 2017-07-27T16:30:44: >Iteration 4: -logL=20910115.048, Lambda=1.0e-06, delta=879.104, step=1.0e+00, max(|grad|)=2889.871293 [RA:0] - 2017-07-27T16:31:12: >Iteration 5: -logL=20909966.036, Lambda=1.0e-07, delta=149.012, step=1.0e+00, max(|grad|)=1190.543059 [RA:0] - 2017-07-27T16:31:39: >Iteration 6: -logL=20909948.012, Lambda=1.0e-08, delta=18.024, step=1.0e+00, max(|grad|)=550.745751 [DEC:1] - 2017-07-27T16:32:06: >Iteration 7: -logL=20909946.600, Lambda=1.0e-09, delta=1.412, step=1.0e+00, max(|grad|)=208.667347 [DEC:1] - 2017-07-27T16:32:33: >Iteration 8: -logL=20909946.575, Lambda=1.0e-10, delta=0.025, step=1.0e+00, max(|grad|)=51.069713 [DEC:1] - 2017-07-27T16:33:00: >Iteration 9: -logL=20909946.573, Lambda=1.0e-11, delta=0.002, step=1.0e+00, max(|grad|)=16.914402 [DEC:1] - 2017-07-27T16:33:26: - 2017-07-27T16:33:26: +=========================================+ - 2017-07-27T16:33:26: | Maximum likelihood optimisation results | - 2017-07-27T16:33:26: +=========================================+ - 2017-07-27T16:33:26: === GOptimizerLM === - 2017-07-27T16:33:26: Optimized function value ..: 20909946.573 - 2017-07-27T16:33:26: Absolute precision ........: 0.005 - 2017-07-27T16:33:26: Acceptable value decrease .: 2 - 2017-07-27T16:33:26: Optimization status .......: converged - 2017-07-27T16:33:26: Number of parameters ......: 17 - 2017-07-27T16:33:26: Number of free parameters .: 11 - 2017-07-27T16:33:26: Number of iterations ......: 9 - 2017-07-27T16:33:26: Lambda ....................: 1e-12 - 2017-07-27T16:33:26: Maximum log likelihood ....: -20909946.573 - 2017-07-27T16:33:26: Observed events (Nobs) ...: 3084639.000 - 2017-07-27T16:33:26: Predicted events (Npred) ..: 3084635.972 (Nobs - Npred = 3.0282306545414) + 2017-08-25T15:09:18: +=================================+ + 2017-08-25T15:09:18: | Maximum likelihood optimisation | + 2017-08-25T15:09:18: +=================================+ + 2017-08-25T15:09:48: >Iteration 0: -logL=20951221.333, Lambda=1.0e-03 + 2017-08-25T15:10:14: >Iteration 1: -logL=20920374.352, Lambda=1.0e-03, delta=30846.981, step=1.0e+00, max(|grad|)=74106.669528 [Index:14] + 2017-08-25T15:10:41: >Iteration 2: -logL=20914723.637, Lambda=1.0e-04, delta=5650.715, step=1.0e+00, max(|grad|)=6059.304173 [Index:14] + 2017-08-25T15:11:07: >Iteration 3: -logL=20912552.166, Lambda=1.0e-05, delta=2171.471, step=1.0e+00, max(|grad|)=4361.007623 [RA:0] + 2017-08-25T15:11:33: >Iteration 4: -logL=20911666.571, Lambda=1.0e-06, delta=885.595, step=1.0e+00, max(|grad|)=2602.512475 [RA:0] + 2017-08-25T15:11:59: >Iteration 5: -logL=20911523.902, Lambda=1.0e-07, delta=142.669, step=1.0e+00, max(|grad|)=1076.703629 [RA:0] + 2017-08-25T15:12:26: >Iteration 6: -logL=20911508.855, Lambda=1.0e-08, delta=15.047, step=1.0e+00, max(|grad|)=333.013402 [RA:0] + 2017-08-25T15:12:52: >Iteration 7: -logL=20911507.544, Lambda=1.0e-09, delta=1.311, step=1.0e+00, max(|grad|)=93.512904 [RA:0] + 2017-08-25T15:13:18: >Iteration 8: -logL=20911507.529, Lambda=1.0e-10, delta=0.015, step=1.0e+00, max(|grad|)=24.977311 [RA:0] + 2017-08-25T15:13:45: >Iteration 9: -logL=20911507.529, Lambda=1.0e-11, delta=0.000, step=1.0e+00, max(|grad|)=6.442211 [RA:0] + 2017-08-25T15:14:12: + 2017-08-25T15:14:12: +=========================================+ + 2017-08-25T15:14:12: | Maximum likelihood optimisation results | + 2017-08-25T15:14:12: +=========================================+ + 2017-08-25T15:14:12: === GOptimizerLM === + 2017-08-25T15:14:12: Optimized function value ..: 20911507.529 + 2017-08-25T15:14:12: Absolute precision ........: 0.005 + 2017-08-25T15:14:12: Acceptable value decrease .: 2 + 2017-08-25T15:14:12: Optimization status .......: converged + 2017-08-25T15:14:12: Number of parameters ......: 17 + 2017-08-25T15:14:12: Number of free parameters .: 11 + 2017-08-25T15:14:12: Number of iterations ......: 9 + 2017-08-25T15:14:12: Lambda ....................: 1e-12 + 2017-08-25T15:14:12: Maximum log likelihood ....: -20911507.529 + 2017-08-25T15:14:12: Observed events (Nobs) ...: 3084595.000 + 2017-08-25T15:14:12: Predicted events (Npred) ..: 3084591.999 (Nobs - Npred = 3.00117048900574) Also the :ref:`ctbutterfly` tool and the :ref:`csspec` and :ref:`csresmap` scripts can be run into unbinned mode by providing the