Describe the bug
The XML outputs of the catalog pipeline contain many attributes for each source, including RA, DEC and Extension for all extended sources. Those are meant to tell the catalog pipeline where the source is when the spatial model is a template and the source position does not appear explicitly in the XML file. They are ignored by the Fermi Tools and we never use them precisely.
However, an intern realized that they are actually used by fermipy instead of the coordinates appearing in the spatialModel part of the XML file declared under catalogs in the yaml parameter file. This is true for point sources as well.
More precisely, what happens is that, at the setup call, the spatialModel part of the srcmdl_00.xml file is filled with the same model (SkyDirFunction, RadialDisk, ...) as in the input XML file, but the values are taken from the RA/DEC/Extension attributes instead, when they exist.
To Reproduce
A test harness is available at this link. It will stay there for two weeks.
You will need to replace ltcube_14years_zmax105.fits and gll_iem_uw1216_v13.fits by the real files (for the latter, you may link it to gll_iem_v07 instead).
Launch fermipy_test.sh. It will launch in sequence fermipy_free with the RA/DEC attributes (on purpose, not equal to the coordinates under spatialModel) in the XML file for sources P88Y5254 and P88Y5267, then fermipy_noRADEC without those attributes, then gtlike with those attributes.
The fermipy_free and fermipy_noRADEC.log show the detailed fermipy outputs. The fermipy_test.log shows the loglikelihoods in both cases and the gtlike output. The logs show clearly that the gtlike output is much closer to the fermipy_noRADEC output.
The input XML files are srcModel_313_free/noRADEC.xml and those created by fermipy (srcmdl_00.xml) are copied to srcmdl_00_free/noRADEC.xml, showing the difference in position.
Expected behavior
I think fermipy should be consistent with the Fermi Tools and ignore those positional attributes.
Environment (please complete the following information):
- OS: AlmaLinux 9.7
- FermiTools 2.5.1
- Fermipy 1.4.1
Describe the bug
The XML outputs of the catalog pipeline contain many attributes for each source, including RA, DEC and Extension for all extended sources. Those are meant to tell the catalog pipeline where the source is when the spatial model is a template and the source position does not appear explicitly in the XML file. They are ignored by the Fermi Tools and we never use them precisely.
However, an intern realized that they are actually used by fermipy instead of the coordinates appearing in the spatialModel part of the XML file declared under catalogs in the yaml parameter file. This is true for point sources as well.
More precisely, what happens is that, at the setup call, the spatialModel part of the srcmdl_00.xml file is filled with the same model (SkyDirFunction, RadialDisk, ...) as in the input XML file, but the values are taken from the RA/DEC/Extension attributes instead, when they exist.
To Reproduce
A test harness is available at this link. It will stay there for two weeks.
You will need to replace ltcube_14years_zmax105.fits and gll_iem_uw1216_v13.fits by the real files (for the latter, you may link it to gll_iem_v07 instead).
Launch fermipy_test.sh. It will launch in sequence fermipy_free with the RA/DEC attributes (on purpose, not equal to the coordinates under spatialModel) in the XML file for sources P88Y5254 and P88Y5267, then fermipy_noRADEC without those attributes, then gtlike with those attributes.
The fermipy_free and fermipy_noRADEC.log show the detailed fermipy outputs. The fermipy_test.log shows the loglikelihoods in both cases and the gtlike output. The logs show clearly that the gtlike output is much closer to the fermipy_noRADEC output.
The input XML files are srcModel_313_free/noRADEC.xml and those created by fermipy (srcmdl_00.xml) are copied to srcmdl_00_free/noRADEC.xml, showing the difference in position.
Expected behavior
I think fermipy should be consistent with the Fermi Tools and ignore those positional attributes.
Environment (please complete the following information):