## Change request #2298

### Diffuse sources flux

Status: | Closed | Start date: | 01/24/2018 | |
---|---|---|---|---|

Priority: | Normal | Due date: | ||

Assigned To: | Knödlseder Jürgen | % Done: | 100% | |

Category: | - | |||

Target version: | 1.5.0 | |||

Duration: |

**Description**

We are involved in data simulation and analysis activity on dark matter. Simulating the data and fitting it with ctools (ctlike/csspec/ctulimits gives the same results) we found the following issue related to the diffuse sources analysis.

The flux returned by ctools is very different (by a factor 1e6) from the one expected from a naive flux estimation as (number_of_counts/Effective_area/dE/dt), please see short log below

`Emin=0.1 ; Emax=0.11 ; Eref=.10488088481701515469`

CTObsSim started

CTOBsSim done!

CTulimit started

CTulimit done!

CTOOLS differential flux (at 0.10488088481701515469): 4.72779184881594e-09 ph/cm2/s/MeV

Ncts = 48732

Aeff=2.69199e+09 cm2

dE= 10000.0 MeV

Correct flux= Ncts/Aeff/dE/dt = 5.02849812468e-15 ph/cm2/s/MeV

CTUlimit flux was 4.72779184881594e-09 ph/cm2/s/MeV

The script producing this output and doing all simulation+analysis steps is Jurgen/run.sh please see the link below

https://www.dropbox.com/s/hl2ixybt74t6kja/jurgen.tgz?dl=0

We have performed similar exercises in 4 different energy bins and found this ratio to be roughly the same in these 4 bins.

Our current interpretation is that when ctools calculates the flux it does not take into account the spatial part of the model. The coefficient roughly is $\Omega \Sum_{region} k_i$, where $\Omega$ is an angular size of 1 pixel on a map; $k_i$ is the value written in $i$-th pixel of the map and the sum is over all pixels within the analysed region.

To the best of our understanding this problem exists only for diffuse sources and in this case, ctools results for the flux are confusing. We performed data simulations and analysis for two different radii (rad = 5 and rad = 0.9) and obtained very similar best-fit DM fluxes which is also confusing. We expected that the total DM flux should decrease with shrinking the radius, while the flux normed per area of the region should increase.

It would be great if ctools could return flux normed per area of the region (in units e.g. erg/cm2/s/sr).

**Recurrence**

No recurrence.

### History

#### #1 Updated by Knödlseder Jürgen almost 7 years ago

**Tracker**changed from*Bug*to*Change request***Subject**changed from*diffuse sources flux*to*Diffuse sources flux***Assigned To**set to*Knödlseder Jürgen***Target version**set to*1.5.0*

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

**Status**changed from*New*to*In Progress*

Thanks for positing the issue and the tarball, I could reproduce your issue. It’s more a feature than a bug. I will look into that.

#### #3 Updated by Knödlseder Jürgen almost 7 years ago

**% Done**changed from*0*to*50*

I added some code to `ctulimit`

that computes the correct flux values for a diffuse map cube. Here are the results I get now, they seem to be of the right order:

$ ./run.sh Emin=0.1 ; Emax=0.11 ; Eref=.10488088481701515469 CTObsSim started CTOBsSim done! CTulimit started CTulimit done! CTOOLS differential flux (@.10488088481701515469): 7.80455008412193e-14 ph/cm2/s/MeV Ncts = 48732 Aeff=2.69199e+09 cm2 dE= 10000.0 MeV Correct flux= Ncts/Aeff/dE/dt = 5.02849812468e-15 ph/cm2/s/MeV CTUlimit flux was 7.80455008412193e-14 ph/cm2/s/MeV

By the way: what is called the “Simulation area” in

`ctobssim`

is twice the on-axis effective area, hence the `Correct flux`

should be 1.0e-14 ph/cm2/s/MeV. The remaining difference comes probably from the fact that the effective area drops when going offaxis.#### #4 Updated by Knödlseder Jürgen almost 7 years ago

**Status**changed from*In Progress*to*Closed***% Done**changed from*50*to*100*

Merged into `devel`

.