Wide Band Spectrometer (WBS)
    6.1  How to Plot Light Curves of WBS Data
        6.1.1  Plotting Seven WBS Sub-Instruments on One Page
        6.1.2  Light Curves of SXS and HXS-PC
        6.1.3  Light Curves of SXS-PC
        6.1.4  Light Curve of HXS-PC
        6.1.5  Light Curve of Ratio of HXS-PC2 to HXS-PC1
        6.1.6  Light Curve of HXS-PH
        6.1.7  Light Curve of Ratio of HXS-PHi-j to HXS-PHk-l
        6.1.8  Light Curve of GRS-PCL
        6.1.9  Light Curve of GRS-PCH
        6.1.10  Light Curve of Ratio of GRS-PCi to GRS-PCj
        6.1.11  Light Curve of GRS-PHL and GRS-PHH
        6.1.12  Light Curve of Ratio of GRS-PHLi-j to GRS-PHLk-l
        6.1.13  Light Curve of RBM-SC-PC and RBM-SD
    6.2  How to Display WBS Spectra
        6.2.1  Displaying the Spectra in Image Form
        6.2.2  HXS Spectral Display (single power law fitting)
        6.2.3  HXS Spectral Display (double power law fitting)
        6.2.4  GRS Spectral Display
    6.3  How to Fit WBS Spectra
        6.3.1  HXS_FSP (McTiernan)
        6.3.2  FSP_PROC (McTiernan)
        6.3.3  SPFD HXS
        6.3.4  SPFD GRS
    6.4  Useful Routines for WBS


6  Wide Band Spectrometer (WBS)

6.1  How to Plot Light Curves of WBS Data

6.1.1   Plotting Seven WBS Sub-Instruments on One Page

It is possible to get light curves of several of the WBS channels on a single page by using the routine PLOTT_WDA. A sample plot is shown in Fig. 6.10. The routine will plot the SXS12, SXS21, HXS, GRS1, GRS2, radiation belt monitor (RBM) NaI Scintillation Detector, and RBM Si Detector. If the WBS index or roadmap have already been read in using YODAT or another routine, then you can use the command:
 
IDL >  plott_wda, roadmap
You can also get WBS light curve plots by specifying a date and time. When you use this calling option with PLOTT_WDA it will use the WBS data stored in the Yohkoh observing log files, which is lower time and count resolution than accessing the data file directly. In the first example shown below, the data between 22:30 and 24:00 for the 15-Nov-91. In the second example, it will plot 30 minutes of data starting at 2-Dec-91 4:30.
 
IDL >  plott_wda, '15-nov-91 22:30', '15-nov-91 24:00'
IDL >  plott_wda,'2-dec-91 4:30',30
 

demo_plott_wda.gif

Figure 6.10: plott_wda, '15-nov-91 22:35', 10,psym=10

6.1.2  Light Curves of SXS and HXS-PC

First, run YODAT to extract all the relevant WDA data for the flare. After running YODAT, when you return to the IDL prompt, you can execute the following WBS time plotting routine.
 
IDL >  wbspc,data,index
WBSPC plots the SXS-PC (2ch), and HXS-PC (2ch) time histories on a UT time axis. The following are the steps required to do the time plotting:

  1. First, a rough light curve of HXS of the whole event will pop-up in which you can select a time interval that you want as the complete 4-channel time histories.
  2. When selecting the time interval, follow the instructions which appear in the IDL session window.
  3. After obtaining the result, a menu window will pop-up, in which you can select a print-out to the local printer or exit from this routine to the main YODAT routine.

NOTE: You must be careful of the limitation due to dead time correction (see DTCF_PC_HXS.PRO in the Reference Guide).

The following time plotting routines from Sections 6.1.3 through 6.1.12 have executing steps similar to those described above. To obtain more detailed information about the execution, you can access the header section of each procedure by using the DOC_LIBRARY IDL procedure.

6.1.3   Light Curves of SXS-PC

After having read the WBS data with YODAT, you can get two light curves of the count rate (in unit of counts/sec) of SXS-PC11 and PC12, and PC21 and PC22 with UTPLOT. The routine SXSCV extracts the SXS-PC data in full time resolution and with the deadtime corrected. You can plot these data with the UTPLOT routine. With the capability of the PLOT_LCUR routine, you can plot in the SXSPC routine the light curves more easily using the mouse. Some examples are:
 
IDL >  pc_data=sxscv(data,index,/plot)
IDL >  pc_data=sxscv(data,index)
IDL >  sxspc,pc_data,index
 

6.1.4  Light Curve of HXS-PC

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/0.125 sec) of HXS-PC1, HXS-PC2 or HXS- PC1+PC2 with UTPLOT. There are some optional inputs such as error bars, integration time, time range and summation of adjacent pulse count (PC) data etc.
 
IDL >  plot_hxspc,index,data,pc
IDL >  plot_hxspc,index,data,2
IDL >  plot_hxspc,index,data,[1,2]
where pc is 1 to have PC1 plotted, 2 for PC2, and [1,2] to have the sum of PC1 and PC2 plotted. NOTE: You must be careful of the limitation due to dead time correction (see DTCF_PC_HXS.PRO in the Reference Guide).

6.1.5  Light Curve of Ratio of HXS-PC2 to HXS-PC1

After having read the WBS data with YODAT, you can get a light curve of ratio of HXS-PC2 to HXS-PC1 counting rates with UTPLOT. There are similar optional inputs to PLOT_HXSPC.
 
IDL >  hxspc =mk_hxspc(index,data,xtime=xtime)
MK_HXSPC is a function for making a float array of HXS-PC1 and PC2 data with UTPLOT. hxspc=fltarr(2,16*N), where N is the number of major frames. It takes two major frames to assemble a full set of WBS data. hxspc(0,*) is pc1 and hxspc(1,*) is pc2.
 
IDL >  utplot, xtime, hxspc(1,*)/hxspc(0,*), index(0)
NOTE: You must be careful of the limitation due to dead time correction (see DTCF_PC_HXS.PRO in the Reference Guide).

6.1.6  Light Curve of HXS-PH

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/sec) of selected HXS-PH channel or energy ranges with UTPLOT.
 
IDL >  plot_hxsph,index,data,range=[a,b]
IDL >  plot_hxsph,index,data,range=[234.5,345.6]
IDL >  plot_hxsph,index,data,channel=[i,j]
IDL >  plot_hxsph,index,data,channel=[15,20]
where range is the energy range in keV to plot. The second example plot the total hxs_ph counts between 234.5 and 345.6 keV. The optional keyword channel can specify which channels to sum. The fourth example above bins all counts between 15th and 20th channels. There are some optional inputs such as error bar, time range and summation of adjacent PH data etc. NOTE: You must be careful of the limitation due to dead time correction (see DTCF_PH_HXS.PRO in the Reference Guide).

6.1.7  Light Curve of Ratio of HXS-PHi-j to HXS-PHk-l

After having read the WBS data with YODAT, you can get a light curve of the count rate of the ratio of HXS-PHi-j to HXS-PHk-l with UTPLOT.
 
IDL >  hxsph1=mk_hxsph(index,data,xtime=xtime,channel=[i,j])
IDL >  hxsph2=mk_hxsph(index,data,xtime=xtime,channel=[k,l])
MK_HXSPH is a function for making a float array of HXS-PH data. Next you extract background data.
 
IDL >  bgph=out_hxsph(index,data,/disp)
IDL >  bgph=out_hxsph(index,data,stime=stime)
OUT_HXSPH is a function for output of HXS_PH data structure. You subtract the background data and plot it.
 
IDL >  subph1=hxsph1-total(bgph.signal(i:j))
IDL >  subph2=hxsph2-total(bgph.signal(k:l))
IDL >  utplot,xtime,subph2/subph1,index(0)
NOTE: You must be careful of the limitation due to dead time correction (see DTCF_PH_HXS.PRO in the Reference Guide).

6.1.8  Light Curve of GRS-PCL

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/0.25 sec) of GRS-PC11, PC12, PC21 or PC22 with UTPLOT. There are similar optional inputs to PLOT_HXSPC.
 
IDL >  plot_grspcl,index,data,pc=[11,12,21,22]
IDL >  plot_grspcl,index,data,pc=[11,12]
IDL >  plot_grspcl,index,data,pc=[21,22]
 

6.1.9  Light Curve of GRS-PCH

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/0.5 sec) of GRS-PC13, PC14, PC15, PC16, PC23, PC24, PC25 or PC26 with UTPLOT. This works in a similar way to PLOT_GRSPCL.
 
IDL >  plot_grspch,index,data,pc=[13,14,15,16,23,24,25,26]

6.1.10  Light Curve of Ratio of GRS-PCi to GRS-PCj

After having read the WBS data with YODAT, you can get a light curve of the ratio of GRS-PCi to GRS-PCj with UTPLOT. For GRS-PCL1, you do the following:
 
IDL >  grspcl=mk_grspcl(index,data,xtime=xtime)
MK_GRSPCL is a function for making a float array of GRS-PC11 and GRS-PC12 data. grspcl=fltarr(4,8*N), where N is the number of major frames. It takes two major frames to assemble a full set of WBS data. grspcl(0,*) is pc11 and grspcl(1,*) is pc12. For example, to ratio GRS-PC12 to GRS-PC11:
 
IDL >  utplot,xtime,grspcl(1,*)/grspcl(0,*),index(0)
For GRS-PCL2, you can do a similar ratio. grspcl(2,*) is pc21 and grspcl(3,*) is pc22.

6.1.11  Light Curve of GRS-PHL and GRS-PHH

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/4 sec) of GRS-PHL or GRS-PHH using UTPLOT. This works in a similar way to PLOT_HXSPH. The units of a and b are MeV.
 
IDL >  plot_grsphl,index,data,ph=1,range=[a,b]
IDL >  plot_grsphl,index,data,ph=2,channel=[i,j]
IDL >  plot_grsphh,index,data,ph=1,range=[a,b]
IDL >  plot_grsphh,index,data,ph=2,channel=[i,j]
 

6.1.12   Light Curve of Ratio of GRS-PHLi-j to GRS-PHLk-l

After having read the WBS data with YODAT, you can get a light curve of the count rate of the ratio of GRS-PHLi-j to GRS-PHLk-l with UTPLOT. This works in a similar way to light curve of ratio of HXS-PHi-j to HXS- PHk-l. For GRS-PHL1:
 
IDL >  grsphl1=mk_grsphl1(index,data,xtime=xtime,channel=[i,j])
IDL >  grsphl2=mk_grsphl1(index,data,xtime=xtime,channel=[k,l])
MK_GRSPHL1 is a function for making a float array of each of 128 GRS-PHL1 data. Next you extract background data.
 
IDL >  bgph=out_grsphl1(index,data,/disp)
IDL >  bgph=out_grsphl1(index,data,stime=stime)
OUT_GRSPHL1 is a function for output of the grs_phl1 data structure. Now you subtract the background data and plot it.
 
IDL >  subph1=grsphl1/4.0-total(bgph.signal(i:j))
IDL >  subph2=grsphl2/4.0-total(bgph.signal(k:l))
IDL >  utplot,xtime,subph2/subph1,index(0)
For GRS-PHL2, you can do a similar calculation using MK_GRSPHL2 and OUT_GRSPHL2.

6.1.13  Light Curve of RBM-SC-PC and RBM-SD

After having read the WBS data with YODAT, you can get a light curve of the count rate (counts/0.25 sec) of RBM-SC-PC1, PC-2 or RBM-SD with UTPLOT.
 
IDL >  rbmpc=mk_rbmpc(index,data,xtime=xtime)
MK_RBMPC is a function for making a float array of RBM-SC-PC1, PC2 and RBM-SD data with UTPLOT. rbmpc=flarr(3,8*N), where N is the number of major flames. It takes two major frames to assemble a full set of WBS data. rbmpc(0,*) is RBM-SC-PC1, rbmpc(0,*) is RBM-SC-PC1, and rbmpc(2,*) is RBM-SD. For example, to plot RBM-SC-PC1.
 
IDL >  utplot,xtime,rbmpc(0,*), index(0)
NOTE: We do not take account of the deadtime correction.

6.2  How to Display WBS Spectra

6.2.1  Displaying the Spectra in Image Form

An image representation of the SXS, HXS, RBM-SC, and GRS spectra over time can be displayed using the routine DISP_WDA. After reading the data with YODAT, a sample call is:
 
IDL >  disp_wda, index, data

6.2.2  HXS Spectral Display (single power law fitting)

A single power law fit to the HXS data can be obtained by executing:
 
IDL >  hxs_sp1,data,index
The steps you should follow are:

  1. First, a small menu window will pop-up on the screen.
  2. There are four menu items

  3. You select the background time first. A rough HXS light curve will pop-up where you can determine the start and end time of the background necessary for the spectral analysis.
  4. Next, when you click the second menu item, then the rough HXS light curve will pop-up again where the time interval in the flare needed for the spectral fitting analysis can be selected by left and right button on the mouse.
  5. If the result is not satisfactory or several spectra are needed, you can repeat the first or second menu item.
  6. When hard copies are necessary, you can click the third menu item.

NOTE: You must be careful of the limitations of the instrument. Spectral distortion occurs when the deadtime-corrected counts of total PH exceeds about 21,000 counts/sec. It is difficult to correct the spectral distortion (see DTCF_PH_HXS.PRO in the Reference Guide).

6.2.3  HXS Spectral Display (double power law fitting)

It is also possible to perform a double power-lwa fit to the HXS data. Just type:
 
IDL >  hxs_sp2,data,index
NOTE: You must be careful of the limitations of the instrument outlined above.

6.2.4  GRS Spectral Display

You can plot a preliminary gamma-ray spectrum with
 
IDL >  grs_speff,index,data,ph=1
IDL >  grs_speff,index,data,ph=2
In this plot the flux of each channel is calculated by dividing counts by the full energy peak efficiency. The full energy peak efficiency at each channel is given by dividing ``Efficiency" in grs1_40.rel and grs2_40.rel by 1000. NOTE: We do not plot the first 3 channels of data of GRS-PHL1 and the first four channels of data of GRS-PHL2 because their channel widths are not exactly determined.

6.3  How to Fit WBS Spectra

These sections describes the routines for detailed spectral analysis. You must be careful of the limitations of the instrument. HXS spectral distortion occurs when the deadtime-corrected counts of total PH exceeds about 21,000 counts/sec. It is difficult to correct the spectral distortion.

6.3.1   HXS_FSP (McTiernan)

Spectra can be obtained for HXS data using the program HXS_FSP, which takes the WBS index and data structures, and returns the parameters for whatever type of spectrum is desired. HXS_FSP is interactive. You choose the data interval, and the type of fit. The routines HXSGRS_FSP, GRS32_FSP and HXT_FSP work in the same way, for the HXS-GRS, GRS first 32 channels, and HXT data. The examples shown here will apply to all of them.

First, you must read the WBS data. The most simple method is to use YODAT, but you can read a WBS data file directly using RD_WDA. Given index and data, some sample calls to HXS_FSP are:
 
IDL >  HXS_FSP, index, data, fit_pars
IDL >  HXS_FSP, index, data, fit_pars, sc_par, ch_dta
IDL >  HXS_FSP, index, data, outfile=outfile
IDL >  HXS_FSP, index, data, pfile=pfile
IDL >  HXS_FSP, index, data, countfile=countfile
IDL >  HXS_FSP, index, data, fit_pars, sc_par, ch_dta, sdel=sdel
The input parameters, index and data, must always be present. All of the other parameters are optional. The structure fit_pars contains the results of the fit, including the type of fit, the values of the parameters, labels for the different parameters, the value of c2, and the interval and background times. (Times are given in the standard 7-element array, [hr,min,sec,msec,day,mon,yr].) The structure sc_par contains spectrometer channel information, such as the channel edges and the background count rate; ch_dta is a structure containing the data for each channel. The keyword pfile is the name for an output plot PostScript file, outfile is a name for a file for a print-out of the results, sdel is an array of channels you'd like to delete. The keyword countfile is the name for a file, with the format given in /ys/ucon/soft/mctiernan/spectral_data_format, which can be fit by the instrument-independent routine FSP_PROC.

The following are the steps required to fit HXS spectra.

That's all there is to it. The program will plot each fit on the screen as it is completed, and if the keyword ``pfile'' is set, these plots go into the specified file.

6.3.2  FSP_PROC (McTiernan)

If you have set the keyword countfile in a call to one of the *_FSP routines, the output is a file which can be used as input to the routine FSP_PROC. You may want to do this if you want to save the count rates from a given instrument, and run multiple fits, using different kinds of spectra, and different sets of channels, for example,
 
IDL >  hxs_fsp, index, data, countfile='test.dat'
IDL >  fsp_proc, 'HXS', 'test.dat', 'test.otp', fit_pars, sc_par, ch_dta
will result in the fit of the file ``test.dat'' and put the output into the file ``test.otp''. The structures are the same, except that the interval and background times are in a structure which is not compatible with the Yohkoh time structures; you can change the times to the seven element array using the routine TFSPTOT7 (it is possible that the default time structures will be changed to the Yohkoh format in the future).
 
IDL >  n_fits = N_ELEMENTS(fit_pars)
IDL >  t_new = intarr(n_fits, 7)
IDL >  FOR j = 0, n_fits - 1 DO t_new(j, *) = tfsptot7(fit_pars(j).t)
This will not be necessary in future versions.

6.3.3  SPFD HXS

SPFDHXS performs spectral fitting to the HXS data. The routine SPFDHXS runs on the only SUN workstation. After reading the data with YODAT, you choose a time interval for the flare data.
 
IDL >  flph=out_hxsph(index,data,/disp)
IDL >  flph=out_hxsph(index,data,stime=stime)
where /disp allows you to choose by mouse operation, and stime is the signal time to be chosen. Next you choose the background data in a similar way.
 
IDL >  bgph=out_hxsph(index,data,/disp)
IDL >  bgph=out_hxsph(index,data,stime=stime)
You get a count spectrum (plot of counts/s keV vs. energy) with
 
IDL >  spplot_hxs,flph,bgph
The text file of the spectral data for SPFD (routine of spectral fitting double precision) is written with
 
IDL >  write_hxsph,flph,bgph
The name of the text file (default) is HXS_SPECTRUM.DATA.

We have a simplified routine called TEST_OUTH. This routine consists of three functions, OUT_HXSPH.PRO, SPPLOT_HXS.PRO and WRITE_HXSPH.PRO which are mentioned above. You can do the same procedure shown above by using TEST_OUTH.


 
IDL >  test_outh,index,data,/disp
IDL >  test_outh,index,data,fltime=fltime,bgtime=bgtime
Next you set a spectral function (single power law, broken power law, thermal spectrum, Gaussian spectrum and their combination) and the initial values of spectral parameters in the file hxs.model.

This file must be in the executing directory of SPFDHXS. Maximum numbers of fitting models and parameters ( 'PAR', 'XPAR' and 'YPAR') are 10 and 20, respectively.

The following is a sample parameter file for power law analysis:

'REM'    SAMPLE FILE FOR POWER LAW ANALYSIS 
'SER'    0.01   /SYSTEMATIC ERROR
'CND'    300     3.00      0.001  / MAXSTP, CHISQ-MIN, VARIATION
'BIN'    01111111111111111111111111111110
'MDL'    POWL(1,2)
'PAR'    1          1         0.1         10
'PAR'    2         3.0       2.0         4.0
'OUT'    './HXS_RESULTS.DATA'
'FILE'   './HXS_SPECTRUM.DATA'

The following is sample parameter file for broken power law + Gauss analysis

'REM'      SAMPLE FILE FOR COUTOUR MAP (XAXIS INDEX1,YAXIS INDEX2)
'TRACE'    1                     / 1 OFF   0    ON
'SER'      0.01   /SYSTEMATIC ERROR
'CND'      300     3.00      0.001  / MAXSTP, CHISQ-MIN, VARIATION
'BIN'      01111111111111111111111111111110
'MDL'      BRPW(1,2,3,4) + GAUS (5,6,7)
'PAR'      1          1           0.1          10
'XPAR'     2          3.0        4.0          20
'YPAR'     3          4.0        5.0          20
'PAR'      4           70         50         100 
'PAR'      5          3.0        0.3          30
'PAR'      6          511         0            0
'PAR'      7           2          0.2          20
'XRMK'     'INDEX1  ( <Eb)'
'YRMK'     'INDEX2  ( >Eb)'
'TITLE'    'CONTOUR MAP INDEX 1/2'
'CHI2'     5.0    / MAXIMUM ALLOWED RED_CHI2 VALUE.
'LEVEL'    99.0     95.0      90.0     68.0    3.0   /MAX:(10)
'OUT'      './HXS_RESULTS.DATA'
'FILE'     './HXS_SPECTRUM.DATA'

For details on the parameters for these files, see the file $DIR_WBS_CAL/spfd_hxs.example or /ys/ucon/soft/sato/hxs.model.

You carry out the spectral fitting on Sun machines with the command:
 
%  /ys/ucon/soft/sato/spfdhxs
or from IDL with the command:
 
IDL >  spfdhxs

You read the output file with the command
 
IDL >  spfd=read_spfdhxs()
The name of file (default) is HXS_RESULTS.DATA. You plot the spectrum with
 
IDL >  spfdplot_hxs,spfd
IDL >  spfdplot_hxs,spfd,/chimap
You can plot a chi-square map with the second example above.

You can plot the time profile of time sequential data of spectral parameters (spectral index, spectral coefficient, temperature etc.) with
 
IDL >  utplot,spfd.xtime,spfd.parafinal(1,*),spfd(0).fltime(0)+spfd(0).date

For details on the routines for this spectral fitting, use DOC_LIBRARY.

6.3.4  SPFD GRS

SPFDHXS performs spectral fitting to the GRS data. The routine SPFDGRS runs on the only SUN workstation. First you choose a time interval of the flare data.

The steps are identical to those described for SPFDHXS in the previous section, just use OUT_GRSPHL1 instead of OUT_HXSPH (and OUT_GRSPHL2 for GRS-2). Use SSPLOT_GRS and WRITE_GRSPH instead of SSPLOT_HXS and WRITE_HXSPH. There is a simplified routine called TEST_OUTG which is similar to TEST_OUTH. The default name of the text file with the data to be fit is GRS_SPECTRUM.DATA

Next you set a spectral function out of single power law, broken power law and power law plus Gaussian in a file of grs.model. This file must be in the executing directory of spfdgrs. You can set the parameters in a similar way to hxs.model. NOTE: Maximum numbers of fitting parameters and fitting models are 62 and 30, respectively.

The Unix and IDL routine to perform the spectral fitting is spfdgrs, and the results are read with READ_SPFDGRS. The default name of the results file is GRS_RESULTS.DATA. You plot the spectrum with SPFDPLOT_GRS.

6.4  Useful Routines for WBS

See the routines listed in the Appendix of this User's Guide on page A.5.


Converted at the YDAC on Mar 31, 1999
(from LaTEX using TTH, version 1.92, with postprocessing)