Fit a power law in SPEX ======================= Instructions ------------ The spectrum in the files :download:`powerl.spo ` and :download:`powerl.res ` was recorded from a source at 6 kpc distance. #. Load the spectrum into PYSPEX and plot it. #. The calibration of the instrument is not very accurate for energies below 0.3 keV and above 10 keV. Ignore those parts of the spectrum. #. How many data bins do you have in the spectrum? Now try to apply optimal binning to the spectrum. How many bins are left? #. Set up an absorbed powerlaw model. Do not forget to set the distance to the source. #. Next step: fit the spectrum. Is it a good fit? #. Calculate the errors on all free parameters and save your results in a python variable. Learning goals -------------- After having done this spectrum, you should know: - How to read a spectrum in SPEX (using `s.data() `_). - How to use the basic plot functionalities (using `s.plot_data() `_). - How to ignore parts of the spectrum (using `s.ignore() `_). - How to optimally bin a spectrum (using `s.obin() `_). - How to set-up a simple spectral model (using `s.com() and s.com_rel() `_). - How to set the distance (using `s.dist() `_). - How to do spectral fitting (using `s.fit() `_). - How to determine errors on parameters (using `s.error() `_).