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

ltcube and gtlike / ltcube for stacking #167

Closed jeget closed 1 month ago

jeget commented 1 month ago

Can anybody please explain why gtlike needs ltcube? In fermitools, expcube parameter is required for gtlike although I tried different ones with no difference. Also, in the python interface, a BinnedObs object is created like obs = BinnedObs(srcMaps=srcmaps_file, expCube=ltcube_file, binnedExpMap=expcube_file, irfs='CALDB') i.e. ltcube is needed. I thought gtlike only needs binned expmap because it contains exposures already weighted by cos(theta). So why ltcube in gtlike? I'm asking because I want to do stacking. I understand I should sum individual count maps and binned exposure maps but what do I do with ltcubes?

nmirabal commented 1 month ago

The Fermitools are available in github. You can actually trace how the livetime cubes are used in the likelihood fit following the code directly: https://github.com/fermi-lat/pyLikelihood/blob/master/python/BinnedAnalysis.py https://github.com/fermi-lat/pyLikelihood/blob/master/python/SummedLikelihood.py

When needed, livetime cubes can always be added as needed. In the Fermitools this can be done with gtltsum as explained in https://fermi.gsfc.nasa.gov/ssc/data/analysis/documentation/Cicerone/Cicerone_Data_Exploration/livetime_and_exposure.html