Spectroscopy -- Second Steps

 

                                   


2. Selecting Multiple Analysis Intervals


 

SPEX is capable to doing spectral fitting for multiple time intervals. In order to do this, we need to first select multiple analysis intervals. Since the July 23 event lasts for a very long time (about 1 hour), it is very difficult to select time intervals in the crowded time history window, even though the rates are binned every 4 s. First, we can enlarge the time history widow by clicking on one edge and dragging it to produce the desired size. The lightcurve with background subtracted then appears as follows:


 

SPEX Time History Window


 

An enlarged version of the time of interest can be obtained with the zoom command. First type "zoom", then select the "Graphic Input", "Continue by selecting from the window", then select the start time and end time of the zoom-in region. A zoomed in time history will appear as follows:


 

click to enlarge image


 

It is much more convenient to select time intervals from the window above to analyze the main impulsive peak of the flare (from 00:26:20 UT to 00:39:40 UT). By typing clear_ut, then typing graph in SPEX, the time history window will return to the original time history plot.

After you type "select", the following window will pop up:

click to enlarge image

This window lists three ways to select time intervals.

Method 1: Boundaries for contiguous intervals. This means the end of time one interval is the start time of the following interval. To use this method, click on the top button in the above window, click "Continue by selecting from the window" in the next widget, then select the start of the first interval by moving the curser to the desired time in the Time History Window and clicking, and then select the end of the first , second, third, etc. intervals until you have selected all the intervals. To show what you have selected, type the following in SPEX:

SPEX> graph
SPEX> display
 


 

The following selected time history window will appear:


 

click to enlarge image


 

We selected four contiguous intervals. Variable ifirst and ilast are the start and end time interval number to fit. The default of ifirst is 0, ilast is the last interval, which is 3 for this case.

SPEX> print,ifirst, ilast
0 3
 


 

If we type count to see the count flux spectrum, the spectrum is for the first time interval (00:27:27.999 -- 00:28:31.999 UT):


 

click to enlarge image


 

Using what we have learned from "Spectroscopy -- First Steps", we set the function we want to fit (f_vth_bpow model is the default), the energy range to fit, initial estimates of the fitting parameters, and which ones should be free to vary. We then type fit to fit the spectra for all the intervals sequentially.. As the fitting proceeds, the spectral window will show the fitted spectrum, one by one, and stop at the final time interval. All the fitting parameters are saved in variable array, apar_arr:

SPEX> print, apar_arr
1.24413 3.35509 14.1803 2.93961 81.1886 3.32381
2.68748 3.31781 14.0138 2.70112 78.9045 3.14351
3.57966 3.21793 13.6295 2.60562 81.8491 3.09796
3.91184 3.17164 8.94853 2.71290 76.7049 2.99297
 

The reduced chi-square values are stored in the array chi:

SPEX> print, chi
0.642303 1.05372 0.780159 1.05493
 

If we only want to fit the spectrum for interval 0, we need change the value of ilast to 0:

SPEX> ilast, 0
SPEX> print, ifirst, ilast
0 0
SPEX> count
SPEX> fit
 

The following plot of the best fit f_vth_bpow photon flux spectrum appears along with the residuals expressed as the number of sigma above or below the model values:


 

click to enlarge image


 

We can set eplot to 1 so that we can see the error bar in spectral data:

SPEX> eplot, 1
SPEX> photon
 

If we want to fit the spectrum at the second time interval, we need to reset ifirst and ilast:

SPEX> ifirst, 1
SPEX> ilast, 1
 

Then we can do the fit for the second interval. Similarly, we can do the third and forth interval and so on.

Method 2: Boundaries for discrete intervals. Since the intervals are discrete, we need to select the start and end time of each interval. Click on the middle button, click "śContinue by selecting from the window" in the next widget, then select the start and the end of each time interval by moving the curser to the appropriate times in the Time History Window and clicking with any mouse button. As many intervals can be selected as needed but the end of one interval will not necessarily be the start of the next. To show what we have selected, we should type the following in SPEX:

SPEX> graph
SPEX> display
 

The selected discrete intervals are shown in the following:


 

click to enlarge image


 

The vertical orange dotted/broken lines mark the start/end of each interval, respectively. To get the time in seconds for each time interval:

SPEX> print, xselect
1663.9990 1692.0000
1727.9990 1743.9990
1760.0000 1779.9990
1824.0000 1851.9990
 

Type fit to fit all intervals one by one. If we want to fit a specific interval, set the ifirst and ilast to that interval. These steps are similar to those in Method 1 above.


 

Method 3: As limits on sample groups of N (to be chosen). This method allows us to choose one long interval and divide it up into equal intervals of length N times the basic binning time of the data. In our example, we have used 4-s binning times Thus, if we want to fit spectra in every 4-s interval, we would set N to 1. If wanted to use 8-s intervals we would set N to 2. Here, we set N to 5, so we are fitting the spectrum contiguously with 20-s time intervals.

Click on the button marked "AS LIMITS ON SAMPLE GROUPS OF N (TO BE CHOSEN)". The following window pops up:


 

click to enlarge image

Select 5 in the righthand column, click the "Ready" button, then click "Continue by selecting from the window". Finally in the Time History Window, click the start and the end of time of the period in which you want to make your 20-s intervals. In order to see the intervals we selected, type the following:

SPEX>graph
SPEX>display
 

And this window appears:


 

click to enlarge image


 

We can see evenly selected contiguous 20-s intervals. By checking the size of the "xselect" array, we know how many intervals we have selected:


 

SPEX> help, xselect
XSELECT (SPEX_PROC_COM)
DOUBLE = Array[2, 37]
 


 

We selected 37 time intervals. We can fit the 37 spectra sequentially by assuring that ifirst = 0 and ilast = 36 and typing fit. After it finishes, we can check the best-fit parameters:

SPEX> fit
SPEX> help, apar_arr
APAR_ARR (SPEX_PROC_COM)
FLOAT = Array[6, 37]

SPEX> print, apar_arr[*, 0:3]
0.756227 3.20582 9.46661 3.31592 75.3729 3.83593
1.09641 3.35124 15.3057 2.90970 86.1484 3.37075
1.60972 3.38625 16.0934 2.82412 85.3917 3.15549
2.13309 3.36383 13.8587 2.75644 67.5149 3.19990

SPEX> print, chi[0:3]
0.928469 1.00548 0.788376 0.934216
 

The window with the fitted spectra and residuals cycles through very rapidly in the Spectral Window. However, we can use create_ps to save all the spectral and residual plots as postscript files:

SPEX> psstyle = fullportrait
SPEX> create_ps
 

Then postscript files named like fitting_100212_110946.ps will be saved in your IDL working directory. It has 37 pages of spectral plots. Each one is one interval we select. This create_ps can also be used with the former two methods. For more detailed explanation, see "How to Create and Customize Postscript Plots within SPEX".

If the postscript files we saved are not appropriate for publication purposes, or we need plots of the time history of some fitting parameters, then we have to save all the parameters and use them outside SPEX to make publication-quality plots.

After selecting the multiple intervals with either of the three methods above , we can check the variable "xselect" to see what the start and end time are for each time interval. Here, let us check the multiple time intervals we selected in method 1. The variable "xselect" will give us the time in units of seconds:

SPEX> help,xselect
XSELECT (SPEX_PROC_COM)
DOUBLE = Array[2, 4]

SPEX> print, xselect
1647.9990 1711.9990
1711.9990 1747.9990
1747.9990 1784.0000
1784.0000 1819.9990
 

If we want to know the "xselect" in units of UT, then we need to get UT base time (in unit of seconds) by issuing an IDL command:

SPEX> idl, ut_base = getutbase()
 

We check the ut_base in UT time, we type:

SPEX> idl, ptim, ut_base
23-Jul-2002 00:00:00.000
 

Then we print xselect in UT time format:

SPEX> idl, ptim, xselect + base
2002/07/23 00:27:27.999 2002/07/23 00:28:31.999
2002/07/23 00:28:31.999 2002/07/23 00:29:07.999
2002/07/23 00:29:07.999 2002/07/23 00:29:44.000
2002/07/23 00:29:44.000 2002/07/23 00:30:19.999
 

 

Previous | Start | Next

 

 

Responsible NASA Official:
Brian Dennis
Web Design:
Merrick Berg

Solar Physics Laboratory, Goddard Space Flight Center

Space Science Laboratory, University of California Berkeley
 
Responsible Berkeley Official:
Hugh Hudson
Systems Admin:
Jon Loran

This page last updated: June 27, 2011