% get full AO record from 2 input files
year=2011; day1=datenum(year,1,0);
stcruise=datenum(2011,4,1)-datenum(2011,1,0);

p1=load('s11dock.mat');
p2=load('s11.mat');
imet_1=[p1.imet_1 p2.imet_1];
imet_2=[p2.imet_1 p2.imet_2];
[jj,ix,jj]=unique(imet_1(1,:));
imet_1=imet_1(:,ix);
ix=find(imet_1(1,:) > stcruise);
imet_1=imet_1(:,ix);

[jj,ix,jj]=unique(imet_2(1,:));
imet_2=imet_2(:,ix);
ix=find(imet_2(1,:) > stcruise);
imet_2=imet_2(:,ix);

save stratus11_ao.mat imet_1 imet_2
minx=stcruise; maxx=datenum(now)-day1;
[sys1]=AO_to_variables(imet_1,minx,maxx);
if isstruct(sys1)
    sys1.mday=sys1.yday + day1;
end
%sys1=struct_gap_nan(sys1,3);

[sys2]=AO_to_variables(imet_2,minx,maxx);
if isstruct(sys1)
    sys2.mday=sys2.yday + day1;
end
cruiseyear=year;
save Argos.mat sys1 sys2 cruiseyear

