first key addition

This commit is contained in:
Sakimori 2025-07-21 16:32:34 -04:00
parent a6f707d58f
commit bb36dffab5
No known key found for this signature in database

View file

@ -125,13 +125,14 @@ def addBurst(values):
#and save the new plot
show_dynamic(injectedSpectra, f"{basename} Dynamic Spectra and {values.dm} DM Pulse", save=True)
#now generate new filterbank file
newName = f"{basename}_injected.fil"
#build header from original file
headerDic = filterbankObj.your_header.__dict__
#remove extraneous keys
for key in ['filelist', 'filename']:
headerDic.pop(key, None)
sigprocObj = make_sigproc_object(**headerDic)
newName = f"{basename}_injected.fil"
headerDic['rawdatafile'] = newName
sigprocObj = make_sigproc_object(**headerDic)
sigprocObj.write_header(newName)
sigprocObj.append_spectra(injectedSpectra, newName)
logger.info(f"{newName} successfully written.")