sddsslopes makes straight line fits of column data
of the input file with respect to a selected column used as independent variable.
The output file contains a one-row data set of slopes and intercepts
for each data set of the input file.
Errors on the slope and intercept may be
calculated as an option.
The file corrector.sdds below contains beam position monitors (bpms) readbacks as a
function of corrector
setting. The defined columns are CorrectorSetpoint and the series
bpm1, bpm2, etc.
The bpm response to the corrector setpoints are calculated with the use of
sddsslopes corrector.sdds corrector.slopes -independentVariable=CorrectorSetpoint
where all columns that match with the wildcard expression
bpm* is selected
sddsslopes [-pipe=[input][,output]] inputFile outputFile
[-sigma[=generate]] [-residual=file] [-ascii] [-verbose]
The input file contains the tabular data for fitting. Multiple
data sets are processed one at a time.
For optional error processing, additional columns of sigma values
associated with the data to be fitted must be present. These sigma column
must be named nameSigma or Sigmaname,
the former one being searched first.
The output file contains a one-row data set for each data set in the
input file. The columns defined have names
such as nameSlope, and nameIntercept where name is the name of
the fitted data. If only one file is specified, then the input file is
overwritten by the output.
A string column called
IndenpendentVariable is defined containing the name of the indepedent variable.
- -pipe[=input][,output] -- The standard SDDS Toolkit pipe option.
-- name of independent variable (default is the first valid column).
- -range=lower,upper -- The range of the independent
variable where the fit is calculated. By default, all data points are used.
-- columns to be individually paired with independentVariable
for straight line fitting.
- -excludeColumns=listOfNames -- columns to exclude from fitting.
-- calculates errors by interpreting column names
nameSigma or Sigmaname as
sigma of column name. If these columns don't exist
then the program generates a common sigma from the residual of a first fit,
and refits with these sigmas. If option -sigma=generate is given,
then sigmas are generated from the residual of a first fit for all columns,
irrespective of the presence of columns nameSigma or Sigmaname.
- -residual=file -- Specifies an output file into which the
residual of the fits are written. The column names in the residual file
are the same as they appear in the input file.
- -ascii -- make output file in ascii mode (binary is the default).
- -verbose -- prints some output to stderr.
- author: L. Emery ANL