Home > atmlab > randomize > iaaft > load_2d_data_vertical.m

load_2d_data_vertical

PURPOSE ^

Load a 2D field.

SYNOPSIS ^

function [fourier_coeff_2d, sorted_values_prof, x, y, template, mean_pdf_profile, no_values_x, no_values_y] = load_2d_data_vertical(number)

DESCRIPTION ^

 Load a 2D field.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

load_2d_data_vertical.m

SOURCE CODE ^

0001 function [fourier_coeff_2d, sorted_values_prof, x, y, template, mean_pdf_profile, no_values_x, no_values_y] = load_2d_data_vertical(number)
0002 
0003 % Load a 2D field.
0004 switch number
0005     case 1
0006         %load data_altocumulus.mat
0007         %template = double(dbz);
0008         load('/home/bengt/CIWSIR/Dataset_gen/CloudSAT_data/test_2d23d.mat')
0009     template=IWC;
0010         %keyboard
0011         %template=template(8:end,61:100);
0012         %imagesc(template)
0013         %size(template)
0014          
0015 
0016         % This radar measurement of an Altocumulus field is mirrored to get
0017         % a field without jumps at the edges. The field was reduced in size
0018         % four times without averaging, do not use this field for scientif
0019         % purposes.
0020         %template = [template  flipdim(template,2)];
0021         %template = flipdim(template, 1);
0022         
0023     otherwise
0024         % A cloud field retrieved with Optimal Estimation by Ulrich
0025         % Loehnert.
0026         load data_cloud_prof.mat
0027         template = double(lwc);        
0028 end    
0029 
0030 [no_values_y, no_values_x] = size(template); 
0031 x = 1:no_values_x;
0032 y = 1:no_values_y;
0033 mean_pdf_profile = squeeze(mean(template, 2));
0034 
0035 % Make sorted vector.
0036 template = remove_average_profile(template, mean_pdf_profile);
0037 sorted_values_prof = sort(template, 2);
0038 sorted_values_prof = sorted_values_prof';
0039 total_variance_pdf = std(sorted_values_prof(:)).^2;
0040     
0041 % Calculate Fourier coeffients and scale them.
0042 fourier_coeff_2d = abs(ifft2( template ));
0043 power = fourier_coeff_2d.^2;
0044 total_variance_spec = sum(sum(power));
0045 power = power * total_variance_pdf / total_variance_spec;
0046 fourier_coeff_2d = sqrt(power');

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005