home *** CD-ROM | disk | FTP | other *** search
- The following are brief descriptions of the programs on this disk
- and also instructions for using them. The program named PLTSPEC
- is probably most useful to nuclear engineers, health physicists,
- or enviromental engineers who are working with scattered photon
- energy spectrums or similar spectra with broad asymmetric peaks
- on a sloping background. The purpose of this program is not to
- perform automatic peak-search and identification, however, this
- feature can probably be added without having to change any of the
- existing code.
-
- The set of assembly language routines are some that I've found
- usefu∞ fo≥ interfacinτ witΦ DO╙ froφ insidσ FORTRAN« Routine≤
- fo≥ gettinτ thσ date¼ time¼ anΣ day-of-the-weeδ are in
- DAT-TIME.ASM. Routines for polling the keyboard, retrieving
- keystrokes without echoing to the screen, and access to other
- DOS functions are in DOSFN.ASM and DOSFUNC.FOR. DIR_ASM.ASM
- is a routine which lists to the console the names of the files
- in the current directory. I apologize for not writing routines
- for IN, OUT, PEEK, and POKE.... perhaps next time.
-
- Dave Bodette
- Gainesville, Florida
-
- PROGRAM PLTSPEC.FOR
-
- This program was written to interactively process gamma-ray
- energy spectrums but is useful in any application where you
- need to find the area under a peak, remove the background,
- fix lost/erroneous data points, or want to produce graphs
- with labels.
-
- The program is written in MS-FORTRAN and uses the MULTI-HALO
- graphics library extensively. I've not used any other graphics
- libraries, but it seems that MULTI-HALO provides a level of
- portability between systems with different graphics boards that
- the other libraries don't. Without having to recompile and link,
- the same program will work with a Hercules or IBM graphics card and
- can take full advantage of the higher resolution modes of the
- Hercules card.
-
- To run PLTSPEC you will need to compile
-
- PLTSPEC MANSPT EDITS PLOT1 PLOT2
-
- and then link these routines with HALODVXX, DOSFN and DOSFUNC and
- the HALOF library. The link sequence is given in the comments of
- PLTSPEC. Now you should have an executable version of PLTSPEC.
-
- When PLTSPEC is first run you are presented with a menu of functions.
- Simply typing the letter of the first word describing each function
- chooses that menu item. The first item to choose is "Read in a
- spectrum" by pressing 'R'. You will then be asked the IDentification
- number of the spectrum to read in -- you are able to have upto 10
- spectrums at a time -- enter a number between 1 and 10. The next
- question asks for the name of the file - enter the file name. The
- program will then read in the data and return you to the main menu.
-
- Once you have read in the data the next step is to "Set the plot
- limits". The plotting limits can be determined from the data itself
- or you can enter the numeric values yourself. Finally, the data is
- able to be plotted to the screen (just choose the "Plot spectrum"
- item from the menu).
-
- This should be enough information to get you started. Descriptions
- of the commands to label, determine peak area, etc. are below
-
- SUBROUTINE MANSPT.FOR
-
- The following functions can be performed by this subroutine:
-
- *fit the spectrum background to a 2nd order curve
-
- commands- B begin fit at current cursor position
- L set current cursor position as the left
- side of the peak.
- R set current cursor position as the right
- side of the peak.
- E end fit at current cursor position.
- C compute a polynomial fit to the data between
- the points B-L and R-E. The data between L and
- R are not used.
- X remove the background from the data between
- the points B and E and display the
- corrected data.
- O overlay the background curve between the
- points B and E.
- A compute the area between the points L and R
- taking into account the background curve
- fit. (Function X does not have to have been
- done for this to work, however, function C
- must have been performed.)
-
- The data points between B and E (except those points between
- L and R) are fitted to a 2nd order polynomial
- y= AA*X**2 + BB*X + CC
- using a weighted least squares routine. The weighting is
- just 1/(square root of the counts). NOTE: the fit will fail
- unless B is less than L is less than R is less than E (i.e.
- going from left to right on the screen press BLRE).
-
- *start over with the original data
- command- '-' pressing this key erases everything and
- starts over.
-
- *exit the subroutine
- commands- Q quits and returns to main program as if
- nothing had been done to the data.
- F finish manipulating the data and display-
- returns to the main program with the screen
- image intact and with any changes made to the
- data (e.g. background corrected, etc.).
-
- *obtain printer output
- command- G dump screen image to printer
-
-
- *write the data to a disk file
- command- W you will be prompted for a file name.
-
- *place labels on the screen image
- commands-
- T first key to push. you will be prompted
- for the text of the label. NOTE the first and
- last charachters must be unique:
-
- \peak area = 19654 counts\
- !the exclamation points are unique!
-
-
- 8 move up | When the NumLck key
- 9 move up fast | is lit on the IBM
- 6 move right | keyboard this key
- + move right fast | arrangement really
- 2 move down | does make some
- 3 move down fast | sense
- 4 move left |
- <RETURN> move left fast |
-
- L display the label starting at cursor position.
- E erase the label. If the label is not displayed
- the results are unpredictable.
- Z allows you to change the height, width, writing
- direction(path), and writing mode.
- height and width can be 1,2,3 but not 1.5,2.3
- direction 0 horizontal
- 1 at 90 deg to horizontal
- 2 upside down and backwards
- 3 at 270 deg to horizontal
- mode 0 or 1 unboxed or boxed.
- Q quit the labeling routine.
-
-
- SUBROUTINE EDITS.FOR
-
- An interactive visual editor for changing the y values
- of the data by simply moving a cursor around.
-
-
- The following functions can be performed by this subroutine:
-
-
- *start over with the original data
- command- '-' pressing this key erases everything and
- starts over.
-
- *exit the subroutine
- commands- Q quits and returns to main program as if
- nothing had been done to the data.
- F finish manipulating the data and display-
- returns to the main program with the screen
- image intact and with any changes made to the
- data (e.g. background corrected, etc.).
-
- *obtain printer output
- command- G dump screen image to printer
-
-
- *write the data to a disk file
- command- W you will be prompted for a file name.
-
- *change y values of points on the screen image
- commands- E key to push so you will be able to change
- the y position and value of the point at the
- current cursor position.
-
- 8 move up | With the NumLck key
- 9 move up fast | is lit on the IBM
- 6 move right | keyboard this key
- + move right fast| arrangement really
- 2 move down | does make some
- 3 move down fast | sense
- 4 move left |
- <RETURN> move left fast |
-
- Q quit editing this point.
-
- SUBROUTINES PLOT1.FOR AND PLOT2.FOR
-
- Copies the screen image to an IDS Microprism printer.
- Must be in HALO graphics mode to call this routine.
- Image is IXMX x IYMX (usually 640x200) pixels.
- Thσ heigh⌠ oµ thσ printeΣ cop∙ appear≤ abou⌠ 1/▓ a≤ higΦ ì
- a≤ thσ screeε image but does not have the "fat" lines
- whicΦ thσ HAL╧ routinσ give≤ t∩ thσ image« Usσ "PLOT2ó iµ ì
- yo⌡ wan⌠ thσ printeΣ cop∙ t∩ havσ thσ samσ aspec⌠ rati∩ a≤ ì
- thσ vide∩ screen.
-
- PLOT2 is a similar graphics dump routine as "PLOT1" except
- the printer image is twice as high. Every other line of
- pixels on the printer is blank. This can be changed
- so that each horizontal line of pixels is printed
- twice. The effect of this is to make a 640x200 image
- into a 640hx400v image.
-
- PROGRAM EFFIXSP.FOR
-
- The purpose of this program is to correct the spectrum for
- the detector efficiency variation as a function of energy.
- The bulk of this program is just a slightly modified version
- of PLTSPEC.FOR. The following three functional forms for the
- detector efficiency as a function of energy can be chosen from
-
- 2
- 1) eff = A*E + B*E + C
-
- 2
- 2) ln(eff)= A*E + B*E + C
-
- 3) ln(eff)= A*ln(E) + C
-
- where E is the energy variable and A, B, & C, are the fitting
- constants which you must provide.