%Rainbow, Anna Hess, 2006-06-19
g=9.82;
% Indata tid	Ay	Ax	Az	Avert (=(x^2+z^2)^0.5)	h
load rainbow_wdss -ascii
% indata : tid(s), höjd(m), ay, ax, az (m/s^2)
% x - radiell, z=vertikal, y=sidled
am_short=rainbow_wdss; %(401:1401,:);

tid=am_short(:,1)-am_short(1,1);
hojd =am_short(:,6);
ay =am_short(:,2)/g;
ax =am_short(:,3)/g;
az =am_short(:,4)/g; %trimmad!
avert= (ax.^2+az.^2).^0.5;


figure(1)
subplot (2,1,1)
plot(tid,ay,tid,avert ) 
ylabel ('a_{h}/g, a_v/g ')
title('Rainbow')
axis([20 120 -1.5 2.5 ])
grid on

subplot(2,1,2)
plot(tid,hojd)
axis([20 120 -5 20])
grid on
ylabel ('höjd (m)')
xlabel('t (s)')

figure (2)
subplot(2,1,1)
plot(tid,az./ax)
axis([20 120 -1 1])
grid on
ylabel ('az/ax')

subplot(2,1,2)
plot(tid,ax./ay)
axis([20 120 -100 100])
grid on
ylabel ('ax/ay')



korrxz=(ax'*az)/((ax'*ax)*(az'*az))^0.5 % = 0.9799
korryz=(ay'*az)/((ay'*ay)*(az'*az))^0.5 % = -0.1140


% ______________________
% Ann-Marie Pendrill, 2006-06-21
