Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape parameters in localize() #589

Open
jballet opened this issue May 4, 2024 · 0 comments
Open

Shape parameters in localize() #589

jballet opened this issue May 4, 2024 · 0 comments
Assignees

Comments

@jballet
Copy link

jballet commented May 4, 2024

When calling the localize() method with the default option fix_shape=False, it forces all shape parameters to be free, even those that the user has fixed from the start.
My example relocalizes source P88Y1600 between 1 GeV and 1 TeV. That source is fit with LogParabola in the DR4 catalog, but the curvature parameter (beta) is not well constrained in that reduced energy range so I fix it to the best-fit DR4 value (0.0731). However, localize() ignores that instruction, fits the curvature and finds the unphysical negative value -0.379. If I add follow-up commands, it will keep that incorrect value (but it remembers that it should be fixed).
I think the problematic instructions are near l 454 (in v 1.1.6) of sourcefind.py, inside "if update and o.fit_success and o.fit_inbounds:". After adding a new source at the new position, if fix_shape is False, nothing propagates the original free/fixed condition of the shape parameters, they are just all set to free.
The same problem may affect the extension() method, which has very similar instructions (l 318 of extension.py).

I put a test harness at this site. It will be there until May 19.
It creates a directory called P88Y1600. Inside, run fermipy_localize.py. Looking at the beta parameter of P88Y1600 at the beginning and end of the log, or comparing srcmdl_00.xml and LOCP88Y1600_00.xml, shows the bug.
I see this in all versions of fermipy I tested (eg 1.1.6).

@omodei omodei self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants