Bug #2183
All pixels have the same TS value for Fermi-LAT analysis using cttsmap
Status: | Closed | Start date: | 08/26/2017 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.5.0 | |||
Duration: |
Description
While cttsmap
works on Fermi-LAT data all pixels have the same TS value. This is probably related to the fact that the position of a source cannot move for a Fermi-LAT analysis. This needs to be changed!
Here the output of cttsmap
:
2017-08-26T09:23:50: +===================+ 2017-08-26T09:23:50: | Initialise TS map | 2017-08-26T09:23:50: +===================+ 2017-08-26T09:23:50: 2017-08-26T09:23:50: +============================================+ 2017-08-26T09:23:50: | Compute NULL Hypothesis for TS computation | 2017-08-26T09:23:50: +============================================+ 2017-08-26T09:23:50: >Iteration 0: -logL=4332.529, Lambda=1.0e-03 2017-08-26T09:23:50: >Iteration 1: -logL=-38009.200, Lambda=1.0e-03, delta=42341.729, step=1.0e+00, max(|grad|)=-36238.451192 [Normalization:1] 2017-08-26T09:23:50: >Iteration 2: -logL=-51027.370, Lambda=1.0e-04, delta=13018.170, step=1.0e+00, max(|grad|)=-9012.089402 [Normalization:1] 2017-08-26T09:23:50: >Iteration 3: -logL=-52320.466, Lambda=1.0e-05, delta=1293.096, step=1.0e+00, max(|grad|)=-889.401841 [Normalization:1] 2017-08-26T09:23:50: >Iteration 4: -logL=-52335.104, Lambda=1.0e-06, delta=14.638, step=1.0e+00, max(|grad|)=-10.536083 [Normalization:1] 2017-08-26T09:23:51: >Iteration 5: -logL=-52335.106, Lambda=1.0e-07, delta=0.002, step=1.0e+00, max(|grad|)=-0.001515 [Normalization:1] 2017-08-26T09:23:51: 2017-08-26T09:23:51: +=================+ 2017-08-26T09:23:51: | Generate TS map | 2017-08-26T09:23:51: +=================+ 2017-08-26T09:23:51: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:51: | Computing TS for bin number 0 at (RA,Dec)=(129.483477116971,-45.6282075867699) | 2017-08-26T09:23:51: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:52: >Iteration 0: -logL=-153156.242, Lambda=1.0e-03 2017-08-26T09:23:53: >Iteration 1: -logL=-153403.237, Lambda=1.0e-03, delta=246.995, step=1.0e+00, max(|grad|)=-213.365929 [Normalization:1] 2017-08-26T09:23:53: >Iteration 2: -logL=-153405.053, Lambda=1.0e-04, delta=1.816, step=1.0e+00, max(|grad|)=-9.295441 [Index1:9] 2017-08-26T09:23:53: >Iteration 3: -logL=-153405.054, Lambda=1.0e-05, delta=0.000, step=1.0e+00, max(|grad|)=0.036425 [CutoffEnergy:10] 2017-08-26T09:23:53: TS value ..................: 202140 2017-08-26T09:23:53: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:53: | Computing TS for bin number 1 at (RA,Dec)=(129.340486401039,-45.6289156915875) | 2017-08-26T09:23:53: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:53: >Iteration 0: -logL=-153156.242, Lambda=1.0e-03 2017-08-26T09:23:53: >Iteration 1: -logL=-153403.237, Lambda=1.0e-03, delta=246.995, step=1.0e+00, max(|grad|)=-213.365929 [Normalization:1] 2017-08-26T09:23:54: >Iteration 2: -logL=-153405.053, Lambda=1.0e-04, delta=1.816, step=1.0e+00, max(|grad|)=-9.295441 [Index1:9] 2017-08-26T09:23:54: >Iteration 3: -logL=-153405.054, Lambda=1.0e-05, delta=0.000, step=1.0e+00, max(|grad|)=0.036425 [CutoffEnergy:10] 2017-08-26T09:23:54: TS value ..................: 202140 2017-08-26T09:23:54: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:54: | Computing TS for bin number 2 at (RA,Dec)=(129.197492535973,-45.6294467779586) | 2017-08-26T09:23:54: +--------------------------------------------------------------------------------+ 2017-08-26T09:23:54: >Iteration 0: -logL=-153156.242, Lambda=1.0e-03 2017-08-26T09:23:54: >Iteration 1: -logL=-153403.237, Lambda=1.0e-03, delta=246.995, step=1.0e+00, max(|grad|)=-213.365929 [Normalization:1] 2017-08-26T09:23:54: >Iteration 2: -logL=-153405.053, Lambda=1.0e-04, delta=1.816, step=1.0e+00, max(|grad|)=-9.295441 [Index1:9] 2017-08-26T09:23:55: >Iteration 3: -logL=-153405.054, Lambda=1.0e-05, delta=0.000, step=1.0e+00, max(|grad|)=0.036425 [CutoffEnergy:10] 2017-08-26T09:23:55: TS value ..................: 202140 ...
Recurrence
No recurrence.
Related issues
History
#1 Updated by Knödlseder Jürgen about 7 years ago
- Related to Feature #604: Allow fitting for point source positions in Fermi-LAT analysis added
#2 Updated by Knödlseder Jürgen about 7 years ago
- File tsmap.png added
- Status changed from New to Pull request
- Assigned To set to Knödlseder Jürgen
- % Done changed from 0 to 90
I changed GLATResponse::irf(GLATEventBin&, GSource&, GObservation&)
to update the mean PSF in case that the source position has shifted by more than 0.01 degrees. This is smaller than reasonable values for the TS map computation, hence now for each test position the mean PSF gets updated. But it is larger than the typical step size in the numerical gradient computation in ctlike
, so that also position fitting is now possible for Fermi-LAT.
Here a ctlike
run on the GammaLib test data:
$ ctlike debug=yes Input event list, counts cube or observation definition XML file [obs_binned.xml] Input model definition XML file [source_model.xml] Output model definition XML file [crab_results.xml] ... 2017-10-19T14:39:31: +=================================+ 2017-10-19T14:39:31: | Maximum likelihood optimisation | 2017-10-19T14:39:31: +=================================+ 2017-10-19T14:39:32: >Iteration 0: -logL=4957.519, Lambda=1.0e-03 2017-10-19T14:39:33: >Iteration 1: -logL=4932.974, Lambda=1.0e-03, delta=24.545, step=1.0e+00, max(|grad|)=46.599527 [RA:6] 2017-10-19T14:39:34: >Iteration 2: -logL=4906.096, Lambda=1.0e-04, delta=26.878, step=1.0e+00, max(|grad|)=-55.873216 [Index:9] 2017-10-19T14:39:35: >Iteration 3: -logL=4872.781, Lambda=1.0e-05, delta=33.315, step=1.0e+00, max(|grad|)=57.963335 [RA:6] 2017-10-19T14:39:36: >Iteration 4: -logL=4852.715, Lambda=1.0e-06, delta=20.066, step=1.0e+00, max(|grad|)=54.902229 [RA:6] 2017-10-19T14:39:37: >Iteration 5: -logL=4847.471, Lambda=1.0e-07, delta=5.245, step=1.0e+00, max(|grad|)=-48.310794 [DEC:7] 2017-10-19T14:39:38: >Iteration 6: -logL=4844.592, Lambda=1.0e-08, delta=2.879, step=1.0e+00, max(|grad|)=33.105651 [RA:6] 2017-10-19T14:39:40: >Iteration 7: -logL=4844.374, Lambda=1.0e-09, delta=0.218, step=1.0e+00, max(|grad|)=-38.796094 [DEC:7] 2017-10-19T14:39:41: >Iteration 8: -logL=4844.104, Lambda=1.0e-10, delta=0.269, step=1.0e+00, max(|grad|)=23.111398 [RA:6] 2017-10-19T14:39:42: Iteration 9: -logL=4844.257, Lambda=1.0e-11, delta=-0.153, step=1.0e+00, max(|grad|)=-36.007554 [DEC:7] (stalled) 2017-10-19T14:39:43: Iteration 10: -logL=4844.640, Lambda=1.0e-10, delta=-0.383, step=1.0e+00, max(|grad|)=29.898185 [RA:6] (stalled) 2017-10-19T14:39:44: Iteration 11: -logL=4844.916, Lambda=1.0e-09, delta=-0.276, step=1.0e+00, max(|grad|)=-49.206737 [DEC:7] (stalled) 2017-10-19T14:39:45: Iteration 12: -logL=4844.916, Lambda=1.0e-08, delta=-0.028, step=1.0e+00, max(|grad|)=29.560686 [RA:6] (stalled) 2017-10-19T14:39:46: Iteration 13: -logL=4844.916, Lambda=1.0e-07, delta=-0.028, step=1.0e+00, max(|grad|)=29.560662 [RA:6] (stalled) 2017-10-19T14:39:47: Iteration 14: -logL=4844.916, Lambda=1.0e-06, delta=-0.028, step=1.0e+00, max(|grad|)=29.560424 [RA:6] (stalled) 2017-10-19T14:39:48: Iteration 15: -logL=4844.916, Lambda=1.0e-05, delta=-0.027, step=1.0e+00, max(|grad|)=29.558046 [RA:6] (stalled) 2017-10-19T14:39:48: Iteration 16: -logL=4844.916, Lambda=1.0e-04, delta=-0.025, step=1.0e+00, max(|grad|)=29.531556 [RA:6] (stalled) 2017-10-19T14:39:49: Iteration 17: -logL=4844.916, Lambda=1.0e-03, delta=-0.002, step=1.0e+00, max(|grad|)=29.246780 [RA:6] (stalled) 2017-10-19T14:39:50: >Iteration 18: -logL=4844.720, Lambda=1.0e-02, delta=0.197, step=1.0e+00, max(|grad|)=25.973961 [RA:6] 2017-10-19T14:39:51: >Iteration 19: -logL=4844.280, Lambda=1.0e-03, delta=0.440, step=1.0e+00, max(|grad|)=-37.615771 [DEC:7] 2017-10-19T14:39:52: Iteration 20: -logL=4844.280, Lambda=1.0e-04, delta=-0.253, step=1.0e+00, max(|grad|)=25.970702 [RA:6] (stalled) 2017-10-19T14:39:53: Iteration 21: -logL=4844.280, Lambda=1.0e-03, delta=-0.236, step=1.0e+00, max(|grad|)=25.755602 [RA:6] (stalled) 2017-10-19T14:39:54: Iteration 22: -logL=4844.280, Lambda=1.0e-02, delta=-0.083, step=1.0e+00, max(|grad|)=26.145958 [RA:6] (stalled) 2017-10-19T14:39:55: >Iteration 23: -logL=4843.739, Lambda=1.0e-01, delta=0.542, step=1.0e+00, max(|grad|)=16.765080 [RA:6] 2017-10-19T14:39:56: >Iteration 24: -logL=4843.571, Lambda=1.0e-02, delta=0.167, step=1.0e+00, max(|grad|)=-17.674911 [DEC:7] 2017-10-19T14:39:57: Iteration 25: -logL=4843.571, Lambda=1.0e-03, delta=-0.430, step=1.0e+00, max(|grad|)=24.413732 [RA:6] (stalled) 2017-10-19T14:39:58: Iteration 26: -logL=4843.571, Lambda=1.0e-02, delta=-0.362, step=1.0e+00, max(|grad|)=23.029877 [RA:6] (stalled) 2017-10-19T14:39:59: Iteration 27: -logL=4843.571, Lambda=1.0e-01, delta=-0.043, step=1.0e+00, max(|grad|)=16.751578 [RA:6] (stalled) 2017-10-19T14:40:00: >Iteration 28: -logL=4843.439, Lambda=1.0e+00, delta=0.133, step=1.0e+00, max(|grad|)=-10.454514 [DEC:7] 2017-10-19T14:40:01: >Iteration 29: -logL=4843.415, Lambda=1.0e-01, delta=0.023, step=1.0e+00, max(|grad|)=6.999863 [RA:6] 2017-10-19T14:40:02: Iteration 30: -logL=4843.415, Lambda=1.0e-02, delta=-0.024, step=1.0e+00, max(|grad|)=-8.109487 [DEC:7] (stalled) 2017-10-19T14:40:03: >Iteration 31: -logL=4843.408, Lambda=1.0e-01, delta=0.007, step=1.0e+00, max(|grad|)=-4.188010 [DEC:7] 2017-10-19T14:40:04: Iteration 32: -logL=4843.408, Lambda=1.0e-02, delta=-0.062, step=1.0e+00, max(|grad|)=9.563824 [RA:6] (stalled) 2017-10-19T14:40:05: Iteration 33: -logL=4843.408, Lambda=1.0e-01, delta=-0.014, step=1.0e+00, max(|grad|)=6.420883 [RA:6] (stalled) 2017-10-19T14:40:06: >Iteration 34: -logL=4843.391, Lambda=1.0e+00, delta=0.017, step=1.0e+00, max(|grad|)=-2.364361 [DEC:7] 2017-10-19T14:40:07: >Iteration 35: -logL=4843.388, Lambda=1.0e-01, delta=0.003, step=1.0e+00, max(|grad|)=2.726322 [RA:6] 2017-10-19T14:40:08: 2017-10-19T14:40:08: +=========================================+ 2017-10-19T14:40:08: | Maximum likelihood optimisation results | 2017-10-19T14:40:08: +=========================================+ 2017-10-19T14:40:08: === GOptimizerLM === 2017-10-19T14:40:08: Optimized function value ..: 4843.388 2017-10-19T14:40:08: Absolute precision ........: 0.005 2017-10-19T14:40:08: Acceptable value decrease .: 2 2017-10-19T14:40:08: Optimization status .......: converged 2017-10-19T14:40:08: Number of parameters ......: 13 2017-10-19T14:40:08: Number of free parameters .: 6 2017-10-19T14:40:08: Number of iterations ......: 35 2017-10-19T14:40:08: Lambda ....................: 0.01 2017-10-19T14:40:08: Maximum log likelihood ....: -4843.388 2017-10-19T14:40:08: Observed events (Nobs) ...: 853.000 2017-10-19T14:40:08: Predicted events (Npred) ..: 852.982 (Nobs - Npred = 0.0178710700253077) 2017-10-19T14:40:08: === GModels === 2017-10-19T14:40:08: Number of models ..........: 3 2017-10-19T14:40:08: Number of parameters ......: 13 2017-10-19T14:40:08: === GModelSky === 2017-10-19T14:40:08: Name ......................: Extragal_diffuse 2017-10-19T14:40:08: Instruments ...............: all 2017-10-19T14:40:08: Instrument scale factors ..: unity 2017-10-19T14:40:08: Observation identifiers ...: all 2017-10-19T14:40:08: Model type ................: DiffuseSource 2017-10-19T14:40:08: Model components ..........: "DiffuseIsotropic" * "FileFunction" * "Constant" 2017-10-19T14:40:08: Number of parameters ......: 3 2017-10-19T14:40:08: Number of spatial par's ...: 1 2017-10-19T14:40:08: Value ....................: 1 [0,10] (fixed,scale=1,gradient) 2017-10-19T14:40:08: Number of spectral par's ..: 1 2017-10-19T14:40:08: Normalization ............: 1.95408419207038 +/- 1.00832549395726 [0,1000] (free,scale=1,gradient) 2017-10-19T14:40:08: Number of temporal par's ..: 1 2017-10-19T14:40:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 2017-10-19T14:40:08: === GModelSky === 2017-10-19T14:40:08: Name ......................: Galactic_diffuse 2017-10-19T14:40:08: Instruments ...............: all 2017-10-19T14:40:08: Instrument scale factors ..: unity 2017-10-19T14:40:08: Observation identifiers ...: all 2017-10-19T14:40:08: Model type ................: DiffuseSource 2017-10-19T14:40:08: Model components ..........: "DiffuseMapCube" * "Constant" * "Constant" 2017-10-19T14:40:08: Number of parameters ......: 3 2017-10-19T14:40:08: Number of spatial par's ...: 1 2017-10-19T14:40:08: Normalization ............: 1 [0.001,1000] (fixed,scale=1,gradient) 2017-10-19T14:40:08: Number of spectral par's ..: 1 2017-10-19T14:40:08: Normalization ............: 1.01169511520051 +/- 0.0940612211250261 [0,1000] (free,scale=1,gradient) 2017-10-19T14:40:08: Number of temporal par's ..: 1 2017-10-19T14:40:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient) 2017-10-19T14:40:08: === GModelSky === 2017-10-19T14:40:08: Name ......................: Crab 2017-10-19T14:40:08: Instruments ...............: all 2017-10-19T14:40:08: Instrument scale factors ..: unity 2017-10-19T14:40:08: Observation identifiers ...: all 2017-10-19T14:40:08: Model type ................: PointSource 2017-10-19T14:40:08: Model components ..........: "PointSource" * "PowerLaw" * "Constant" 2017-10-19T14:40:08: Number of parameters ......: 7 2017-10-19T14:40:08: Number of spatial par's ...: 2 2017-10-19T14:40:08: RA .......................: 83.515821698214 +/- 0.0596466528002105 [-360,360] deg (free,scale=1) 2017-10-19T14:40:08: DEC ......................: 22.0055321346256 +/- 0.0524228516533839 [-90,90] deg (free,scale=1) 2017-10-19T14:40:08: Number of spectral par's ..: 4 2017-10-19T14:40:08: PhotonFlux ...............: 2.94370403534071e-06 +/- 5.55742849555203e-07 [1e-14,0.0001] ph/cm2/s (free,scale=1e-07,gradient) 2017-10-19T14:40:08: Index ....................: -2.32198240016799 +/- 0.162107669490104 [-5,5] (free,scale=1,gradient) 2017-10-19T14:40:08: LowerLimit ...............: 100 [10,1000000] MeV (fixed,scale=1) 2017-10-19T14:40:08: UpperLimit ...............: 500000 [10,1000000] MeV (fixed,scale=1) 2017-10-19T14:40:08: Number of temporal par's ..: 1 2017-10-19T14:40:08: Normalization ............: 1 (relative value) (fixed,scale=1,gradient)
and here a
cttsmap
run:$ cttsmap debug=yes Input event list, counts cube or observation definition XML file [obs_binned.xml] Test source name [Crab] Input model definition XML file [source_model.xml] 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|GLS|MER|MOL|SFL|SIN|STG|TAN) [CAR] Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] Image scale (in degrees/pixel) [0.1] Size of the X axis in pixels [4] 10 Size of the Y axis in pixels [4] 10 Output Test Statistic map file [tsmap.fits] ... 2017-10-19T14:44:25: +=================+ 2017-10-19T14:44:25: | Generate TS map | 2017-10-19T14:44:25: +=================+ 2017-10-19T14:44:28: TS value (bin 0) ..........: 164.987814708467 ((RA,Dec)=(84.1138371412984,21.5592879340734)) 2017-10-19T14:44:30: TS value (bin 1) ..........: 179.765014951676 ((RA,Dec)=(84.0063182680873,21.5595692427765)) 2017-10-19T14:44:33: TS value (bin 2) ..........: 191.867679260755 ((RA,Dec)=(83.8987990262381,21.5597802254118)) 2017-10-19T14:44:35: TS value (bin 3) ..........: 201.108400444093 ((RA,Dec)=(83.7912795210712,21.5599208810295)) 2017-10-19T14:44:38: TS value (bin 4) ..........: 210.948356949604 ((RA,Dec)=(83.6837598579119,21.5599912089967)) 2017-10-19T14:44:40: TS value (bin 5) ..........: 212.433640594327 ((RA,Dec)=(83.5762401420881,21.5599912089967)) 2017-10-19T14:44:43: TS value (bin 6) ..........: 212.650834989432 ((RA,Dec)=(83.4687204789287,21.5599208810295)) 2017-10-19T14:44:45: TS value (bin 7) ..........: 208.133668572855 ((RA,Dec)=(83.3612009737619,21.5597802254118)) 2017-10-19T14:44:48: TS value (bin 8) ..........: 201.248210440915 ((RA,Dec)=(83.2536817319127,21.5595692427765)) 2017-10-19T14:44:51: TS value (bin 9) ..........: 190.423142959842 ((RA,Dec)=(83.1461628587016,21.5592879340734)) 2017-10-19T14:44:53: TS value (bin 10) .........: 178.354800698024 ((RA,Dec)=(84.114177664885,21.6592874329247)) ...
Below the resulting TS map:
#3 Updated by Knödlseder Jürgen about 7 years ago
- Status changed from Pull request to Closed
- % Done changed from 90 to 100
Merged into devel
/