Home > src > main > matlab > flaglet_fulltest.m

flaglet_fulltest

PURPOSE ^

flaglet_fulltest - Run all tests

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 flaglet_fulltest - Run all tests

 flaglet package to perform Wavelets on the Solid Sphere.
 Copyright (C) 2012  Boris Leistedt & Jason McEwen
 See LICEPSE.txt for license details

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % flaglet_fulltest - Run all tests
0002 %
0003 % flaglet package to perform Wavelets on the Solid Sphere.
0004 % Copyright (C) 2012  Boris Leistedt & Jason McEwen
0005 % See LICEPSE.txt for license details
0006 
0007 clear all;
0008 close all;
0009 
0010 % Main parameters
0011 R = 1.0;
0012 L = 16;
0013 P = 16;
0014 B_l = 3;
0015 B_p = 2;
0016 J_min_l = 0;
0017 J_min_p = 1;
0018 
0019 J_l = ceil(log(L) ./ log(B_l))
0020 J_p = ceil(log(P) ./ log(B_p))
0021 
0022 % Checks tiling of harmonic space for axysimmetric wavelets
0023 [kappa kappa0] = flaglet_axisym_tiling(B_l, B_p, L, P, J_min_l, J_min_p);
0024 error_on_axisym_tiling = flaglet_check_axisym_tiling(kappa, kappa0, L, P, B_l, B_p)
0025 
0026 % Generate random 3D FLAG decomposition
0027 flmn = zeros(P, L^2);
0028 flmn = rand(size(flmn)) + sqrt(-1)*rand(size(flmn));
0029 flmn = 2.*(flmn - (1+sqrt(-1))./2);
0030 
0031 % Generate the corresponding field
0032 f = flag_synthesis(flmn);
0033 
0034 % Test exactness of 3D Wavelet transform - multiresolution
0035 [f_wav, f_scal] = flaglet_axisym_analysis(f);
0036 f_rec = flaglet_axisym_synthesis(f_wav, f_scal);
0037 default = max(max(max(abs(f-f_rec))))
0038 
0039 % Test exactness of 3D Wavelet transform - full resolution
0040 [f_wav, f_scal] = flaglet_axisym_analysis(f, 'Downsample', false);
0041 f_rec = flaglet_axisym_synthesis(f_wav, f_scal, 'Downsample', false);
0042 default_fullresolution = max(max(max(abs(f-f_rec))))
0043 
0044 % Test exactness of 3D Wavelet transform - multiresolution
0045 [f_wav, f_scal] = flaglet_axisym_analysis(f, 'Downsample', true);
0046 f_rec = flaglet_axisym_synthesis(f_wav, f_scal, 'Downsample', true);
0047 default_multiresolution = max(max(max(abs(f-f_rec))))
0048 
0049 % Test exactness of 3D Wavelet transform - custom values
0050 [f_wav, f_scal] = flaglet_axisym_analysis(f, 'B_l', B_l, 'B_p', B_p, 'L', L, 'P', P, 'J_min_l', J_min_l, 'J_min_p', J_min_p, 'R', R);
0051 f_rec = flaglet_axisym_synthesis(f_wav, f_scal, 'B_l', B_l, 'B_p', B_p, 'L', L, 'P', P, 'J_min_l', J_min_l, 'J_min_p', J_min_p, 'R', R);
0052 custom = max(max(max(abs(f-f_rec))))
0053 
0054 % Impose reality on flms.
0055 for en = 1:P
0056    for el = 0:L-1
0057       ind = el*el + el + 1;
0058       flmn(en,ind) = real(flmn(en,ind));
0059       for m = 1:el
0060          ind_pm = el*el + el + m + 1;
0061          ind_nm = el*el + el - m + 1;
0062          flmn(en,ind_nm) = (-1)^m * conj(flmn(en,ind_pm));
0063       end  
0064    end
0065 end
0066 
0067 % Generate the corresponding field
0068 f_real = flag_synthesis(flmn, 'reality', true);
0069 
0070 % Test exactness of 3D Wavelet transform - multiresolution
0071 [f_wav_real, f_scal_real] = flaglet_axisym_analysis(f_real, 'reality', true);
0072 f_real_rec = flaglet_axisym_synthesis(f_wav_real, f_scal_real, 'reality', true);
0073 real_default = max(max(max(abs(f_real-f_real_rec))))
0074 
0075 % Test exactness of 3D Wavelet transform - full resolution
0076 [f_wav_real, f_scal_real] = flaglet_axisym_analysis(f_real, 'Downsample', false, 'reality', true);
0077 f_rec = flaglet_axisym_synthesis(f_wav_real, f_scal_real, 'Downsample', false, 'reality', true);
0078 real_default_fullresolution = max(max(max(abs(f_real-f_real_rec))))
0079 
0080 % Test exactness of 3D Wavelet transform - multiresolution
0081 [f_wav_real, f_scal_real] = flaglet_axisym_analysis(f_real, 'Downsample', true, 'reality', true);
0082 f_rec = flaglet_axisym_synthesis(f_wav_real, f_scal_real, 'Downsample', true, 'reality', true);
0083 real_default_multiresolution = max(max(max(abs(f_real-f_real_rec))))
0084 
0085 % Test exactness of 3D Wavelet transform
0086 [f_wav_real, f_scal_real] = flaglet_axisym_analysis(f_real, 'B_l', B_l, 'B_p', B_p, 'L', L, 'P', P, 'J_min_l', J_min_l, 'J_min_p', J_min_p, 'R', R, 'reality', true);
0087 f_real_rec = flaglet_axisym_synthesis(f_wav_real, f_scal_real, 'B_l', B_l, 'B_p', B_p, 'L', L, 'P', P, 'J_min_l', J_min_l, 'J_min_p', J_min_p, 'R', R, 'reality', true);
0088 real_custom = max(max(max(abs(f_real-f_real_rec))))

Generated on Mon 24-Sep-2012 12:26:33 by m2html © 2005