diff --git a/examples/tutorials/data/hawc.py b/examples/tutorials/data/hawc.py index 83227db737..73a72f3993 100644 --- a/examples/tutorials/data/hawc.py +++ b/examples/tutorials/data/hawc.py @@ -60,7 +60,7 @@ ###################################################################### # Chose which estimator we will use -which = "NN" +energy_estimator = "NN" ###################################################################### @@ -85,8 +85,8 @@ # Load the tables data_path = "$GAMMAPY_DATA/hawc/crab_events_pass4/" -hdu_filename = "hdu-index-table-" + which + "-Crab.fits.gz" -obs_filename = "obs-index-table-" + which + "-Crab.fits.gz" +hdu_filename = f"hdu-index-table-{energy_estimator}-Crab.fits.gz" +obs_filename = f"obs-index-table-{energy_estimator}-Crab.fits.gz" # there is only one observation table obs_table = ObservationTable.read(data_path + obs_filename) diff --git a/gammapy/datasets/map.py b/gammapy/datasets/map.py index e613506afc..e2ac9e0348 100644 --- a/gammapy/datasets/map.py +++ b/gammapy/datasets/map.py @@ -51,7 +51,7 @@ def create_map_dataset_geoms( migra_axis=None, rad_axis=None, binsz_irf=None, - reco_psf=False + reco_psf=False, ): """Create map geometries for a `MapDataset` @@ -89,7 +89,7 @@ def create_map_dataset_geoms( geom_irf = geom_image.to_binsz(binsz=binsz_irf) if reco_psf: - geom_psf = geom_irf.to_cube([rad_axis,geom.axes["energy"]]) + geom_psf = geom_irf.to_cube([rad_axis, geom.axes["energy"]]) else: geom_psf = geom_irf.to_cube([rad_axis, energy_axis_true]) @@ -653,7 +653,7 @@ def create( rad_axis=rad_axis, migra_axis=migra_axis, binsz_irf=binsz_irf, - reco_psf=reco_psf + reco_psf=reco_psf, ) kwargs.update(geoms) diff --git a/gammapy/datasets/tests/test_map.py b/gammapy/datasets/tests/test_map.py index 38f4aa8208..f25db23775 100644 --- a/gammapy/datasets/tests/test_map.py +++ b/gammapy/datasets/tests/test_map.py @@ -18,7 +18,7 @@ EnergyDependentMultiGaussPSF, EnergyDispersion2D, PSFMap, - RecoPSFMap + RecoPSFMap, ) from gammapy.makers.utils import make_map_exposure_true_energy, make_psf_map from gammapy.maps import HpxGeom, Map, MapAxis, RegionGeom, WcsGeom, WcsNDMap @@ -1875,6 +1875,7 @@ def test_peek(images): with mpl_plot_check(): dataset.peek() + def test_create_psf_reco(geom): dat = MapDataset.create(geom, reco_psf=True) - assert isinstance(dat.psf, RecoPSFMap) \ No newline at end of file + assert isinstance(dat.psf, RecoPSFMap)