|
|
|
|
5. Plotting the Fitted Spectra Outside SPEX
After restoring the data file, in order to plot the spectra, we first need to compute the photon flux, error bars, background flux, model flux and so on for a specific interval. IDL>interval = 0 To compute the photon flux (=(obsi-backi)/convi) : IDL> phflux = (obsi-backi)/convi To compute the error of the photon flux (=eobsi/convi): IDL>errflux = sqrt(eobsi^2 + ebacki^2) /convi To compute the background flux (=backi/convi): IDL> backflux=backi/convi Since the “edges†is the edges of energy channel, we need to compute the mean value of each channel: IDL> print, edges[*,0:2] So far, we have all the spectral data for plots. We also need the f_vth_bpow model flux so that we can overplot on the data like SPEX does. By using xdoc introduced in "Spectroscopy - First Steps", we know f_vth_pow model uses f_vth.pro and f_bpow.pro to compute the thermal and nonthermal photon flux. The total photon flux is the sum of the two fluxes. Let us compute the model flux for the first interval using the saved fitting parameters from apar_arr. First, we get the fitting parameters for the first spectral fit: IDL> fitpara=apar_arr[*, interval] Secondly, we can check the UT time of that interval to see whether they are correct by comparing the time history window: IDL> uttime = anytim(xselect[*, interval] + utbase, /ecs) Thirdly, compute the thermal photon flux: IDL> thermflux = f_vth(edges, fitpara[0:1]) Finally, we compute the nonthermal photon flux. But we should do something beforehand. There is always a low energy cut-off for the power-law photon distribution. From Spectroscopy - First Steps, we know the default is 1 keV cut-off, and spectral index below 1 keV is -1.5. The nonthermal f_ bpow model uses these two parameters, but in the saved fitting parameters, they are not saved. So we have to add them at the end of the variable array "fitpara": IDL> a_cutoff = [1, 1.5] Now we have all the data we want to plot the spectrum of the first interval. The spectrum can be plotted as follows: IDL> loadct, 4 Here is an IDL procedure that does all of the above steps. You can use it directly by cutting and pasting it into an IDL/SSW session. The following is the spectrum we just plotted:
|
|
This page last updated: June 27, 2011
|