%Readme for Calwater motion data on the RHB
% 08/30/2019 - LB
%  test=load('Z:\CALWATER_2015\RHB\flux\Processed_v4\motion_decorr\motion_RHB_Calwater2015_doy027.txt');
% 1) time (S)
% 2) x platform velocity (m/s)
% 3) y platform velocity (m/s)
% 4) z platform velocity (m/s)
% 5) x platform displacement (m)
% 6) y platform displacement (m)
% 7) z platform displacement (m)
% 8) roll (rad)
% 9) pitch (rad)
% 10) yaw (rad)

% x axis is defined as positive towards the bow
% y axis is defined as positive towards the portside
% z axis is defined as positive upward
%  
for doy = [16:28 30:41]
    test=load(['Z:\CALWATER_2015\RHB\flux\Processed_v4\motion_decorr\motion_RHB_Calwater2015_doy' sprintf('%03i',doy) '.txt']);
    figure;
    subplot(3,3,1);plot(test(:,1),test(:,2));title('x velocity (m/s)');grid;
    subplot(3,3,2);plot(test(:,1),test(:,3));title('y velocity (m/s)');grid;
    subplot(3,3,3);plot(test(:,1),test(:,4));title('z velocity (m/s)') ;grid;
    subplot(3,3,4);plot(test(:,1),test(:,5));title('x displacement (m)');grid;
    subplot(3,3,5);plot(test(:,1),test(:,6));title('y displacement (m)');grid;
    subplot(3,3,6);plot(test(:,1),test(:,7));title('z displacement (m)')  ;grid; 
    subplot(3,3,7);plot(test(:,1),rad2deg(test(:,8)));title('roll (deg)');grid;
    subplot(3,3,8);plot(test(:,1),rad2deg(test(:,9)));title('pitch (deg)');grid;xlabel('DOY (2015)')
    subplot(3,3,9);plot(test(:,1),rad2deg(test(:,10)));title('yaw (deg)');grid;
    print('-dpng',['Z:\CALWATER_2015\RHB\flux\Processed_v4\motion_decorr\motion_RHB_Calwater2015_doy' sprintf('%03i',doy) '.png']);
end
% 
%  for doy = 30:41
%     test=load(['Z:\CALWATER_2015\RHB\flux\Processed_v4\motion_decorr\motion_RHB_Calwater2015_doy' sprintf('%03i',doy) '.txt']);
%     
%     figure(1);
%     subplot(3,1,1);plot(test(:,1),test(:,2),'b');hold on;title('x platform velocity (m/s)');grid;
%     subplot(3,1,2);plot(test(:,1),test(:,3),'b');hold on;title('y platform velocity (m/s)');grid;
%     subplot(3,1,3);plot(test(:,1),test(:,4),'b');hold on;title('z platform velocity (m/s)');grid;
%     
%     figure(2);
%     subplot(3,1,1);plot(test(:,1),test(:,5),'b');hold on;title('x platform displacement (m)');grid;
%     subplot(3,1,2);plot(test(:,1),test(:,6),'b');hold on;title('y platform displacement (m)');grid;
%     subplot(3,1,3);plot(test(:,1),test(:,7),'b');hold on;title('z platform displacement (m)');grid;
%     
%     figure(3);
%     subplot(3,1,1);plot(test(:,1),rad2deg(test(:,8)),'b');hold on;title('roll (deg)');grid;
%     subplot(3,1,2);plot(test(:,1),rad2deg(test(:,9)),'b');hold on;title('pitch (deg)');grid;
%     subplot(3,1,3);plot(test(:,1),rad2deg(test(:,10)),'b');hold on;title('yaw (deg)');grid;
%  end   