%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Name: plotHybridTime.m
% Author: J. Kristoffer Hultgren
%
% Description:
%
% Plots the Hybrid model data wrt time in orbit.
%
% Input:  dataH - Hybrid model data
%         r     - Radius of orbit
%
% Output: -
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function plotHybridTime(dataH,r)

global CO; % Global constants

Hrhosw = dataH(:,11).*10^-6;    % Solar wind density
Hrhohi = dataH(:,15).*10^-6;    % Heavy ion density
HrhoTot = Hrhosw + Hrhohi;      % Total density

P = 2*pi*sqrt(r^3/(CO.G*CO.M))/60/60;   % Period of orbit

figure('name','Hybrid')

TH = linspace(0,360,max(size(dataH)));
subplot(2,1,1), plot(TH,HrhoTot,'r')
hold on
subplot(2,1,1), plot(TH,Hrhosw,'b')
grid on
subplot(2,1,1), plot(TH,Hrhohi,'g')
title('Hybrid')
legend('Total','Solar Wind','Heavy Ion')
xlabel('\theta (deg)')
ylabel('Density (cm^{-3})')
axes('position',[.13  .45  .775  .0001])
axis([0 P*40/36 0 0001])
xlabel('Time (h)')