    
O3_data=[];fastO3_day=[];fastO3_uncorr=[];
O3=[];

for ddd=209;
    jd=num2str(ddd);
    if  ddd<100;
        jd=['0' num2str(ddd)];	
    end;
          
          
    for hhh=0;
    
        hr='00';
        hr2='23';
        jd2=num2str(ddd-1);
        fid1=fopen([way_rawdata, '\GOMECC\day' ,jd2, '\P4_',jd2,hr2]);
        fid2=fopen([way_rawdata, '\GOMECC\day' ,jd, '\P4_',jd,hr]);
        disp(['P4_', jd,hr])
        
        dump=fgetl(fid1);
        dump2=fgetl(fid1);
        ozone_data1=fscanf(fid1, '%f, %f %f', [3,inf]);    
        ozone_data1=ozone_data1';

        time=ozone_data1(:,1)/1000; 
        time=time-time(1);
        slowO3=ozone_data1(:,2);
        fastO3=ozone_data1(:,3);

        time_real1=0:0.1:3599.9;                                                %enlarge vector to 36000 values
        fastO3_real1=interpft(fastO3,36000);
        %fastO3_real=(time,fastO3,time_real','nearest');

        
        dump=fgetl(fid2);
        dump2=fgetl(fid2);
        ozone_data2=fscanf(fid2, '%f, %f %f', [3,inf]);    
        ozone_data2=ozone_data2';
               
        time=ozone_data2(:,1)/1000; 
        time=time-time(1);
        slowO3=ozone_data2(:,2);
        fastO3=ozone_data2(:,3);

        time_real2=0:0.1:3599.9;                                                %enlarge vector to 36000 values
        fastO3_real2=interpft(fastO3,36000);
        %fastO3_real=(time,fastO3,time_real','nearest');

        fastO3_real=[fastO3_real2(35958:36000);fastO3_real1(1:36000-43)];       %lagtime 4.3 s
        
        O3ppb_real=(fastO3_real-2155.44)/3823.13;                               %Calibration average over all calibrations ecxcept Jd 196
        O3mean=tenminmean_GOMECC(O3ppb_real,10,10);
        O3=[O3;O3mean];

        O3_data=[O3_data;ozone_data];
        fastO3_day=[fastO3_day;fastO3_real];%_real
        fastO3_uncorr=[fastO3_uncorr;fastO3];
        
        if hhh==0 | hhh==12 | hhh==18,
           disp(['Calculating spectra for ',num2str(hhh)])
           [Sw,F]=psd2(detrend(O3ppb_real),length(O3ppb_real),10.);
           [Sws,Fsw]=specsmoo(Sw,10.);
          
           figure; loglog(Fsw(length(Fsw)-31:length(Fsw)),((Fsw(length(Fsw)-31:length(Fsw))).^(-2/3))./(Fsw(length(Fsw)-18).^(-2/3)).*Sws(length(Fsw)-18).*Fsw(length(Fsw)-18),'r');
           hold
           loglog(Fsw,Sws.*Fsw,'g');
            
           title(['O3 Spectra:   Day ',jd,hr]);
           legend('5/3','O3');       xlabel('Frequency in Hz');
           ylabel('Spectrum * Frequency');
           print([way_rawdata, '\GOMECC\Analysis\O3ppb_' jd  '.jpg'],'-djpeg');
        end;
    end;     
end;