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

Incorrect dnde Values for Extended Source SED #618

Open
mcrnogor opened this issue Dec 9, 2024 · 2 comments
Open

Incorrect dnde Values for Extended Source SED #618

mcrnogor opened this issue Dec 9, 2024 · 2 comments
Assignees

Comments

@mcrnogor
Copy link

mcrnogor commented Dec 9, 2024

I am trying to produce an SED for an extended source in fermipy (Virgo cluster). I have a spatial map (a fits file) that I define in the configuration file under the SpatialModel:'SpatialMap', Spatial_Filename : ‘map_name.fits’.It is a standard WCS skymap in TAN projection arbitrarily normalized to produce 1 count integrated over the region (about 5 x 5 deg^2, or ~1e-2 sr.)

The Issue
The gta.sed() function does not produce correct values for anything involving the differential flux (dnde) when analyzing this extended source. As a result:

  • The plots generated by SEDPlotter().plot() are incorrect, with e2dnde values being off by some factor. We tested changing the normalization of the input map file, which resulted in a change of the output sed[dnde] values but not in the output sed[flux] values.
  • The flux (flux) values in the sed() dictionary are correct, so this issue appears specific to how dnde is calculated.
  • Manually translating the correct sed['flux'] values into dnde using the usual formula reveals an offset of ~9.24901341e-09 for each energy bin (i.e., the scaling offset is constant across bins) for the Virgo example.

It seems likely that the issue lies in how dnde is calculated within the SED routine, but I couldn’t identify the source of the problem.

The pdf of the notebook (showing the output) is attached below.

Environment

  • OS: macOS Sonoma v14.3 (also tested on Linux Mint, the issue persists)
  • fermipy v1.2.2
  • ScienceTools v2.2.0

Thanks is advance for your help! Let me know if any additional information is needed.

github_issue.pdf

@omodei omodei assigned omodei and MiltosMichailidis and unassigned omodei Dec 9, 2024
@MiltosMichailidis
Copy link
Contributor

MiltosMichailidis commented Dec 9, 2024

Regarding the offset, it may indeed be a gta.sed() issue:
The input spatial map could be read incorrectly or there is an issue in the calculation routine, which is likely the cause of the problem.
When executing the identical procedure with a radial disk, for instance, one would likely observe that the offset is approximately equivalent to the ratio of the normalizations when utilizing a disk and a spatial map.
Would it be possible for you to provide the spatial map or, at minimum, the spectral model (spectral parameters) obtained from the gta.sed(), to enable confirmation of this hypothesis?

@mcrnogor
Copy link
Author

Thank you for the quick response, @MiltosMichailidis! I agree with you that the offset would be the ratio of the normalizations using disk and spatial map (same way as it is when considering a point source and the spatial map in the file I provide above).

I am attaching the spatial map (for the Virgo cluster) and the configuration file I used for my analysis here.

fermipy_sed_issue.zip

Please let me know if anything else is needed.

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

3 participants