Crash when extracting flux points with a CompoundSpectralModel
See original GitHub issueGammapy version v0.19
Bug description
If a compound model is used for the FluxPointsEstimator
, an error occurs in FluxEstimator.get_scale_model()
because a CompoundSpectralModel
has no norm
or amplitude
attribute.
Expected behavior
Using a CompoundSpectralModel
should work.
The issue is caused by the mechanism introduced to scale the norm
according to the input parameter. It does not work in general for a CompoundSpectralModel
which might have different amplitude
and norm
parameters. So that determining the actual range a priori might be ambiguous.
Note that we miss a test for flux points extraction with a compound model.
To Reproduce
from gammapy.modeling.models import EBLAbsorptionNormSpectralModel, PowerLawSpectralModel, SkyModel
from gammapy.estimators.flux import FluxEstimator
pl = PowerLawSpectralModel()
ebl = EBLAbsorptionNormSpectralModel.read_builtin(reference='finke')
model=SkyModel(spectral_model=pl*ebl)
fe = FluxEstimator()
fe.get_scale_model([model])
Other information Any other information you think will be useful for us to fix the issue can go here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Can't extract energy from Flux Point · Issue #237 - GitHub
Bug. Short description: New energy networks(any combination of interfaces, importers and exporters) stopped working with Flux Point from Flux Networks.
Read more >Flux Networks not working : r/feedthebeast - Reddit
i have an atm6 to the sky map and i cant use flux networks. the flux point isnt sending energy for the cables...
Read more >FTB Beyond Flux Networks Crash - Feed the Beast
Details of the issue Game crashes every time I right click on a flux point, specifically in my setup where I have a...
Read more >Flux Networks Guide - Getting Started & Troubleshooting
The Flux Point is not receiving any energy, but there is energy in the network! Follow the same steps as you would with...
Read more >Flux Networks! Bit-by-Bit by Mischief of Mice! - YouTube
MischiefOfMice #BitByBit #FluxNetworksFlux Networks! Bit-by-Bit by Mischief of Mice!Want a wireless power network to run all your machines ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In principle the scaled parameter does not have to be one of the existing parameters as it is already defined by the ScaleModel so in the
get_scale_model
method you pointed we could have :Users now have to define the
is_norm
property, when aSpectralModel
is used with aSkyModel
. See https://github.com/gammapy/gammapy/blob/master/gammapy/modeling/models/cube.py#L75 The example for the custom model was adapted accordingly: https://docs.gammapy.org/dev/tutorials/api/models.html#Implementing-a-custom-model