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

unable to fit templates #63

Closed
Amidn opened this issue Mar 29, 2021 · 5 comments
Closed

unable to fit templates #63

Amidn opened this issue Mar 29, 2021 · 5 comments

Comments

@Amidn
Copy link

Amidn commented Mar 29, 2021

macOS catalina
conda: 4.9.2
Xcode: 12.0.1

(The same problem happens on UMD)

pytest --pyargs threeML: 148 passed, 18 skipped, 2 xfailed, 4 xpassed, 2096 warnings in 986.32s (0:16:26)
pytest --pyargs astromodels: 104 passed, 1 skipped, 107 warnings in 40.51s
test HAL: 1 passed, 363 warnings in 708.12s (0:11:48)

Problem:
While the code workes properly to fit PS and Extended sources, it is unable to fit a template using "SpatialTemplate_2D()",
It is not able nor to fit nor subtracting a previously fitted template.
(I tried ROOT and minunit)

Amid
temp_fit.txt

@henrikef
Copy link
Contributor

Hi Amid, the information you provided is not enough to reproduce the issue.

Please provide your user scripp + relevant files such as the fits files you are loading etc.

@Amidn
Copy link
Author

Amidn commented Mar 30, 2021

Hi Henrike,
you can find the additional information here : "/data/disk01/home/amid/HAL_test"
Regards

@henrikef
Copy link
Contributor

henrikef commented Apr 6, 2021

Hi Amid!

This is not a HAL issue.

The main problem is that your template isn't normalized as expected. It should be normalized so that the sum of the template values times the pixel area (in steradians) comes out to 1. Future versions of astromodels will emit a warning in this case, see threeML/astromodels#148 . Please let me know if you need any help in normalizing the template.

Additionally, there was a bug in astromodels that cut off the non-integer part of the template. This too will be fixed in upcoming versions, see threeML/astromodels#148

Last, please do not touch the hash parameter of the 2D template. It is set when the template is read in. If you reset it, you will run into issues if you ever read in multiple templates in the same script.

@henrikef
Copy link
Contributor

henrikef commented Apr 7, 2021

@Amidn were you able to resolve this?

@Amidn
Copy link
Author

Amidn commented Apr 8, 2021 via email

@henrikef henrikef closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants