Add back 3FGL flux points test
@@ -294,6 +294,22 @@ class TestFluxPoints:
flux_points.plot()
+@requires_data("gammapy-extra")
+def test_compute_flux_points_dnde_fermi():
+ """
+ Test compute_flux_points_dnde on fermi source.
+ """
+ fermi_3fgl = SourceCatalog3FGL()
+ source = fermi_3fgl["3FGL J0835.3-4510"]
+ flux_points = source.flux_points.to_sed_type(
+ "dnde", model=source.spectral_model, method="log_center", pwl_approx=True
+ )
+ for column in ["dnde", "dnde_errn", "dnde_errp", "dnde_ul"]:
+ actual = flux_points.table["e2" + column].quantity
+ desired = flux_points.table[column].quantity * flux_points.e_ref ** 2
+ assert_quantity_allclose(actual[:-1], desired[:-1], rtol=1e-1)
+
+
@pytest.fixture(scope="session")
def sed_flux_points():
path = "$GAMMAPY_EXTRA/test_datasets/spectrum/flux_points/diff_flux_points.fits"
