Skip to content

Commit

Permalink
Merge pull request gammapy#4533 from meeseeksmachine/auto-backport-of…
Browse files Browse the repository at this point in the history
…-pr-4531-on-v1.1.x

Backport PR gammapy#4531 on branch v1.1.x (Simplify binsz_irf handling in create_map_dataset_geoms)
  • Loading branch information
registerrier authored May 26, 2023
2 parents 108703f + 611fe52 commit ed6a5ba
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gammapy/datasets/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
0.2, 5, nbin=48, node_type="edges", name="migra"
)

BINSZ_IRF_DEFAULT = 0.2
BINSZ_IRF_DEFAULT = 0.2 * u.deg

EVALUATION_MODE = "local"
USE_NPRED_CACHE = True
Expand All @@ -51,7 +51,7 @@ def create_map_dataset_geoms(
energy_axis_true=None,
migra_axis=None,
rad_axis=None,
binsz_irf=None,
binsz_irf=BINSZ_IRF_DEFAULT,
reco_psf=False,
):
"""Create map geometries for a `MapDataset`
Expand Down Expand Up @@ -84,7 +84,6 @@ def create_map_dataset_geoms(
else:
energy_axis_true = geom.axes["energy"].copy(name="energy_true")

binsz_irf = binsz_irf if binsz_irf is not None else BINSZ_IRF_DEFAULT
geom_image = geom.to_image()
geom_exposure = geom_image.to_cube([energy_axis_true])
geom_irf = geom_image.to_binsz(binsz=binsz_irf)
Expand Down Expand Up @@ -609,7 +608,7 @@ def create(
energy_axis_true=None,
migra_axis=None,
rad_axis=None,
binsz_irf=None,
binsz_irf=BINSZ_IRF_DEFAULT,
reference_time="2000-01-01",
name=None,
meta_table=None,
Expand Down

0 comments on commit ed6a5ba

Please sign in to comment.