function do_tapad_full(igo,istep)
%function do_tapad_full(igo,istep)
%run tapad with full data
%run as a function to make it easier to spread computation over several
%machines.
%Note: this version assumes that tapad will be run in recursive mode
%with a kalman version providing the start positions


basepath=pwd;
%subdirectory where amps are stored, and where the calculated positions
%will be stored.
%Setting will probably be 'ampsfiltadj1', assuming full tapad is not run
%until amplitude adjustments have been sorted out
firstpath='ampsfiltadj1';

%This will need adjusting if some other source of recursive input is used
%(and on details of amplitude adjustment etc.)
kalmanamps='adj1k';
kalmansubdir='kalmanus';
recursivestartfile=[basepath pathchar 'ampsfilt' kalmanamps pathchar kalmansubdir pathchar 'rawposm'];

%name of the output path reflects the source of the position data for
%recursive input
outpath=[firstpath pathchar 'recurse' kalmanamps kalmansubdir pathchar 'rawpos'];
mkdir([outpath pathchar 'posamps']);
%just for reference, include a comment line here with the names of the
%sensors

%Normal list of channels to process is 1:12, but eliminate any channels
%from the list that are not in use (or unusable)
chanlist=[1:12];

%
triallist=[igo:istep:??];	%list of trials to process

%The first switch chooses the Levenberg-Marquardt version of the nonlinear
%optimization procedure (just as for tapad_ds runs).
%The second switch specifies recursive input (start positions provided by
%existing position data

myoptions='-l-r';


	outstats=tapad_ph_rs(basepath,[firstpath pathchar 'amps'],outpath,triallist,chanlist,myoptions,recursivestartfile);


%This stores a small mat file with a few statistics on each trial.
%Currently for maintenance purposes only
%Uncomment if required
%save(['tapadstats_' firstpath '_' int2str(triallist(1)) '_' int2str(triallist(end))],'outstats');

