Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraOlivera committed Apr 13, 2023
2 parents c9d85a2 + 975a5f7 commit 63d12b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/tutorials/data/hawc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
######################################################################
# Chose which estimator we will use

which = "NN"
energy_estimator = "NN"


######################################################################
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions gammapy/datasets/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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])

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions gammapy/datasets/tests/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
assert isinstance(dat.psf, RecoPSFMap)

0 comments on commit 63d12b1

Please sign in to comment.