function [final_data]=jobfile(input_data)

intervals=[0:0.05:3];
option=input_data.option;
input_data.path1=[];
total_param_scaled=[];
max_height=14000;
total_flt=[];
total_radar=[];
turb_tot=[];
turb_r1=[];
turb_r2=[];
turb_r3=[];
turb_r4=[];
turb_r0=[];
turb_r5=[];
speed=[];
turb=[];
debut=2;
h1=45;
xmin=26;
for i=1:length(intervals)-1
    
    results(i).param=[];
end
%Hurricane Katrina
input_data.hurricane='\TKE\katrina\';
input_data.jour='28\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
        
        
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end

%Hurricane Isabel
input_data.hurricane='\TKE\isabel\';
input_data.jour='12\10km\';

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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
    
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 
input_data.jour='14\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 


%Hurricane Rita
 input_data.hurricane='\TKE\rita\';
% input_data.jour='20\10km\';
% 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);
% if strcmp(option,'cfad_height')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
%     turb_tot=[turb_tot;turb_out];
%     
% elseif strcmp(option,'cfad_rmw')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
%     
%     turb_r0=[turb_r0;turb_out(1).turb;];
%     turb_r1=[turb_r1;turb_out(2).turb;];
%     turb_r2=[turb_r2;turb_out(3).turb;];
%     turb_r3=[turb_r3;turb_out(4).turb;];
%     turb_r4=[turb_r4;turb_out(5).turb;];
%     
% elseif strcmp(option,'cfad_rmw_scaling')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
%     
%     turb_r1=[turb_r1;turb_out(1).turb;];
%     turb_r2=[turb_r2;turb_out(2).turb;];
%     turb_r3=[turb_r3;turb_out(3).turb;];
%     turb_r4=[turb_r4;turb_out(4).turb;];
%     turb_r5=[turb_r5;turb_out(5).turb;];
%     
%     
% elseif strcmp(option, 'tg_corr')
%     for i=1:max_file
%         input_data.file_number=i;
%         [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
%         if type_data == 0
%             speed=[speed;dbz(xmin:end,1:h1)];
%             
%         else 
%             
%             turb=[turb;(dbz(xmin:end,1:h1))];
%         end
%     end
% elseif strcmp(option, 'rmw_scaling')
%     [temp_results]=rmw_scaling(input_data);
%     for i=1:length(intervals)-1
%         temp1=temp_results(i).param;
%         results(i).param=[results(i).param;temp1];
%     end
% elseif strcmp(option, 'rmw_scaling_interp')
%     [temp_results]=rmw_scaling_interp(input_data);
%     
%     temp1=temp_results(1).param_scaled;
%     total_param_scaled=[total_param_scaled temp1];
%     
% else
%     for i=debut:4:max_file
%         input_data.file_number=i;
%         [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
%         total_flt=[total_flt;flt_tke_final];
%         total_radar=[total_radar;tke_radar_final];
%     end
% end 

input_data.jour='21\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 
input_data.jour='22\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 


input_data.jour='23\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 

input_data.hurricane='\TKE\frances\';
input_data.jour='01\10km\';
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);
if strcmp(option,'cfad_height')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
    turb_tot=[turb_tot;turb_out];
    
elseif strcmp(option,'cfad_rmw')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
    
    turb_r0=[turb_r0;turb_out(1).turb;];
    turb_r1=[turb_r1;turb_out(2).turb;];
    turb_r2=[turb_r2;turb_out(3).turb;];
    turb_r3=[turb_r3;turb_out(4).turb;];
    turb_r4=[turb_r4;turb_out(5).turb;];
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
    
    turb_r1=[turb_r1;turb_out(1).turb;];
    turb_r2=[turb_r2;turb_out(2).turb;];
    turb_r3=[turb_r3;turb_out(3).turb;];
    turb_r4=[turb_r4;turb_out(4).turb;];
    turb_r5=[turb_r5;turb_out(5).turb;];
    
elseif strcmp(option, 'tg_corr')
    for i=1:max_file
        input_data.file_number=i;
        [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
        if type_data == 0
            speed=[speed;dbz(xmin:end,1:h1)];
            
        else 
            
            turb=[turb;(dbz(xmin:end,1:h1))];
        end
    end
elseif strcmp(option, 'rmw_scaling')
    [temp_results]=rmw_scaling(input_data);
    for i=1:length(intervals)-1
        temp1=temp_results(i).param;
        results(i).param=[results(i).param;temp1];
    end
elseif strcmp(option, 'rmw_scaling_interp')
    [temp_results]=rmw_scaling_interp(input_data);
    
    temp1=temp_results(1).param_scaled;
    total_param_scaled=[total_param_scaled temp1];
    
else
    for i=debut:4:max_file
        input_data.file_number=i;
        [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
        total_flt=[total_flt;flt_tke_final];
        total_radar=[total_radar;tke_radar_final];
    end
end 

% input_data.hurricane='\TKE\fabian\';
% input_data.jour='03\10km\';
% 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);
% if strcmp(option,'cfad_height')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_height', max_height);
%     turb_tot=[turb_tot;turb_out];
%     
% elseif strcmp(option,'cfad_rmw')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw', max_height);
%     
%     turb_r0=[turb_r0;turb_out(1).turb;];
%     turb_r1=[turb_r1;turb_out(2).turb;];
%     turb_r2=[turb_r2;turb_out(3).turb;];
%     turb_r3=[turb_r3;turb_out(4).turb;];
%     turb_r4=[turb_r4;turb_out(5).turb;];
%     
% elseif strcmp(option,'cfad_rmw_scaling')==1
%     [perct, turb_out, x_axis, z_axis]=pdf_maker(input_data, 'CFAD_rmw_interp', max_height);
%     
%     turb_r1=[turb_r1;turb_out(1).turb;];
%     turb_r2=[turb_r2;turb_out(2).turb;];
%     turb_r3=[turb_r3;turb_out(3).turb;];
%     turb_r4=[turb_r4;turb_out(4).turb;];
%     turb_r5=[turb_r5;turb_out(5).turb;];
%     
% elseif strcmp(option, 'tg_corr')
%     for i=1:max_file
%         input_data.file_number=i;
%         [ws,radwind,tangwind,w,dbz, x_fill, y_fill, z_fill, type_data]=read_w_files(input_data);
%         if type_data == 0
%             speed=[speed;dbz(xmin:end,1:h1)];
%             
%         else 
%             
%             turb=[turb;(dbz(xmin:end,1:h1))];
%         end
%     end
% elseif strcmp(option, 'rmw_scaling')
%     [temp_results]=rmw_scaling(input_data);
%     for i=1:length(intervals)-1
%         temp1=temp_results(i).param;
%         results(i).param=[results(i).param;temp1];
%     end
% elseif strcmp(option, 'rmw_scaling_interp')
%     [temp_results]=rmw_scaling_interp(input_data);
%     
%     temp1=temp_results(1).param_scaled;
%     total_param_scaled=[total_param_scaled temp1];
%     
% else
%     for i=debut:4:max_file
%         input_data.file_number=i;
%         [x_km,flt_tke_final,tke_radar_final]=flight_level_tke(input_data);
%         total_flt=[total_flt;flt_tke_final];
%         total_radar=[total_radar;tke_radar_final];
%     end
% end 
% 
% 







if strcmp(option,'cfad_rmw')==1
    
    rad(2).turb=turb_r1;
    rad(3).turb=turb_r2;
    rad(4).turb=turb_r3;
    rad(5).turb=turb_r4;
    rad(1).turb=turb_r0;
    
    
    max_bin=15;
    bins=0:max_bin;
    bins=[bins inf];
    x_axis=0.5:1:max_bin + 1.5;
    [li_turb,col_turb]=size(turb_r1);
    
    for ii=1:5
        distri=histc(rad(ii).turb, bins);
        
        for col=1:col_turb
            if sum(distri(:,col))~=0
                perct1(:,col) = (distri(:,col)./sum(distri(:,col)))*100;
            else
                perct1(:,col)=zeros(length(bins),1);
            end
        end
        perct(ii).perct1=perct1;
    end
    
    
    
    for i=1:5
        
        milieu=nanmedian(rad(i).turb);
        moyenne=nanmean(rad(i).turb);
        number_contour=0:2.5:100;
        velcolor=load(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\programs\carbon43.dat']);
        figure
        pourct=perct(i).perct1;
        [C,h,CF] = contourf(x_axis,z_axis,pourct',number_contour);
        clabel(C,h,[5 10 20 30 40 50],'FontSize', 8) 
        shading flat
        colormap(velcolor)
        caxis([0 50])
        colorbar
        title(['radius ',num2str(i)])
        xlabel('TKE (m^2s^{-2})')
        ylabel('z (m)')
        %             hold on
        %             plot(milieu,z_axis,'LineWidth', 3, 'Color','k')
        %             plot(moyenne,z_axis,'--','LineWidth', 3, 'Color', 'k')
    end
    final_data.perct=perct;
    final_data.xaxis=x_axis;
    final_data.zaxis=z_axis;
    final_data.turb=rad;
    
elseif strcmp(option,'cfad_rmw_scaling')==1
    
    rad(1).turb=turb_r1;
    rad(2).turb=turb_r2;
    rad(3).turb=turb_r3;
    rad(4).turb=turb_r4;
    rad(5).turb=turb_r5;
    
    
    max_bin=16;
    min_bin=-12;
    bins=min_bin:0.5:max_bin;
    bins=[-Inf bins inf];
    x_axis=min_bin-0.5:0.5:max_bin + 0.5 ;
    [li_turb,col_turb]=size(turb_r1);
    
    for ii=1:5
        distri=histc(rad(ii).turb, bins);
        
        for col=1:col_turb
            if sum(distri(:,col))~=0
                perct1(:,col) = (distri(:,col)./sum(distri(:,col)))*100;
            else
                perct1(:,col)=zeros(length(bins),1);
            end
        end
        perct(ii).perct1=perct1;
    end
    
    
    
    for i=1:5
        
        
        figure
        pourct=perct(i).perct1;
        number_contour=[0.01 0.1 0.5 1 2 5 15 30 40];
        [C,h,CF] = contourf(x_axis,z_axis,pourct',number_contour);
        velcolor=load(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\programs\carbon43.dat']);
        v8=velcolor([1:5:43],:);
        v8(4)=velcolor(18);
        cmap2=colorbar_interp(number_contour,velcolor,v8);
        colormap(cmap2)
        [ax,hfill]=cbarf(pourct',number_contour,'vertical','nonlinear');
        xlabel('Vertical Velocity(m/s)')
        ylabel('z(m)')
        intervals=[0:0.05:3];
        if i==1
        cc=[num2str(intervals(11)),'*RMW - ',num2str(intervals(15)),'*RMW']
        title(cc)
    elseif i==2
        cc=[num2str(intervals(16)),'*RMW - ',num2str(intervals(20)),'*RMW']
        title(cc)
    elseif i==3
        cc=[num2str(intervals(21)),'*RMW - ',num2str(intervals(25)),'*RMW']
        title(cc)
    elseif i ==4
        cc=[num2str(intervals(26)),'*RMW - ',num2str(intervals(30)),'*RMW']
        title(cc)
    elseif i ==5
        cc=['>  ' num2str(intervals(31)),'*RMW' ]
        title(cc)
    end
    end
    final_data.perct=perct;
    final_data.xaxis=x_axis;
    final_data.zaxis=z_axis;
    final_data.turb=rad;
elseif strcmp(option, 'cfad_height')
    
    max_bin=16;
    min_bin=-12;
    bins=min_bin:0.5:max_bin;
    bins=[-inf bins inf];
    x_axis=min_bin-0.5:0.5:max_bin + 0.5;
    distri=histc(turb_tot, bins);
    [li_turb,col_turb]=size(turb_tot);
    for col=1:col_turb
        if sum(distri(:,col))~=0
            perct1(:,col) = (distri(:,col)./sum(distri(:,col)))*100;
        else
            perct1(:,col)=zeros(length(bins),1);
        end
    end
    
    final_data.data=turb_tot;
    final_data.xaxis=x_axis;
    final_data.zaxis=z_axis;
    number_contour=[0.1 0.2 0.5 1 2 5 15 30];
    [C,h,CF] = contourf(x_axis,z_axis,perct1',number_contour);
    velcolor=load(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\programs\carbon43.dat']);
    v8=[velcolor(1,:);velcolor(9,:);velcolor(12,:);velcolor(17,:);velcolor(26,:);velcolor(35,:);velcolor(43,:);velcolor(29,:)];
    cmap2=colorbar_interp(number_contour,velcolor,v8);
    colormap(cmap2)
    [ax,hfill]=cbarf(perct1',number_contour,'vertical','nonlinear');
    
    
elseif strcmp(option, 'tg_corr')     
    [m,n]=size(speed);
    
    tgwind=reshape(speed,m*n,1);
    tke=reshape(turb,m*n,1);
    mean_corr=corrcoef(tke,tgwind,'rows','complete')
    final_data=[tgwind tke];
elseif strcmp(option, 'rmw_scaling')
    temp=[];
    for i=1:length(results)
        temp=[temp;nanmean(results(i).param)];
        
    end
    results(1).scaled_param=temp;
    results(1).xaxis=temp_results(1).xaxis;
    results(1).zaxis=temp_results(1).zaxis;
    final_data=results;
elseif strcmp(option, 'rmw_scaling_interp')
    [max_x,max_files,max_height]=size(total_param_scaled);
    for i=1:max_height
        temp=squeeze(total_param_scaled(:,:,i));
        temp2=nanmean(temp')';
        temp3(:,i)=temp2;
    end
    results(1).scaled_mean=temp3;
    results(1).xaxis=temp_results(1).xaxis;
    results(1).zaxis=temp_results(1).zaxis;
    
    final_data=results;
    
    
else
    final_data=[total_flt total_radar];
end
