Home > atmlab > randomize > iaaft > load_3d_data.m

load_3d_data

PURPOSE ^

Load a 3D field.

SYNOPSIS ^

function [fourier_coeff_3d, sorted_values_prof, x, y, z, template, mean_pdf_profile, no_values_x, no_values_y, no_values_z] = load_3d_data

DESCRIPTION ^

 Load a 3D field.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

load_3d_data.m

SOURCE CODE ^

0001 function [fourier_coeff_3d, sorted_values_prof, x, y, z, template, mean_pdf_profile, no_values_x, no_values_y, no_values_z] = load_3d_data
0002 
0003 % Load a 3D field.
0004 load data_les_cumuli.mat
0005 template = double(template);
0006 
0007 
0008 [no_values_y, no_values_x, no_values_z] = size(template); 
0009 x = 1:no_values_x;
0010 y = 1:no_values_y;
0011 z = 1:no_values_z;
0012 mean_pdf_profile = squeeze(mean(mean(template, 2),1));
0013 
0014 % Make sorted vector.
0015 template = remove_average_profile(template, mean_pdf_profile);
0016 sorted_values_prof = sort(reshape(template, no_values_x*no_values_y, no_values_z));
0017 total_variance_pdf = std(sorted_values_prof(:)).^2;
0018     
0019 % Calculate Fourier coeffients and scale them.
0020 fourier_coeff_3d = abs(ifftn( template ));
0021 power = fourier_coeff_3d.^2;
0022 total_variance_spec = sum(power(:));
0023 power = power * total_variance_pdf / total_variance_spec;
0024 fourier_coeff_3d = sqrt(power);

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