Home > Angelas_Raster_Code > fit_gauss.m

fit_gauss

PURPOSE ^

Fits a gaussian to the beam maps using data < 1deg (ie not including 1st

SYNOPSIS ^

function [best_fit ] = fit_gauss(x,y,we)

DESCRIPTION ^

 Fits a gaussian to the beam maps using data < 1deg (ie not including 1st
 sidelobe)
 Option to use weights in fit if available.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [best_fit ] = fit_gauss(x,y,we)
0002 
0003 % Fits a gaussian to the beam maps using data < 1deg (ie not including 1st
0004 % sidelobe)
0005 % Option to use weights in fit if available.
0006 
0007 
0008 f = fittype('gauss1');
0009 options = fitoptions('gauss1');
0010 
0011 if(nargin==3)
0012    options.Weights = we;
0013 end
0014 
0015 best_fit = fit(x,y,f,options);
0016 
0017 %mainbeam = excludedata(x,y,'range',[-10 10]);
0018 %options = fitoptions;
0019 %options.Weights = we;
0020 %options.Normalize = 'on';
0021 %options.Exclude = mainbeam;
0022 %best_fit_exclude = fit(x,y,f,options);
0023

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005