linfitFromFile
Return to directory of Todd's CASA extensions
Performs linear fit to data from the specified text file, and specified data columns, by using
linfit.
Usage:
au.linfitFromFile(self, filename, xcol, ycol, yerrorcol=None, pinit=[0,0],
plot=False, plotfile=None, xlabel=None, ylabel=None,
title=None,delimiter=None, residual=False):
Inputs:
- xcol, ycol: columns to use from the file (starting at 0)
- yerrorcol: column to use for uncertainties (None -> 1% of ycol)
- pinit: contains the initial guess of [slope, intercept]
- plot: whether to generate a plot window
- plotfile: whether to generate a png file
- xlabel, ylabel, title: labels for the plot
- delimiter: column delimitier in your file
- residual: if True, show the residual of the fit in second panel
Example:
CASA <3>: au.linfit().linfitFromFile('yig.data',xcol=0,ycol=2,xlabel='Frequency (GHz)',
ylabel='Encoder counts',plot=True,plotfile='yigTuningCurve.png',
title='MLXM-0818 YIG with FM coil target bias = 1.1V',residual=True)
--
ToddHunter - 2014-01-15