Home > pointing > do_fit_opt.m

do_fit_opt

PURPOSE ^

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

SYNOPSIS ^

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

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_opt(pars,freepars,obs,ide)
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 freepars = double(freepars);
0007 ind=isnan(obs.az)|isnan(obs.el);
0008 obs.el=obs.el(~ind);
0009 obs.az=obs.az(~ind);
0010 ide.el=ide.el(~ind);
0011 ide.az=ide.az(~ind);
0012 
0013 [fm,fme,gof,stat]=matmin('gof_spaceangle',pars,freepars,'pointing_model',obs.az,obs.el,ide.az,ide.el);
0014 
0015 % Find the model values
0016 [mva.az,mva.el]=pointing_model(fm,ide.az,ide.el);
0017 
0018 
0019 % Find the space angles between observed and model values
0020 sa=spaceangle(obs.az,obs.el,mva.az,mva.el,'deg');
0021 
0022 return

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