Fix MapDataset.read
@@ -869,7 +869,7 @@ class MapDataset(Dataset):
def _read_lazy(cls, name, filename, cache):
kwargs = {"name": name}
try:
- kwargs["gti"] = GTI(Table.read(filename, hdu="GTI"))
+ kwargs["gti"] = GTI.read(filename)
except KeyError:
pass
@@ -921,13 +921,12 @@ class MapDataset(Dataset):
dataset : `MapDataset`
Map dataset.
"""
- filename = str(make_path(filename))
name = make_name(name)
if lazy:
return cls._read_lazy(name=name, filename=filename, cache=cache)
else:
- with fits.open(filename, memmap=False) as hdulist:
+ with fits.open(str(make_path(filename)), memmap=False) as hdulist:
return cls.from_hdulist(hdulist, name=name)
@classmethod
