Adventures with srobfit

1.        Began by going to the bottom of my web page, then to the bottom of the colloquium.  Downloaded srobfit.zip to a clean zip disk on the E drive.

2.        I used winzip to extract all files to E using the folder names.

3.        I opened a dos window

E:\>dir

 

 Volume in drive E has no label

 Volume Serial Number is 18DC-0C01

 Directory of E:\

 

SROBFIT  ZIP     1,327,251  05-15-02  9:26p SROBFIT.ZIP

FORTRAN        <DIR>        06-26-02  8:38a fortran

RUNABLE        <DIR>        06-26-02  8:38a RUNABLE

TCASES         <DIR>        06-26-02  8:38a TCASES

MENUBAT        <DIR>        06-26-02  8:38a MENUBAT

NOCOPRO        <DIR>        06-26-02  8:38a NOCOPRO

INSTALL  BAT            38  12-01-94  6:05p INSTALL.BAT

DOSREAD  ME         59,376  01-02-96  5:05p DOSREAD.ME

MKESSSE  BAT           368  10-25-95  8:45a MKESSSE.BAT

         4 file(s)      1,387,033 bytes

         5 dir(s)      95,690,752 bytes free

 

E:\>

4.        There have been some changes in computing since 1991.  I used notepad to look at the file dosread.me.  A few changes will be in bold in the first part of the text below.

Welcome to Robfit

 

Book reference "The Theory and Operation of Spectral Analysis

                       Using ROBFIT". AIP 1991 ISBN 0-88318-941-0[1]

        Robert L. Coldwell and Gary J. Bamford Univ. of Fla

             UFBOBC@NERVM.NERDC.UFL.EDU

             Coldwell@phys.ufl.edu

             BOBC@PINE.CIRCA.UFL.EDU

 

      The batch file install.bat called as a:install is shown below.

MKDIR robfit

cd robfit

a:robfit -d

This makes a directory robfit, and causes the self extraction of

the subdirectories fortran, runable, menubat, and tcases.[2]  The

executables are in runable, the menus are in menubat and the test

data is in tcases.  Get into the directory runable and enter the

command robfit to initiate a batch file that runs the separate

codes.  This file activates VRMAIN which allows you to change

the directory information.  The other codes can also be entered by

simply typing for example FSPDIS.  They read the information in

vrmain.mnu to find the other files.

                I entered the command robfit.  Then noted that the run type has already been set to dos.  The directory information is

 1 Menu files are in                       ..\menubat

 2 Data files are in                       ..\tcases

 3 Generated files (CN,PK,GR) are in       ..\tcases

                This is in accord with the file structure that Winzip just created.  Option 3, operation gives.

Select one note that this is done by simply entering the appropriate number

 1 Display raw data (RAWDD)                RUN

 2 Generate standard (STGEN)

 3 Display standard  (STDIS)

 4 Fit background (BKGFIT)

 5 Fit spectrum (FSPFIT)

 6 Display spectral fit (FSPDIS)

 7 Calibrate spectra (XCALIBER)

 8 Enter EDLIN, assumed to be in c:\dos

9                        STOP execution

   When this was run the dos window became full screen and the negative of

the plot above appeared.  To put this picture in this document, I entered <alt> <print screen>.  This put it on the clipboard.  I then pasted it into microsoft’s photo editor with the edit <paste as new image> command.  Then I went to effects on the header menu and requested negative.  Then back to edit, <select all>, then <copy> then to word with a paste.

   The test cases are labelled

ZTCASE1.SP (the data file) through ZTCASE8.SP (supernova data).  The first

few lines are comments in most files.  The early z*.pk files contain the

values of the actual peaks as they we generated artificially.

It is supposed to be obvious what to do next.  (...dis for display),

(...fit to fit). 

                After a number of years and some changes, I realize that it is not obvious.

1.                    Look at the data – this still holds --- there is no substitute.

2.                   Skip standard generation for now.  No need to display it either.  The background fit for all intents and purposes is now incorporated into FSPFIT.  Go to FSPFIT.  The menu is tricky.

If the menu is not as it is set up, the code will bomb and the computer will frequently recommend starting over. 

                The meu in the zip is for fitting CZTCASE9.SP.  I tested after each change.

Switch into the directory runable and enter the command

>robfit

 

This is the ROBFIT spectral analysis code version 2.30

 Uses 32*# of bkg cons for bkg up to 1028 points

     Copyright University of Florida 1992

 

Note to the user: If you modify the source code in any

way, please DO NOT refer to the modified code as ROBFIT.

  Page VRMAIN

 

 1 Run type DOS,CMS,...

 2 Directory information (where the files are)

 3 Operation (RAWDD,STGEN,...,XCALIBER)

 ENTER MENU #, <CR> TO RUN, S TO STOP, O FOR MORE OPTIONS

3

  Page VRMAIN3 (operation information)

  Select one

 1 Display raw data (RAWDD)

 2 Generate standard (STGEN)

 3 Display standard  (STDIS)

 4 Fit background (BKGFIT)

 5 Fit spectrum (FSPFIT)                   RUN

 6 Display spectral fit (FSPDIS)

 7 Calibrate spectra (XCALIBER)

 8 Enter EDLIN, assumed to be in c:\dos

 9      STOP execution

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

Enter two carriage returns to get to the fspfit menu

 

  Page VRMAIN

 

 1 Run type DOS,CMS,...

 2 Directory information (where the files are)

 3 Operation (RAWDD,STGEN,...,XCALIBER)

 ENTER MENU #, <CR> TO RUN, S TO STOP, O FOR MORE OPTIONS

 

Stop - Program terminated.

 CALLING MAOPEN FROM VRLINK

  Page FSPFIT

 

 1 General data on the spectral fit

 2 Input data information

 3 Output data information

 4 Standards files

 ENTER MENU #, <CR> TO RUN, S TO STOP, O FOR MORE OPTIONS

Enter a 1

1

  Page FSPFIT1 (General fit information)

 

 1 Maximum number of peaks                 511

 2 Starting, ending CUTOFF's in N steps    4.5,3,3

 3 peak fitting <VWID>, <FIXD> con only    VWID

 4 bkg fit CONT;NONK;FIXK;NOBF no fit      CONT

 5 Maximum number of background constants  54,54

 6 Weights 0=sqrt(f),1=calc,2=file,3 max   0

 7 File containing the weights             NONE

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

The 511 is fine.

The 4.5,3,3 has a set of meanings – for ztcase9 it is fine, but in general 20,5,4 will fit first the big peaks then the smaller ones and stop before inserting any spurious ones.  To fit only peaks more than 20 sigma above background change this to 20,20,1.  Do this by entering

>2,20,20,1

The VWID allows the peaks to have variable widths

The CONT is to continue fitting the background.

54,54 means start with the 54 peaks present and continue.  This file is a continuation of fits described at the bottom of the readme and elsewhere.  The code cannot begin with more than 4 constants,  unless there is a previous background file.  Set this line to 2,4 for fitting ztcase1.  Do this by entering

>5,2,4 

After these changes the new first menu page should be

Page FSPFIT1 (General fit information)

 

 1 Maximum number of peaks                 511

 2 Starting, ending CUTOFF's in N steps    20,20,1

 3 peak fitting <VWID>, <FIXD> con only    VWID

 4 bkg fit CONT;NONK;FIXK;NOBF no fit      CONT

 5 Maximum number of background constants  2,4

 6 Weights 0=sqrt(f),1=calc,2=file,3 max   0

 7 File containing the weights             NONE

Enter <cr> to get back to the top menu page, then a 2 for the second fspfit menu.

Page FSPFIT2 (Input data)

 

 1 Input data file name                    CZTCASE9.SP

 2 Beginning and ending channels for fit   1,DEF

 3 Input peak file to start fitting from   CZTCASE9.PK

 4 NO use x,w only, YES use strength also  YES

 5 Input background constants file         CZTCASE9.CN

 6 Backgr=exp(spline)<YES>, spline <NO>    YES

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

The file name on line 1 needs to be changed to ZTCASE1.SP.  We wish to start with no existing pk or cn files, and thus lines 3 and 5 need to be made NONE.

Page FSPFIT2 (Input data)

 

 1 Input data file name                    ZTCASE1.SP

 2 Beginning and ending channels for fit   1,DEF

 3 Input peak file to start fitting from   NONE

 4 NO use x,w only, YES use strength also  YES

 5 Input background constants file         NONE

 6 Backgr=exp(spline)<YES>, spline <NO>    YES

Go to page 3

Page FSPFIT3 (Output data)

 

 1 Output file for background constants    CZTCASE9.CN

 2 Output file for peak data               CZTCASE9.PK

 3 Output file for graph data              CZTCASE9.GR

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

Change all output names to the corresponding ztcase1 names.

Page FSPFIT3 (Output data)

 

 1 Output file for background constants    ZTCASE1.CN

 2 Output file for peak data               ZTCASE1.PK

 3 Output file for graph data              ZTCASE1.GR

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

Go to page 4

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     CZ9LE.ST

 2 LOW W,ERR,CHANNEL                       3.509,.5,474

 3 HIGH W,ERR,CHANNEL                      4.969,.4,2986

 4 GENERAL PURPOSE BUMP                    CZ9HE.ST

 5 LOW W,ERR,CHANNEL                       3.509,.5,474

 6 HIGH W,ERR,CHANNEL                      4.969,.4,2986

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

These standards were set up for the test case.  There can be 5 of them.  This is what stgen can make.  There is a Gauss.st that is the usually desired standard.  Eliminate the last 3 line by entering

>4,&D

three times.  The change line 1 to GAUSS.ST

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     GAUSS.ST

 2 LOW W,ERR,CHANNEL                       3.509,.5,474

 3 HIGH W,ERR,CHANNEL                      4.969,.4,2986

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

Now <cr> to main menu and <cr> to run

AT END OF MINIMIZATION   0 PEAKS, CHIS         .103958E+05

HELLO JUST OPENNED..\tcases\ZTCASE1.GR

 

 

   0 PEAKS 1000 CHAN, CHIS=   .1040E+05 NITB=    4    4

CUTOFF=  20.00

FWHM --- XLH=   -.4997758E+00 XUH=    .5002242E+00 AI=    .1067414E+01

Stop - Program terminated.

The 20 was a bit high.  The background was fiited with no peaks.  .. note that the file ZTCASE1.GR was created.  Continue.  Enter a 3 and select FSPDIS.

Page FSPDIS

 

 1 Information on the spectral fit display

 2 Viewing information for the display

 ENTER MENU #, <CR> TO RUN, S TO STOP, O FOR MORE OPTIONS

Go to 1

Page FSPDIS1 (General information)

 

 1 Name of the graphical file to be read   CZTCASE9.GR

 2 Name of the calibration file (.XDA)     CZTCASE9.XDA

 3 Beg/end channels (energy with XDA set)  0,200

 4 Vertical axis = COUNTS * SCALE FACTOR   1

 5 Desired min and max Y scale             1,DEF

 6 Log or linear Y scale                   LOG

 7 color (YES=ON,NO=off)                   YES

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

The fist line needs to be changed to ZTCASE1.GR – note that this was just created a couple of steps above.  The XDA file is created by XCALIBER. Replace this by none.

Page FSPDIS1 (General information)

 

 1 Name of the graphical file to be read   ZTCASE1.GR

 2 Name of the calibration file (.XDA)     NONE

 3 Beg/end channels (energy with XDA set)  1,DEF

 4 Vertical axis = COUNTS * SCALE FACTOR   1

 5 Desired min and max Y scale             1,DEF

 6 Log or linear Y scale                   LOG

 7 color (YES=ON,NO=off)                   YES

<cr> to the main menu and go to 2 to see a host of views.  These should be OK

As predicted – no peak.  Make the cutoff on the fspfit page 1 5,5,1 to produce

           This time there is a peak.  Note that the chi-square has dropped.  A “perfect” fit would be N +- (2N)^0.5.  The file ztcase1.pk is

 FIT TO ..\tcases\ZTCASE1.SP                                           

 IP=    1

    1 PEAKS 1000 CHAN, CHIS=   1060.     NITB=    4    4

 CUTOFF=   5.00

  1.0674  1.0000

   850.038    .234     47.060    .436   10103.3       112.6      1

 

the columns are channel, error, fwhm, error , area, error, and finally peak type.

                The next game is to make a doublet out of this apparent singlet.  Go to the standards page of FSPFIT. 

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     GAUSS.ST

 2 LOW W,ERR,CHANNEL                       3.509,.5,474

 3 HIGH W,ERR,CHANNEL                      4.969,.4,2986

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

The fwhm was specified as 3.5 to 4.9 channels, but came out 47.  Cut the standard deviation by a factor of 10.

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     GAUSS.ST

 2 LOW W,ERR,CHANNEL                       3.5,.05,474

 3 HIGH W,ERR,CHANNEL                      4.9,.04,1000

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

This tells the code that you are really serious and do want the numbers to be used as indicated.  The peak file is now

 FIT TO ..\tcases\ZTCASE1.SP                                            

 IP=    1

    5 PEAKS 1000 CHAN, CHIS=   4661.     NITB=    4    4

 CUTOFF=   5.00

  1.0674  1.0000

   833.033    .705      4.663    .316   934.745       238.7      1

   841.989    .599      4.721    .316   1346.63       288.6      1

   849.868    .601      4.721    .316   1399.64       296.2      1

   857.768    .624      4.725    .315   1289.47       284.2      1

   865.670    .695      4.728    .313   1010.99       249.3      1

    This is probably not what you wanted.  Set the fwhm to 20

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     GAUSS.ST

 2 LOW W,ERR,CHANNEL                       20,.05,474

 3 HIGH W,ERR,CHANNEL                      20,.05,1000

           Now I have a peak file.

 FIT TO ..\tcases\ZTCASE1.SP                                           

 IP=    1

    3 PEAKS 1000 CHAN, CHIS=   1405.     NITB=    4    4

 CUTOFF=   5.00

  1.0674  1.0000

   828.569    .631     20.032    .094   2461.76       141.6      1

   850.192    .543     20.036    .094   4741.31       169.6      1

   872.163    .645     20.038    .094   2347.96       135.0      1

Enter the peak file on the input page

Page FSPFIT2 (Input data)

 

 1 Input data file name                    ZTCASE1.SP

 2 Beginning and ending channels for fit   1,DEF

 3 Input peak file to start fitting from   ZTCASE1.PK

 4 NO use x,w only, YES use strength also  YES

 5 Input background constants file         NONE

 6 Backgr=exp(spline)<YES>, spline <NO>    YES

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

And increase the error estimate on the peaks.

Page FSPFIT4 (Standards data)

 

 1 LOW ENERGY STANDARD                     GAUSS.ST

 2 LOW W,ERR,CHANNEL                       20,1,500

 3 HIGH W,ERR,CHANNEL                      20,1,1000

ENTER LINE NUMBER TO CHANGE A LINE

 <CR> TO RETURN TO THE MAIN MENU; LN # OR

  LN #,VAR TO CHANGE A LINE; LN #,&D TO DELETE A LINE;

  OR LN #,&A TO ADD A COMPLETE NEW LINE

This finally produces a triplet in ztcase1

 FIT TO ..\tcases\ZTCASE1.SP                                           

 IP=    1

    3 PEAKS 1000 CHAN, CHIS=   1058.     NITB=    4    4

 CUTOFF=   5.00

  1.0674  1.0000

   838.571  10.401     41.285   5.920   3847.10       4442.      1

   848.310   3.128     20.022   1.120   454.863       319.4      1

   857.827   8.331     43.183   4.432   5802.59       4385.      1

Note that the middle peak is just barely supported by the data, while the outer two are reasonable.



[1] Springer Verlag bought the book rights from AIP.

[2] As mentioned above, this is now most easily done using winzip with the use folder names option.