% рисуем примеры сопоставления помех на прифилях

% ----- 2012

load 20120926_Klyuchi_Academ_Survey.mat thp f th5 f5
% для пикета КА05
k=between_my(thp,min(th5),max(th5));
thp=thp(k); fp=f(k);

figure(1)
subplot(233)
plot((thp-6)*60,fp-nanmean(fp)-2,'.-',...
     (th5-6)*60,f5-nanmean(f5)+2,'o-','MarkerSize',3)
axis tight, xlabel('UT-06,мин'), ylabel('dF,nT')
legend('Obs','KA05'), title('(в)')

[kp,k5]=ismember_digit(thp,th5,8);
subplot(236)
plot(fp(kp)-nanmean(fp(kp)),f5(k5)-nanmean(f5(k5)),'o','MarkerSize',3)
xlabel('dF(Obs),nT'), ylabel('dF(KA05),nT')

% ---- 2006 

load 20061109_POS105_p03.mat th3 f3
load 20061109_POS109.mat th9 f9
% для пикета 03
k=between_my(th9,min(th3),max(th3));
th9=th9(k); f9=f9(k);

subplot(231)
plot((th9-7)*60,f9-nanmean(f9)+1,'.-',...
     (th3-7)*60,f3-nanmean(f3)-1,'o-','MarkerSize',3)
axis tight, xlabel('UT-07,мин'), ylabel('dF,nT')
legend('Obs','03'), title('(a)')

[k9,k3]=ismember_digit(th9,th3,8);
subplot(234)
plot(f9(k9)-nanmean(f9(k9)),f3(k3)-nanmean(f3(k3)),'o','MarkerSize',3)
xlabel('dF(Obs),nT'), ylabel('dF(03),nT')


% ----- 2007

load 20071010_KA03_POS.mat T3 f3
load 20071010_KA03_LEMI.mat Tv Fv
thv=rem(Tv,1)*24; th3=rem(T3,1)*24;

% для пикета КА03
k3=between_my(th3,5.4,6.0); th3=th3(k3); f3=f3(k3);
k=between_my(thv,min(th3),max(th3));
thv=thv(k); fv=Fv(k);
k=between_my(th3,5.5665,5.5725); f3(k)=NaN;

subplot(232)
plot((thv-5)*60,fv-nanmean(fv)-2,'.-',...
     (th3-5)*60,f3-nanmean(f3)+2,'o-','MarkerSize',3)
axis tight, xlabel('UT-05,мин'), ylabel('dF,nT')
legend('Obs','KA03'), title('(б)')

[kv,k3]=ismember_digit(thv,th3,8);
subplot(235)
plot(fv(kv)-nanmean(fv(kv)),f3(k3)-nanmean(f3(k3)),'o','MarkerSize',3)
xlabel('dF(Obs),nT'), ylabel('dF(KA03),nT')
