Skip to content

Commit

Permalink
Add table_format
Browse files Browse the repository at this point in the history
  • Loading branch information
cgalelli committed Oct 14, 2024
1 parent 56154ab commit ad98c64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gammapy/estimators/points/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def read(
format=None,
reference_model=None,
checksum=False,
table_format="ascii.ecsv",
**kwargs,
):
"""Read precomputed flux points.
Expand All @@ -198,6 +199,8 @@ def read(
Reference spectral model.
checksum : bool
If True checks both DATASUM and CHECKSUM cards in the file headers. Default is False.
table_format : str
Format string for the ~astropy.Table object. Default is "ascii.ecsv"
**kwargs : dict, optional
Keyword arguments passed to `astropy.table.Table.read`.
Expand All @@ -208,9 +211,8 @@ def read(
"""
filename = make_path(filename)
gti = None
kwargs.setdefault("format", "ascii.ecsv")
try:
table = Table.read(filename, **kwargs)
table = Table.read(filename, format=table_format, **kwargs)
except (IORegistryError, UnicodeDecodeError):
with fits.open(filename, checksum=checksum) as hdulist:
if "FLUXPOINTS" in hdulist:
Expand Down

0 comments on commit ad98c64

Please sign in to comment.