def xpxspec(file_path, **kwargs): """Do a spectral fit in XSPEC """ fitter = xSpectralFitter(file_path, **kwargs) if kwargs['plot']: fitter.plot() return fitter
def fit(save_plots=False): pha_file = OUT_FILE_PATH_BASE + '_pha1.fits' xspec_model = 'wabs*pcfabs*(bremss+gaussian)' fitter = xSpectralFitter(pha_file, model= xspec_model, emin=1., emax=10.) fitter.set_parameters([4.247, 24.2507, 0.598867, 97.1898, 0.0756629, 6.35897, 0.203741, 0.00076903]) fitter.model.show() fitter.plot(['ldata', 'ufspec'], title='XIPE 800 ks') if save_plots: fitter.save_plot('gk_per_spectrum.ps')