% This plots the depth rate as computed by the derivative of depth, agains the DVL measured
% depth rate.

% Make plot of various parameters as a function of time...

figure;
subplot(3,1,1); 

plot(time, d_rate, 'r.');
hold on; 
plot(time, data(:, m_rdi_z).* cos(data(:, m_pitch)) - data(:, m_rdi_y).* sin(data(:, m_pitch)), 'bx'); 
ylabel( 'Depth rate (m/s)');
zoom on;

subplot(3,1,2); 
plot(time, data(:, m_depth));
ylabel( 'Depth(m)');
set( gca, 'YDir', 'rev' );
zoom on;

subplot(3,1,3); 
hold on;
plot(time, data(:, m_rdi_x), 'r.'); 
plot(time, data(:, m_rdi_y), 'g.');
plot(time, data(:, m_rdi_z), 'b.');
hold off;
ylabel( 'DVL Velocities (m/s)');
xlabel( 'Time (s))' )
zoom on;

% Make depth versus parameters...

figure;
subplot(1,2,1); 

plot(d_rate, data(:, m_depth),'r.');
hold on; 
plot(data(:, m_rdi_z).* cos(data(:, m_pitch)) - data(:, m_rdi_y).* sin(data(:, m_pitch)), data(:, m_depth), 'bx'); 
set( gca, 'YDir', 'rev' );
ylabel( 'Depth)');
xlabel( 'Depth rate (m/s)');
zoom on;

subplot(1,2,2); 
hold on;
plot(data(:, m_rdi_x), data(:, m_depth), 'r.'); 
plot(data(:, m_rdi_y), data(:, m_depth), 'g.');
plot(data(:, m_rdi_z), data(:, m_depth), 'b.');
hold off;
set( gca, 'YDir', 'rev' );
xlabel( 'DVL Velocities (m/s)');

zoom on;
