close('all');
fclose('all');
clear;

datasetv='_v1';
read_parameters_HiWinGS_2013;

expp='HiWinGS_2013';
drive='D:\Desktop\Data\CRUISES\HiWinGS_2013\Knorr\flux\Raw';
% drive_w='C:\Data\CRUISES\DYNAMO_2011\flux_data';  
drive_w='C:\Data\CRUISES\HiWinGS_2013\flux_data';  

graphformat='.png';  %select graphics format files
graphdevice='-dpng'; %select graphic device


clearit=1;
printit=1;
year='2013';

yyyy='2013';

decorr=0;
dcname=[];
if decorr==1
    dcname='_vdecorr';  %means W wsa decorrelated as well
end;

rge=283:300;          
for ddd=rge
    [m,d]=yd2md(str2num(year), ddd);
    Vdate=[str2num(year) m d];

    for hhh=[00:23];   %
        try
            HiWinGS_2013_CO2_process_vCO2decorr;
        catch
            continue
        end
    end;
end;

rge=301;          
for ddd=rge
    [m,d]=yd2md(str2num(year), ddd);
    Vdate=[str2num(year) m d];

    for hhh=[00:21];   %
        try
            HiWinGS_2013_CO2_process_vCO2decorr;
        catch
            continue
        end
    end;
end;        

rge=302;          
for ddd=rge
    [m,d]=yd2md(str2num(year), ddd);
    Vdate=[str2num(year) m d];

    for hhh=[10:23];   %
        try
            HiWinGS_2013_CO2_process_vCO2decorr;
        catch
            continue
        end
    end;
end;

rge=303:318;          
for ddd=rge
    [m,d]=yd2md(str2num(year), ddd);
    Vdate=[str2num(year) m d];

    for hhh=[00:23];   %
        try
            HiWinGS_2013_CO2_process_vCO2decorr;
        catch
            continue
        end
    end;
end;

% 
% dcnames='_vCO2decorr1';
% % dcnames='_vCO2decorr_noWebbon7500mast';
% datasetv='_v1';
% 
% for ddd=283:301
%     jd=sprintf('%03i',ddd);
%     filecat(['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\CO2flux' jd '*' dcname dcnames '.prn'],['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux_' jd dcname dcnames '.txt']);
%     filecat(['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\CO2spec' jd '*' dcname dcnames '.prn'],['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec_' jd dcname dcnames '.txt']);
% end
% filecat(['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux*' dcname dcnames '.txt'],['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux' datasetv dcname dcnames '.prn']);
% filecat(['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec*' dcname dcnames '.txt'],['D:\Desktop\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec' datasetv dcname dcnames '.prn']);



dcnames='_vCO2decorr1';
% dcnames='_vCO2decorr_noWebbon7500mast';
datasetv='_v1';

for ddd=303:317
    jd=sprintf('%03i',ddd);
    filecat(['C:\Data\CRUISES\HiWinGS_2013\7200\flux\CO2flux' jd '*' '_UH' dcname dcnames '.prn'],['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux_UH_' jd dcname dcnames '.txt']);
    filecat(['C:\Data\CRUISES\HiWinGS_2013\7200\flux\CO2spec' jd '*' '_UH' dcname dcnames '.prn'],['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec_UH_' jd dcname dcnames '.txt']);
end
filecat(['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux_UH*' dcname dcnames '.txt'],['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2flux_UH' datasetv dcname dcnames '.prn']);
filecat(['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec_UH*' dcname dcnames '.txt'],['C:\Data\CRUISES\HiWinGS_2013\7200\flux\' cruise '_CO2spec_UH' datasetv dcname dcnames '.prn']);
