clc
clear all
folder='EPL3_2009\EPL3\Tm02';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;
Tm02=[];
date=[];
for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Tm02_day,date_day]=ReadTm02(filename);
    Tm02=[Tm02 Tm02_day]; 
    date=[date date_day];
    %pause
end

%%2010
folder='EPL3_2010\EPL3\Tm02';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Tm02_day,date_day]=ReadTm02(filename);
    Tm02=[Tm02 Tm02_day]; 
    date=[date date_day];
    %pause
end

%%2011
folder='EPL3_2011\EPL3\Tm02';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Tm02_day,date_day]=ReadTm02(filename);
    Tm02=[Tm02 Tm02_day]; 
    date=[date date_day];
    %pause
end

%%2012
folder='EPL3_2012\EPL3\Tm02';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Tm02_day,date_day]=ReadTm02(filename);
    Tm02=[Tm02 Tm02_day]; 
    date=[date date_day];
    %pause
end

Tm02(Tm02==999)=NaN;
Tm02=Tm02/10

%%
if 1
    plot(date,Tm02)
    datetick('x')
end

save ('Tm02.mat','date','Tm02')