Interpol. Peak Infle. Point

Category: Fit/Interpolate/Extrapolate
Author:
Description: A function to fit a 2nd order polynomial to the three points of a peak (pre maximum, maximum and post maximum) and return the position of the maximum (or minimum). Values entered are the x1, x2, x3 coordinates and their corresponding values f1, f2, f3. The position of the maximum (or minimum) and its value are passed into the function as references to xmax and fmax respectively. Use this function to interpolate peak positions with sub-pixel precision.
Comments: There is a limitation (or conflict) in User Defined Language with DM script. The operation "/" and "*" cannot be defined as operators in Notepad++ once we define "/*" and "*/" as comment block markers. So I have left "/" and "*" out from the operator list
Acknowledgements: Thanks to Bill Bertram of ANSTO for assistance with algorithm development.
Script version: 1.0
DM/GMS version: 3.11
Script written as a function: Yes
Source: Show code
Download Source Code: Download
Download Zip File: Download