sddsgfit

**description:**`sddsgfit`does gaussian fits to a single column of an SDDS file as a function of another column (the independent variable). The fitting function is

where x is the independent variable, B is the baseline, H is the height, is the mean, and is the width.**examples:**Fit a gaussian to a beam profile to get the rms beam size:`sddsgfit beamProfile.sdds beamProfile.gfit -column=x,Intensity`**synopsis:**`sddsgfit [-pipe=[input][,output]] [`*inputFile*] [*outputFile*] -columns=*x-name*,*y-name*[,*sy-name*] [-fitRange=*lower*,*upper*] [-fullOutput] [-guesses=[baseline=*value*][,mean=*value*][,height=*value*][,sigma=*value*]] [-fixValue=[baseline=*value*][,mean=*value*][,height=*value*][,sigma=*value*]] [-stepSize=*factor*] [-tolerance=*value*] [-limits=[evaluations=*number*][,passes=*number*] [-verbosity=*integer*]**files:***inputFile*contains the columns of data to be fit. If*inputFile*contains multiple pages, each page of data is fit separately.*outputFile*has columns containing the independent variable data and the corresponding values of the fit. The name of the latter column is constructed by appending the string`Fit`to the name of the dependent variable. In addition, if`-fullOutput`is given, it includes a column with the dependent values and the residual (dependent values minus fit values). The name of the residual column is constructed by appending the string`Residual`to the name of the dependent variable.*outputFile*contains five parameters:`gfitBaseline`,`gfitHeight`,`gfitMean`,`gfitSigma`, and`gfitRmsResidual`. The first four parameters are respectively B, H, , and from the equation above. The last is the rms residual of the fit.**switches:**`-pipe=[input][,output]`-- The standard SDDS Toolkit pipe option.`-columns=`-- Specifies the names of the independent and dependent columns of data.*x-name*,*y-name*`-fitRange=`-- Specifies the range of independent variable values to use in the fit.*lower*,*upper*`-guesses=[baseline=`-- Gives*value*][,mean=*value*][,height=*value*][,sigma=*value*]`sddsgfit`a starting point for one or more parameters.`-fixValue=[baseline=`-- Gives*value*][,mean=*value*][,height=*value*][,sigma=*value*]`sddsgfit`a fixed value for one or more parameters. If given, then`sddsgfit`will not attempt to fit the parameters in question.`-stepSize=`-- Specifies the starting stepsize for optimization as a fraction of the starting values. The default is 0.01.*factor*`-tolerance=`-- Specifies how close*value*`sddsgfit`will attempt to come to the optimum fit, in terms of the mean squared residual. The default is .`-limits=[evaluations=`-- Specifies limits on how many fit function evaluations and how many minimization passes will be done in the fitting. The defaults are 5000 and 100, respectively. If the fit is not converging, try increasing one or both of these. If the number of evaluations is too small, you may get warning messages about optimization failures.*number*][,passes=*number*`-fullOutput`-- Specifies that*outputFile*will contain the original dependent variable data and the fit residuals, in addition to the independent variable data and the fit values.`-verbosity=`-- Specifies that informational printouts are desired during fitting. A larger integer produces more output.*integer*

**see also:**- sddspfit
`sddspfit`()sddspfit - sddsexpfit
`sddsexpfit`()sddsexpfit - sddsoutlier
`sddsoutlier`()sddsoutlier

- sddspfit
**author:**M. Borland, ANL/APS.