[ Basic Info | References | User Guide ]
Basic Information on rmsfit
Task: rmsfit
Purpose: Non-linear Least Squares Fitting
Categories: misc, utility
RMSFIT is a task that fits one of the following functions
with up to 6 parameters (a,b,c,..) to a table of values.
The first three functions use fixed column numbers:
1. Phase Structure Function.
z = a * x**b * sin(y)**c + d
For the task ATMOS. x, y and z are in column 5, 6 and 8 resp.
2. z = a * x**b + c * y
x, y, and z in column 5, 4, and 8
3. z = a * x**2 + b * x + c
x, z in column 1 and 2 respectively.
The column numbers must be specified for following functions:
Lines that begin with '#' are ignored. Giberish can appear in
unused columns. Columns are separated by blanks.
The maximum line length is 320 characters.
Column numbers for x, y, and z specified below.
4. z = a * x**b + c
5. z = a + b * x + c * x**2 + d * x**3
6. Comet model radial profile of surface density (brightness)
z = a/x * integral{exp[-x/b sec(theta)]} theta= -pi/2 to pi/2
7. Atmospheric opacity:
z = a + b*(1-exp(-c*x)) ! Tb = Trx + Tsky(1-exp(-airmass*tau0))
8. Drift scan analysis
z = a * (exp(-b*(x-c)**2) - exp(-b*(x-d)**2))
9. Primary beam pattern polynomial fit.
z = 1 + a1*x**2 + a2*x**4 + ... "x" is in units of arcmin*GHz.
10. Primary beam pattern inverse polynomial fit.
z = 1/(1 + a1*x**2 + a2*x**4 + ... ) "x" is in units of arcmin*GHz
11. Primary beam pattern cos**6 fit.
z = a1*cos(x)**6 "x" is in units of arcmin*GHz.
12. line length fit:
z = a1*cos(2pi*a2*x + a3) "x" is in MHz, a1 is amplitude,
a2 is the line length in microsec, and a3 is the phase offset.
Key: opt
specifies which function is to be fitted. Default opt=1.
Key: col
column numbers for x, y, z variables. Three values. Default=0,0,0
Setting a column number = 0, sets the corresponding variable=1,
and modifies the equation accordingly.
Key: in
Input ascii file with columns of data. No default.
Key: npts
Select the first ``npts'' from the input file.
Default reads the whole file or 2000 which is the maximum allowed.
Key: par
Initial estimates for parameters (a,b,c,..).
An initial guess must be specified for each parameter used.
Default=0,0,0,0,0,0 may not be a good starting guess.
Key: nfit
Number of paramters to fit. Counts from a,b,c,d onwards,
e.g. nfit=3 would only fit a,b,c and leave d fixed.
Default: 2
Key: log
Output logfile. It will contain the results, a histogram
with residuals and all selected measurements, the fit, and residuals.
Default: print results and histogram only to terminal.