fermi-lat / Fermitools-conda

Conda recipe files for the Fermi Sciencetools software analysis package: Fermitools
https://fermi.gsfc.nasa.gov/ssc/data/analysis/
BSD 3-Clause "New" or "Revised" License
34 stars 17 forks source link

(minor) EBL absorption for E>1.66 TeV #57

Open mireianievas opened 4 years ago

mireianievas commented 4 years ago

This a minor improvement/suggestion. I'm working with some extrapolation of LAT spectra up to very high energies (for now up to 2 TeV), but if absorbed models are included (e.g. Franceschini 2008) in the analysis then the fermitools complain that the absorption table does not reach those really high energies (it indeed finishes at 1.66 TeV). I would suggest extending to higher values. For now I just included by hand one extra line to cover that 2 TeV in fermitools/data/eblAtten/opdep_Franceschini_2008.dat, but maybe it is worth to include a bit more lines in those files or allow the software to extrapolate?.

2.00E+03 1.33E-01 4.06E-01 1.42E+00 4.75E+00 8.65E+00 2.00E+01 3.13E+01 4.12E+02 5.52E+01

(the first line is the energy in GeV, the others are tau values for z=0.01, 0.03, 0.1, 0.3, 0.5, 1.0, 1.5, 2.0, 3.0)

The last value is kind of extrapolated by hand since the model does not reach z=3.0. I guess that was also done for lower energies by someone ???

phbruel commented 4 years ago

Could you tell us which fermi tool complains ?

mireianievas commented 4 years ago

The version is:

fermitools 1.2.1 py27h39e3cac_0 fermi fermitools-data 0.17 0 fermi

The last calls that trigger the issue are SummedLikelihood.py (line 196) and pyLikelihood (line 3855).

File "/afs/ifh.de/user/m/mnievas/software/miniconda/envs/fermi/lib/python2.7/site-packages/fermitools/SummedLikelihood.py", line 95, in fit optObject=optObject, numericDerivs=numericDerivs) File "/afs/ifh.de/user/m/mnievas/software/miniconda/envs/fermi/lib/python2.7/site-packages/fermitools/SummedLikelihood.py", line 196, in _errors myOpt.find_min(verbosity, tol, self.tolType) File "/afs/ifh.de/user/m/mnievas/software/miniconda/envs/fermi/lib/python2.7/site-packages/fermitools/pyLikelihood.py", line 3855, in find_min return _pyLikelihood.Optimizer_find_min(self, *args) RuntimeError: Selected energy outside range of /afs/ifh.de/user/m/mnievas/software/miniconda/envs/fermi/share/fermitools/data/eblAtten/opdep_Franceschini_2008.dat I'm running it through enrico, but I am confident it is unrelated to enrico.