%This is revised from motcorrfinal-05/01/06 for Knorr 2006 cruise %B means bow mount and S means stern mount Braccx=datalogdata(:,5); Braccy=datalogdata(:,6); Braccz=datalogdata(:,7); Brangx=datalogdata(:,2); Brangy=datalogdata(:,3); Brangz=datalogdata(:,4); Sraccx=datalogdata(:,17); Sraccy=datalogdata(:,18); Sraccz=datalogdata(:,19); Srangx=datalogdata(:,14); Srangy=datalogdata(:,15); Srangz=datalogdata(:,16); %looks like the x direction was wired incorrectly so that the polarity was %flipped (both x and y should have minus signs but now only y gets a minus) BrawU=1*datalogdata(:,8);%had a -1 multiplier from wecoma workup (maybe reversed polarity) BrawV=-1*datalogdata(:,9);%had a -1 multiplier from wecoma workup (maybe reversed polarity) BrawW=datalogdata(:,10); SrawU=datalogdata(:,20);%had a -1 multiplier from wecoma workup (maybe reversed polarity) SrawV=datalogdata(:,21);%had a -1 multiplier from wecoma workup (maybe reversed polarity) SrawW=datalogdata(:,22); g=9.8; %gravity sf=50; %sampling frequency in Hz %column 1 is B and colunm 2 is S % B coordinate system is pos x toward stern, pos y toward the left when facing bow (port), pos z is up % S coordinate system is pos x toward bow, pos y toward the right when % facing bow (starboard, pos z is up; Overall coordinate system is pos x % toward bow and pos y toward port, pos z up % angles converted to radians %convert volts to appropriate units, need to check against scott's accx(:,1)=((Braccx./6.02).*g).*-1;%this is reversed from it's bow orientation accx(:,2)=((Sraccx./6.02).*g); accy(:,1)=((Braccy./6.02).*g).*1; accy(:,2)=((Sraccy./6.02).*g).*-1;%this is reversed from it's stern orientation accz(:,1)=(((Braccz-2.5)/1.2).*g).*1; accz(:,2)=(((Sraccz-2.5)/1.2).*g).*1; angx(:,1)=-1*((Brangx.*7.50).*((2*pi)/360));%this is reversed from it's bow orientation angx(:,2)=((Srangx.*7.50).*((2*pi)/360)); angy(:,1)=-1*((Brangy.*7.50).*((2*pi)/360));%seems like the polarity is reversed as a result of miswiring angy(:,2)=-1*((Srangy.*7.50).*((2*pi)/360));%this is reversed from it's stern orientation angz(:,1)=1*(Brangz.*7.50).*((2*pi)/360); angz(:,2)=1*(Srangz.*7.50).*((2*pi)/360); heading=shhead.*((2*pi)/360); %remove the mean (drift) heading=1*(heading-mean(heading));%was -1, changed to see if it effects the correction angx(:,1)=angx(:,1)-mean(angx(:,1)); angx(:,2)=angx(:,2)-mean(angx(:,2)); angy(:,1)=angy(:,1)-mean(angy(:,1)); angy(:,2)=angy(:,2)-mean(angy(:,2)); angz(:,1)=angz(:,1)-mean(angz(:,1)); angz(:,2)=angz(:,2)-mean(angz(:,2));