Skip to content

Commit bdc5a41

Browse files
committed
updated init and load calls with extension keyword
1 parent eecce75 commit bdc5a41

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

specutils/spectra/xrayspectrum1d.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def apply_response(self, mflux, exposure=None):
186186
## ---- Supporting response file objects
187187

188188
class ResponseMatrix(object):
189-
def __init__(self, filename):
189+
def __init__(self, filename, extension=None):
190190
"""
191191
Load a response matrix file (RMF) from a FITS file.
192192
@@ -244,7 +244,7 @@ def __init__(self, filename):
244244
self.energ_hi = None
245245
self.energ_unit = None
246246
self.detchans = None
247-
self._load_rmf(filename)
247+
self._load_rmf(filename, extension=extension)
248248

249249
def _load_rmf(self, filename, extension=None):
250250
# open the FITS file and extract the MATRIX extension
@@ -463,7 +463,7 @@ def apply_rmf(self, spec):
463463

464464
class AreaResponse(object):
465465

466-
def __init__(self, filename):
466+
def __init__(self, filename, extension=None):
467467
"""
468468
Load an area response file (ARF) from a FITS file.
469469
@@ -472,6 +472,10 @@ def __init__(self, filename):
472472
filename : str
473473
The file name with the ARF file
474474
475+
extension : str (default None)
476+
FITS file extension keyword, if the spectral response is stored
477+
under an extension other than "SPECRESP"
478+
475479
Attributes
476480
----------
477481
filename : str
@@ -506,7 +510,7 @@ def __init__(self, filename):
506510
self.specresp = None
507511
self.fracexpo = None
508512
self.exposure = None
509-
self._load_arf(filename)
513+
self._load_arf(filename, extension=extension)
510514

511515
def _load_arf(self, filename, extension=None):
512516
# open the FITS file and extract the SPECRESP extension

0 commit comments

Comments
 (0)