Step-by-step Instructions for Using OSPEX

Fermi Solar Data Analysis Workshop at GSFC, August 22-23, 2012

 

Update SSW
Fit an interval yourself Import Script and Fit Results
Clean Up

Update SSW

Additions and bug fixes have been made since SSW was installed in the FermiVM.  Please follow the instructions here to update SSW in the FermiVM.

These instructions will work even it you don't update, but some new features won't be available

 

Fit an interval yourself

1. START OSPEX

bullet Open Terminal (click Terminal icon on left of FermiVM home screen)

In terminal, type

cd,'ospex'

sswidl
or
sswidlde&

(sswidl starts an SSWIDL command line session, sswidlde opens the SSW IDLDE GUI)
 

bullet In SSWIDL, type
    o=ospex()

2. SELECT INPUT

bullet Click File / Select Input
bullet Click Browse / On remote sites
bullet In 'Time Selection...' widget, click 'Flare Selection'
bullet In flare list, Scroll down and click flare 100612_0054
bullet Click Accept
bullet In 'Time Selection...' widget, click Search
bullet Highlight b0 .pha and .rsp2 files (first two in list)
bullet Click 'Accept and Close'
bullet In 'Input Options' widget, modify Start and End time to 12-Jun-2010 00:35:00 and 01:35:00
bullet Click 'Plot Time Profile'
bullet Zoom in by left-clicking and dragging in plot
bullet Unzoom by single left-clicking in plot
bullet Right-click to show coordinates of point
Command line equivalent:

gbm_find_data, date=['12-jun-2010 00:00', '12-jun-2010 02:00'], /rsp, det='b0'

o-> set, spex_specfile= '/home/fermiuser/ospex/glg_cspec_b0_100612_v03.pha'

o-> set, spex_accum_time= ['12-Jun-2010 00:35:41.457', '12-Jun-2010 01:34:08.328']

o-> set, spex_drmfile= '/home/fermiuser/ospex/glg_cspec_b0_bn100612_0054_038_v00.rsp2'

o -> plot_time, spex_unit='flux'

or o -> xinput to start data input selection widget

 

3. DEFINE BACKGROUND INTERVAL

bullet Click File / Select Background
bullet In Background Options widget, click Change
bullet New widget pops up with instructions
bullet Left click in time profile plot at ~00:45, right click at ~00:49
bullet Click 'Accept and Close' in 'Select Time ...' widget
Command line equivalent:

o-> set, spex_bk_time_interval=['12-Jun-2010 00:45:33.605', '12-Jun-2010 00:49:55.753']

or o -> xbk to start background selection widget

 

4. DEFINE ANALYSIS INTERVAL

bullet Click File / Select Fit Options and Do Fit
bullet Zoom in on time profile
bullet In Fit widget, click 'Change Fit Intervals';
bullet In plot left-click at ~00:55:51, right click at ~00:56:02
bullet Click 'Accept and Close' in 'Select Time...' widget
bullet In Fit widget, click 'Change' next to 'Energy range to Fit'
bullet In plot, left-click at ~250, right-click at ~20000.
bullet Click  'Accept and Close' in 'Select Energy...' widget
bullet In Fit widget, set 'Systematic Uncert' to 0.0
Command line equivalent:

o-> set, spex_fit_time_interval= ['12-Jun-2010 00:55:51.086', '12-Jun-2010 00:56:02.351']

o-> set, spex_erange= [250.77327D, 19756.840D]

o-> set, spex_uncert= 0.00000

or o -> xfit to start fit options widget

 

5. SELECT MODEL

bullet Click 'Do Fit' (if button doesn't show, use scroll bar on right of widget)
bullet In Fit Function Setup widget, click 'Delete comp' to right of vth component
bullet Click pull-down menu for components (to right of 'Choose:')
bullet Select thick2, click Add
    Change parameter 1 to 1.3, parameter 2 to 300, and parameter 3 to 4.2
bullet Select template, click Add
    In template box, click 'Keywords' pull-down menu and click nuc2
bullet Select line, click Add
    Change parameter 0 to 0.1, parameter 1 to 2223., and parameter 3 to 0.5
bullet Select another line, click Add
    Change parameter 0 to 0.1, parameter 1 to 511, and parameter 3 to 1.0
bullet Select a third line, click Add
    Change parameter 0 to .01, parameter 1 to 15000., and parameter 3 to 100.
bullet Current fit function should be 'thick2+template+line+line+line'
bullet Click Plot All
Command line equivalent:

o-> set, fit_function= 'thick2+template+line+line+line'

o-> set, fit_comp_params= [0.667175, 1.34547, 289.761, 4.24975, 11.6834, 320000., $

  1.94644, 0.118307, 2223.00, 0.500000, 0.162568, 511.000, 1.00000, 0.0258109, 15000.0, 100.000]

o-> set, fit_comp_spectrum= ['', 'nuc2', '', '', '']

o-> set, fit_comp_model= ['', '', '', '', '']

o-> set, fit_comp_free_mask= [1B, 1B, 1B, 1B, 1B, 0B, 1B, 1B, 0B, 0B, 1B, 0B, 0B, 1B, 0B, 0B]

o->plot_spectrum, spex_unit='flux', /bksub, /show_fit

 

6. FIT

bullet Click Fit at bottom of 'Fit Function Setup' widget
bullet When finished fitting, click Accept / and Store Fit... button.
Command line equivalent:

o->set, spex_fit_manual=0

o-> dofit

 

7. VIEW RESULTS

bullet In Fit widget:
    Click 'Show Fit', 'Show Error', and 'Plot Spectrum in Fit Intervals'
    Click 'Show Fit Summary'
bullet Click File / Plot Fit Results
    Select an item on right and click 'Plot'
    Since we only fit one time interval, items on left can't be plotted as a function of time
Command line equivalent:

o->plot_spectrum, spex_unit='flux', /bksub, /show_fit

o->fitsummary

o -> plot_summ, xplot='energy', yplot='resid'

o -> plot_summ, xplot='energy', yplot='data_photon_flux', /overlay_model, /show_error

or o -> xfitview to start fit results viewing widget

8. SAVE RESULTS AND SCRIPT

Click File / Write Script / and Fit Results

Command line equivalent:

o->writescript, outfile='test_script.pro', /restorefit, fit_outfile='test_results.fits'

 

Import Script and Fit Results

Prepared scripts and fit results files are stored in the ospex directory of the FermiVM for two cases:

bullet The single time interval at the peak of the event as described in the step-by-step instructions above, and
bullet 6 time intervals during the rise, peak, and decay of the event. 

1. RUN SCRIPT

To run the script and import the fit results for the 6 interval case, type the following in SSWIDL:

cd,'ospex'

Run script by calling it directly (the ospex object reference, o, is returned and the GUI is started):

ospex_script_11_jul_2012_6int, o=o

or start ospex, and click button to run the script:

o=ospex()

Click File / 'Set Parameters from Script' / 'Initialize All Parameters First'

Navigate to script called ospex_script_11_jul_2012_6int.pro

This scripts sets up the OSPEX parameters as they were when the fits were performed, reads in the FITS file containing the fit results for the 6 intervals, and brings up the OSPEX GUI.

2. View Results

Click  File /  Plot Fit Results
    Select any item on the left and plot as a function of time, or any item on the right and plot as a function of energy.

 

 

Clean up

To delete and clean up after the ospex object, type

destroy, o

To exit IDL, type

exit

 

Kim Tolbert
Last Modified:
20-Aug-2012