Skip to content

Commit 8b626a3

Browse files
Correcting mistakes in new InstrumentPileup (#628)
* correcting mistakes in new instrument for pileup * changelog updated * new version * Updated version number --------- Co-authored-by: lmauviard <73354617+lmauviard@users.noreply.github.com>
1 parent e1e361c commit 8b626a3

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

changelog.d/628.fixed.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Corrected a bug in ``InstrumentPileup`` to call ``super()``, where the RMF and ARF arguments were missing and needed.

xpsi/Instrument.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,16 @@ def __call__(self, signal, *args):
556556
'Response matrix loaded')
557557
def from_ogip_fits(cls,
558558
Data_path,
559+
ARF_path,
560+
RMF_path,
559561
bounds=dict(),
560562
values=dict(),
561563
**kwargs):
562564

563565
""" Load any instrument response matrix. """
564566

565567
# Load the default instrument class
566-
Instrument = super().from_ogip_fits(**kwargs)
568+
Instrument = super().from_ogip_fits(RMF_path, ARF_path=ARF_path, **kwargs)
567569

568570
## -------- INITIALIZATION OF THE PILEUP ---------------
569571

@@ -608,9 +610,8 @@ def from_ogip_fits(cls,
608610
Data_header = hdul['SPECTRUM'].header
609611

610612
if kwargs.get( 'datafolder', None ) is not None:
611-
ARF_path = _os.path.join( kwargs.get( 'datafolder'), kwargs.get( 'ARF_path' ) )
612-
else:
613-
ARF_path = kwargs.get( 'ARF_path' )
613+
ARF_path = _os.path.join( kwargs.get( 'datafolder'), ARF_path )
614+
614615
with fits.open( ARF_path ) as hdul:
615616
ARF_header = hdul['SPECRESP'].header
616617

0 commit comments

Comments
 (0)