PS: I noticed that the butterflies for the 2FHL and the 1FHL sources where lacking some curvatures (see attached plot for PKS 2155-304). In addition the upper limits do not appear (here for the 2FHL). Is it something expected?
cdeil left a comment
This looks good to me.
The pull request could be extended with fixes for the missing flux point ULs in the plot or butterfly issue you mention, or by adding your nice example to http://docs.gammapy.org/en/latest/spectrum/plotting_fermi_spectra.html or as a separate file in
But it's up to you, that can also be done in future PRs.
Concerning why the upper limits of the spectral points don't show up:
In principle the FluxPoints class can handle that, and I think it's working for the GammaCat and HGPS catalog classes:
But looking at the docs and tests, I don't see a working example of that for the Fermi spectral points:
I just did this demo today for @vorugantia to explain a few things, how to get started fitting spetral points with Gammapy:
The first issue we ran into is that the Fermi catalogs contain integral flux points, but for plotting we wanted differential flux points and differential flux point errors.
What you do here (presumably copied from 2FHL class) to compute
Apparently @adonath already started in that direction and wrote a test for it here that is xfailed at the moment:
PS: @adonath changed the
This is encoded here to decide which points are upper limits:
I think the
Could you please try to find a source that has an UL for each Fermi catalog, and make sure that it's filled and plotted correctly?
About the incorrect butterfly -- I suggest you open a new issue and label it as "bug" and put it under the 0.6 milestone, assigning it to Axel, unless you want to take care of it.
I'm merging this now.
@adonath @jjlk - If you could fix / improve the points discussed here this week, that would be great and IMO a high-priority item. Even adding a FluxPointFitter that can fit differential and integral flux points, possibly with an API as outlined in the notebook that I linked to in @vorugantia's repo, would be important to add soon, because we and several other people need this.