function [U10_bined,Cd_bined, U10_full, Cd_full]=jobfile_cd_curve(bin)
input_data.path1=[];
Cd_full=[];
U10_full=[];
input_data.hurricane=[];
hurricane(1).name='\TKE\katrina\';

hurricane(1).jour(1,:)='28\10km';


% hurricane(2).name='\TKE\rita\';
% hurricane(2).jour(1,:)='20\10km';
% 
% hurricane(2).jour(2,:)='21\10km';
% 
% hurricane(2).jour(3,:)='22\10km';
% 
% 
% hurricane(2).jour(4,:)='23\10km';
% 
% 
% hurricane(3).name='\TKE\frances\';
% hurricane(3).jour(1,:)='01\10km';

% hurricane(4).name='\TKE\fabian\';
% hurricane(4).jour(1,:)='03\10km';


for i=1%:3%length(hurricane)
    [li, col]=size(hurricane(i).jour);
    for j = 1:li
        input_data.hurricane = hurricane(i).name;
        input_data.jour = hurricane(i).jour(j,:);
        filename=dir(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',input_data.hurricane,'\',input_data.jour,'\*.w']) ;
        max_file=length(filename);
        
        for file_number = 1:4:max_file
            input_data.file_number=file_number;
            [Cd,U10] =drag_from_radar(input_data);
            Cd_full=[Cd_full;Cd];
            U10_full=[U10_full;U10];
        end
    end
end

Cd_bined=[];
U10_bined=[];

ecart=2.5:bin:max(U10_full);

for i=2:length(ecart)
    u_ecart=find(U10_full >= ecart(i-1) &U10_full < ecart(i));
    u_test=find(isnan(Cd_full(u_ecart)) ==0);
    if length(u_test) < 5
        U10_bined=[U10_bined NaN];
        Cd_bined=[Cd_bined NaN];
    else
        U10_bined=[U10_bined nanmean(U10_full(u_ecart))];
        
        temp_mu=nanmean(Cd_full(u_ecart));
        temp_sigma=nanstd(Cd_full(u_ecart));
        temp=Cd_full(u_ecart);
        u_outliers= find(abs( temp- temp_mu) > 3*temp_sigma) ;
        temp(u_outliers)=NaN;
        Cd_bined=[Cd_bined nanmean(temp)];
    end
end