Home > pointing > do_fit.m

do_fit

PURPOSE ^

[fm,sa,gof]=do_fit(pars,freepars,obs,ide)

SYNOPSIS ^

function [fm,sa,gof]=do_fit(pars,freepars,obs,ide, xerrs, yerrs)

DESCRIPTION ^

 [fm,sa,gof]=do_fit(pars,freepars,obs,ide)

 Fit a set of points to the model
 Provide the space angle errors as extra out arg

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [fm,sa,gof]=do_fit(pars,freepars,obs,ide, xerrs, yerrs)
0002 % [fm,sa,gof]=do_fit(pars,freepars,obs,ide)
0003 %
0004 % Fit a set of points to the model
0005 % Provide the space angle errors as extra out arg
0006 
0007 %[fm,fme,gof,stat]=matmin('gof_spaceangle',pars,freepars,'pointing_model',obs.az,obs.el,ide.az,ide.el,xerrs,yerrs);
0008 
0009 if(nargin==4)
0010   xerrs = ones(size(obs.az));
0011   yerrs = xerrs;
0012 end
0013 
0014 ind=isnan(obs.az)|isnan(obs.el);
0015 obs.el=obs.el(~ind);
0016 obs.az=obs.az(~ind);
0017 ide.el=ide.el(~ind);
0018 ide.az=ide.az(~ind);
0019 xerrs=xerrs(~ind);
0020 yerrs=yerrs(~ind);
0021 
0022 [fm,fme,gof,stat]=matmin('gof_pt_mod',pars,freepars,'pointing_model',obs.az,obs.el,ide.az,ide.el,xerrs,yerrs);
0023 
0024 % Find the model values
0025 [mva.az,mva.el]=pointing_model(fm,ide.az,ide.el);
0026 
0027 % Find the space angles between observed and model values
0028 sa=spaceangle(obs.az,obs.el,mva.az,mva.el,'deg');
0029 
0030 return

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