Add test for compoundmodel issue
@@ -167,3 +167,18 @@ def test_flux_estimator_norm_range_template():
assert_allclose(scale_model.norm.min, 0)
assert_allclose(scale_model.norm.max, 10)
assert scale_model.norm.interp == "log"
+
+def test_flux_estimator_compound_model():
+ pl = PowerLawSpectralModel()
+ pl.amplitude.min = 1e-15
+ pl.amplitude.max = 1e-10
+ pln = PowerLawNormSpectralModel()
+ spectral_model = pl*pln
+ model = SkyModel(spectral_model=spectral_model, name="test")
+
+ estimator = FluxEstimator(source="test", selection_optional=[], reoptimize=True)
+
+ scale_model = estimator.get_scale_model(Models([model]))
+
+ assert_allclose(scale_model.norm.min, 1e-3)
+ assert_allclose(scale_model.norm.max, 1e2)
