Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Remy <quentin.remy@mpi-hd.mpg.de>
  • Loading branch information
QRemy committed Jul 30, 2024
1 parent 9662926 commit 80b931a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions gammapy/data/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,17 @@ def bkg(self):
"""Background of the observation."""
bkg = self._bkg
# used for backward compatibility of old HESS data
if (
bkg
and self._meta
and self._meta.optional
and self._meta.optional["CREATOR"] == "SASH FITS::EventListWriter"
and self.meta.optional["HDUVERS"] == "0.2"
):
bkg._fov_alignment = FoVAlignment.REVERSE_LON_RADEC
try:
if (
bkg
and self._meta
and self._meta.optional
and self._meta.optional["CREATOR"] == "SASH FITS::EventListWriter"
and self._meta.optional["HDUVERS"] == "0.2"
):
bkg._fov_alignment = FoVAlignment.REVERSE_LON_RADEC
except KeyError:
pass
return bkg

@bkg.setter
Expand Down Expand Up @@ -168,7 +171,7 @@ def rad_max(self):
def available_hdus(self):
"""Which HDUs are available."""
available_hdus = []
keys = ["_events", "_gti", "aeff", "edisp", "psf", "bkg", "_rad_max"]
keys = ["_events", "_gti", "aeff", "edisp", "psf", "_bkg", "_rad_max"]
hdus = ["events", "gti", "aeff", "edisp", "psf", "bkg", "rad_max"]
for key, hdu in zip(keys, hdus):
available = self.__dict__.get(key, False)
Expand Down

0 comments on commit 80b931a

Please sign in to comment.