%% Generates comparison to RPI electron density pass from August 11 given
%% in March 2001 GRL.

clear all
close all

xvo=[20 25 32 37 43 48 54 60 66 71 78 82 87 93 98 104];
timrpi=2+xvo*0.5/21.5;
fp=1e3*[62 62 37 39 32 23 17 15 14 14 11 10.5 10 10.2 8.5 10.2];
edenrpi=fp.^2/80.6;

re=6371;

utv=2.5:0.5:4.5;
disv=[3.1 4.1 4.8 5.6 6.1];
mlatv=[57.2 70.3 76.31 80.1 81.5];
mltv=[14.48 13.6 12.57 11 9.6];

sv=ones(size(utv));
nop=50;
iricf=1;
day=11;
month=8;
year=2000;
dno=daynum(day,month,year);

timmat=utv;
timmlt=timcon(mltv*100);
latmatm=deg2rad(mlatv);
lonmatm=timml2lon(timmat,timmlt,dno*sv);
[lonmat,latmat]=mag2geo3(lonmatm,latmatm);
altmat=(disv-1)*re;

lsh=lshpar(-sv,latmatm,altmat+re);

eden=zeros(size(lonmat));
for i=1:length(lonmat)
 eden(i)=plasipt1(lonmat(i),latmat(i),altmat(i),timmat(i),day,month,year,nop,iricf);
end
  
figure(1)
semilogy(timrpi,edenrpi,'o-',timmat,eden,'^-')
grid 