Skip to content

Extension fitting with localization giving strange likelihood values #667

@webber7-lang

Description

@webber7-lang

Hello!

Describe the bug
In my analysis I am looking at a sample of Galactic sources in the plane. I am using the extension fitting method to model a sample of sources. One of the tests we perform is fitting for the position of each source simultaneous to the extension scan; we set fit_position = True in the gta.extension() function. The issue I am experiencing is that the results from this are giving negative values in the dloglike scan for many targets, resulting in negative TS_ext dips in the likelihood profiles of my targets. This must be an issue with the localization, as this project is far along and we have never experienced this problem with the extension fitting when fit_position = False. Also, for some of my targets, the TS_ext values calculated by fermipy are quite high, while the TS detected values calculated are quite low which doesn't make physical sense. Therefore, the way in which fermipy is calculating the loglike_ptsrc and loglike_null values is unclear to me and seems incorrect. An example of one such likelihood profile is attached for NGC 3293, where the TS_ext values dip all the way to around -100.
Image

To Reproduce
To reproduce my result, I am attaching my extension fitting script, the config for NGC 3293, and the source model .xml file for NGC 3293 that I start with from after my data preprocessing. Please let me know if you need or want to see other files.
NGC_3293_config.yaml
fit_model_3_ngc_3293.xml
ext_fit15_posfit.py

Expected behavior
I expect the TS and TS_ext values to be close, for the TS to always be greater than the TS_ext values, and for the dloglike values to never be negative. To test this, I loaded in the results of this extension fitting and calculated the loglike_ptsrc and loglike_null values manually (by deleting the extended model and either modeling as a point source or not modeling the emission and then calculating the likelihoods) I obtained results that make physical sense and are much closer to what I expected.

Log files
The log file for NGC 3293 is attached.
NGC_3293.log

Environment

  • OS: Linux
  • Output of uname -a: Linux vm-slurm-p-login01.palmetto.clemson.edu 4.18.0-553.54.1.el8_10.x86_64 Add energy range option for residual maps #1 SMP Fri May 30 21:43:02 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
  • versions: fermipy 1.2, fermitools 2.2.0, fermitools-data 0.18

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions