Action #3919

Reproduce Werner Collmar's Crab data

Added by Knödlseder Jürgen over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:12/02/2021
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:2.0.0
Duration:

Description

The GammaLib code should reproduce the DRIs derived by Werner Collmar for VP 221 as accurate as possible.

Here is a summary of the SKYDR3 runs that Werner Collmar used to derive the data:

--- Summary File fuer DREs von VP 221 (erstellt Dez. 2018) ----

MPE SKYDR3 300627 
VP  221.0  DRE  0.75-1  #ALSKGOa+00a1a  EHS173  MPE006    
04     ICOSYS:   1                      
22     ENGRP1:  0.75     1.0            
35     XYDA01:     0.0   0.0   0.0   0.0
64     FPMDIN:  COMPASS.FPM.M0000004    
65     EHSDIN:  COMPASS.EHS.M0000173    
66     EVPDIN:  COMPASS.EVP.M0021899    
67     EVPSEL:  MPE006                  
68     OADLIS:  COMPASS.OAL.M0023884    
70     SWITCH:  00000000000000000010    
72     DREOUT:  COMPASS.DRE.O0300285    
SETET: number of superpackets read:       36973
SETET: number of superpackets used:       30001
Start:         9120   469767168
End  :         9131   433484991
event accepted                                           19357
=============================================================

MPE SKYDR3 300628 
VP  221.0  DRE  1-3  #ALSKGOa+00a1a  EHS173  MPE006       
04     ICOSYS:   1                      
22     ENGRP1:  1.0      3.0            
35     XYDA01:     0.0   0.0   0.0   0.0
64     FPMDIN:  COMPASS.FPM.M0000004    
65     EHSDIN:  COMPASS.EHS.M0000173    
66     EVPDIN:  COMPASS.EVP.M0021899    
67     EVPSEL:  MPE006                  
68     OADLIS:  COMPASS.OAL.M0023884    
70     SWITCH:  00000000000000000010    
72     DREOUT:  COMPASS.DRE.O0300286    
SETET: number of superpackets read:       36973
SETET: number of superpackets used:       30001
Start:         9120   469767168
End  :         9131   433484991
event accepted                                          130624
=============================================================

MPE SKYDR3 300629 
VP  221.0  DRE  3-10  #ALSKGOa+00a1a  EHS173  MPE006      
04     ICOSYS:   1                      
22     ENGRP1:  3.0     10.0            
35     XYDA01:     0.0   0.0   0.0   0.0
64     FPMDIN:  COMPASS.FPM.M0000004    
65     EHSDIN:  COMPASS.EHS.M0000173    
66     EVPDIN:  COMPASS.EVP.M0021899    
67     EVPSEL:  MPE006                  
68     OADLIS:  COMPASS.OAL.M0023884    
70     SWITCH:  00000000000000000010    
72     DREOUT:  COMPASS.DRE.O0300287    
SETET: number of superpackets read:       36973
SETET: number of superpackets used:       30001
Start:         9120   469767168
End  :         9131   433484991
event accepted                                           66908
=============================================================

MPE SKYDR3 300630 
VP  221.0  DRE  10-30  #ALSKGOa+00a1a  EHS173  TST005     
04     ICOSYS:   1                      
22     ENGRP1:  10.0    30.0            
35     XYDA01:     0.0   0.0   0.0   0.0
64     FPMDIN:  COMPASS.FPM.M0000004    
65     EHSDIN:  COMPASS.EHS.M0000173    
66     EVPDIN:  COMPASS.EVP.M0021899    
67     EVPSEL:  TST005                  
68     OADLIS:  COMPASS.OAL.M0023884    
70     SWITCH:  00000000000000000010    
72     DREOUT:  COMPASS.DRE.O0300288    
SETET: number of superpackets read:       36973
SETET: number of superpackets used:       30001
Start:         9120   469767168
End  :         9131   433484991
event accepted                                            8825
=============================================================

drgcmp_vp0724_5.png (176 KB) Knödlseder Jürgen, 12/02/2021 11:10 PM

drecmp_vp0724_5_0.75-1MeV.png (177 KB) Knödlseder Jürgen, 12/02/2021 11:20 PM

drecmp_vp0724_5_1-3MeV.png (182 KB) Knödlseder Jürgen, 12/02/2021 11:20 PM

drecmp_vp0724_5_3-10MeV.png (190 KB) Knödlseder Jürgen, 12/02/2021 11:20 PM

drecmp_vp0724_5_10-30MeV.png (184 KB) Knödlseder Jürgen, 12/02/2021 11:20 PM

drecmp_vp0221_0.75-1MeV.png (178 KB) Knödlseder Jürgen, 12/04/2021 12:41 AM

drecmp_vp0221_1-3MeV.png (187 KB) Knödlseder Jürgen, 12/04/2021 12:41 AM

drecmp_vp0221_3-10MeV.png (187 KB) Knödlseder Jürgen, 12/04/2021 12:41 AM

drecmp_vp0221_10-30MeV.png (182 KB) Knödlseder Jürgen, 12/04/2021 12:41 AM

Drgcmp_vp0724_5 Drecmp_vp0724_5_0.75-1mev Drecmp_vp0724_5_1-3mev Drecmp_vp0724_5_3-10mev Drecmp_vp0724_5_10-30mev Drecmp_vp0221_0.75-1mev Drecmp_vp0221_1-3mev Drecmp_vp0221_3-10mev Drecmp_vp0221_10-30mev

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 2 years ago

Here the time intervals of the different files:

Source TJD start Tics start TJD stop Tics stop Comment
SKYDR3 9120 469767168 9131 433484991
m21899_evp.fits header 9120 489600000 9131 440200000
m21899_evp.fits events 9120 489602484 9131 433429992
vp0221_0_tim.fits 9120 489602484 9131 433429992 Times shown by GCOMEventList::print() and GCOMTim::print()
m14033_tim.fits 9120 469736000 9131 440200000
OAD header 9120 0 9131 673477823
OAD superpackets 9120 0 9131 673346752 Times shown by GCOMOads::print()
GammaLib DRE 9120 489690112 9131 673477823
GammaLib DRG 9120 489690112 9131 673477823

The SKYDR3 validity intervals are set from the start of the first OAD and the stop of the last OAD superpacket that is used:

C             set the start and end validity interval
              IF(INIT.EQ.1) THEN
                INIT=0
                VALSTA(1)=OATSRT(1)
                VALSTA(2)=OATSRT(2)
                VALEND(1)=OATEND(1)
                VALEND(2)=OATEND(2)
              ELSE
                VALEND(1)=OATEND(1)
                VALEND(2)=OATEND(2)
C               avoid ticks > 1 day
                IF(VALEND(2).GT.691 199 999)VALEND(2)=691 199 999
              ENDIF
with
              OATEND(1)=CURTIM(1)
              OATEND(2)=CURTIM(2) + 131071

The GammaLib DRE and DRG times are set by the GCOMDri::use_superpacket() method and reflect the start time of the first and the stop time of the last superpacket that is used, hence the times should be equivalent to those of SKYDR3 is the same OAD files are used.

The SKYDR3 start time corresponds to row 2132 of m22366_oad.fits, while the stop time corresponds to row 2152 of m22387_oad.fits, hence in principle the same OAD records are accessible to GammaLib. The method GCOMOads::read() sets the OAD stop time in the same manner as SKYDR3, hence in principle identical times should be achievable. It is possible a difference in the TIM that can explain the difference.

#2 Updated by Knödlseder Jürgen over 2 years ago

Using m14033_tim.fits instead of the GammaLib database TIM produces the exact same start and stop times. However it turns out that the number of superpackets read is smaller than for the SKYDR3 run, and that the OAD file for TJD 9125 is missing.

After Werner sent me the missing OAD dataset I reprocessed the data with the full list of OAD files.

Result SKYDR3 GammaLib
Number of superpackets read 36973 38162
Number of superpackets used 30001 29901
0.75-1 MeV events accepted 19357 19357
1-3 MeV events accepted 130624 130627
3-10 MeV events accepted 66908 66922
10-33 MeV events accepted 8825 12299
Start 9120:469767168 9120:469767168
Stop 9131:433484991 9131:433484991

An initial comparison of the SKYDR3 and GammaLib DRIs showed some structure that indicated some difference in the WCS projection between the DRIs. Reproducing the coordinate transformations in SKYDR3 and GammaLib using the script check_dri_projection.py confirmed that the script dri2fits.py that I used to add WCS projection information to the FITS header was not correct. After correcting the FITS headers (and after replicating the same logic in check_dri_projection.py) the script produced the result below. Each row corresponds to one event. Columns with CO correspond to COMPASS (i.e. SKYDR3), columns with GA to GammaLib. The first step of columns show the X/Y pixel index for both code followed by the difference. Pixel indices are now identical. The second set of columns shows the Galactic longitude and latitude of the events, also here the results are very close. Note that while GammaLib exploits directly the Galactic longitude and latitude information in the EVP file, SKYDR3 performs coordinate transformations, using the event’s theta and phi angles.

************************
* Check DRI projection *
************************

   #      CO_X     CO_Y     GA_X     GA_Y  CO-GA_X  CO-GA_Y |     CO_L     CO_B     GA_L     GA_B  CO-GA_L  CO-GA_B
====  ======== ======== ======== ======== ======== ======== | ======== ======== ======== ======== ======== ========
   0:  43.6003  34.0330  43.5958  34.0331  0.00443 -0.00004 | 194.1003  -8.4670 194.0958  -8.4669  0.00443 -0.00004
   1:  53.5884  35.6523  53.5826  35.6512  0.00579  0.00109 | 204.0884  -6.8477 204.0826  -6.8488  0.00579  0.00109
   2:  38.5077  31.6222  38.5036  31.6225  0.00408 -0.00032 | 189.0077 -10.8778 189.0036 -10.8775  0.00408 -0.00032
   3:  29.6426  16.8326  29.6371  16.8324  0.00545  0.00017 | 180.1426 -25.6674 180.1371 -25.6676  0.00545  0.00017
   4:  45.0548  31.9575  45.0500  31.9575  0.00480 -0.00003 | 195.5548 -10.5425 195.5500 -10.5425  0.00480 -0.00003
   5:  28.6003  63.7477  28.6017  63.7496 -0.00131 -0.00192 | 179.1003  21.2477 179.1017  21.2496 -0.00131 -0.00192
   6:  27.4380  20.9859  27.4332  20.9856  0.00482  0.00031 | 177.9380 -21.5141 177.9332 -21.5144  0.00482  0.00031
   7:  36.0730  58.9957  36.0722  58.9962  0.00078 -0.00049 | 186.5730  16.4957 186.5722  16.4962  0.00078 -0.00049
   8:  50.3808  44.0255  50.3761  44.0242  0.00476  0.00127 | 200.8808   1.5255 200.8761   1.5242  0.00476  0.00127
   9:  38.2415  19.7424  38.2361  19.7428  0.00537 -0.00037 | 188.7415 -22.7576 188.7361 -22.7572  0.00537 -0.00037
  10:  57.5948  11.2286  57.5868  11.2291  0.00796 -0.00048 | 208.0948 -31.2714 208.0868 -31.2709  0.00796 -0.00048

Finally the plots below show a comparison of the DREs for the four energy bands. Since the projects of the DREs are not identical I did some random resampling of the events into the same projection, which of course can not reproduce an identity. Nevertheless the agreement is very satisfactory. Only the 10-30 MeV band shows a significant difference, which comes from the different ToF selections used by Werner and myself.

#3 Updated by Knödlseder Jürgen over 2 years ago

Since the OAD for TJD 9125 is missing I moved to the second dataset that Werner Collmar sent. This is a Crab observation performed during VP 0724.5.

The plot below shows a comparison of the DRG computed using GammaLib (red) with the DRG computed using SKYDR3. Obviously, the differences are tiny. Summing over Werner’s DRG gives 9325, while summing over the GammaLib DRG gives 9331, hence a difference of 0.06%!

Below a comparison between the total number of counts in Werner’s DRE and the GammaLib DRE as function of energy band. Also for the DREs the differences are very small, except for the 10-30 MeV band where Werner used a different event selection (PSD and ToF). The corresponding difference plots are shown below, illustrating the good match for the first 3 energy bands.

Dataset 0.75-1 1-3 3-10 10-30
Werner 79959 624701 179753 16971
GammaLib 79745 623150 179296 24003
Ratio 1.0027 1.0025 1.0025 0.7070

#4 Updated by Knödlseder Jürgen over 2 years ago

Here are the comlixfit results for the four energy band in comparison to the SRCFIX results. While for SRCFIX the results are not corrected for ToF and lifetime, GammaLib includes these corrections. I therefore applied the corresponding corrections to Werner’s results for comparison (1.40, 1.27, 1.17 and 1.05 for the ToF correction of the four energy bands, 1.03 for the lifetime). For the analysis, the UNH simulated response files were used.

Analysis 0.75-1 1-3 3-10 10-30 0.75-1 1-3 3-10 10-30
Werner 31.47 ± 6.93 118.0 ± 7.04 30.28 ± 2.59 8.11 ± 0.87 -28.33 ± 6.62 12.98 ± 6.96 4.02 ± 2.57 0.66 ± 0.79
Werner (corr.) 43.23 ± 9.99 154.36 ± 9.21 36.49 ± 3.12 8.77 ± 0.94 -40.85 ± 9.55 16.98 ± 9.10 4.84 ± 3.10 0.71 ± 0.85
GammaLib 29.98 ± 7.98 141.53 ± 7.92 36.07 ± 2.72 8.82 ± 0.90 -56.30 ± 7.37 -2.39 ± 7.73 4.86 ± 2.68 0.43 ± 0.80

Below a comparison of the number of counts that were attributed to both sources.

Analysis 0.75-1 1-3 3-10 10-30 0.75-1 1-3 3-10 10-30
Werner 1632 ± 359 11975 ± 714 3230 ± 276 527 ± 56 -1428 ± 334 1301 ± 697 420 ± 268 42 ± 50
GammaLib 1068 11047 3366 631 -1952 -184 445 30

#6 Updated by Knödlseder Jürgen over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

The above examples show that the SKYDR3 DRIs for the Crab are well reproduced by GammaLib once the same input data are specified. I therefore close this issue now.

Also available in: Atom PDF