


s2let_plot_curvelet_tiling
- Plot the tiling of scaling functions and curvelets in harmonic space.
- then plot the scaling functions and curvelets in real space.
Default usage :
s2let_plot_curvelet_tiling(B, L, J_min, <options>)
B is the curvelet dilation parameter,
L is the angular band-limit,
J_min the first wavelet to be used.
% Valid options include:
'Spin' = { Spin; (default=0) }
'SpinLowered' = { true [Apply normalisation factors for spin-lowered
wavelets and scaling function.],
false [Apply the usual normalisation factors such
that the wavelets fulfil the admissibility
condition (default)]}
'SpinLoweredFrom' = [integer; if the SpinLowered option is used, this
option indicates which spin number the wavelets
should be lowered from (default = 0)]
-----------------------------------------------------------
S2LET package to perform Wavelet Transform on the Sphere.
Copyright (C) 2012-2016 Boris Leistedt, Jennifer Chan & Jason McEwen
See LICENSE.txt for license details
-----------------------------------------------------------

0001 function s2let_plot_curvelet_tiling(B, L, J_min, varargin) 0002 % s2let_plot_curvelet_tiling 0003 % - Plot the tiling of scaling functions and curvelets in harmonic space. 0004 % - then plot the scaling functions and curvelets in real space. 0005 % 0006 % Default usage : 0007 % 0008 % s2let_plot_curvelet_tiling(B, L, J_min, <options>) 0009 % 0010 % B is the curvelet dilation parameter, 0011 % L is the angular band-limit, 0012 % J_min the first wavelet to be used. 0013 % 0014 % % Valid options include: 0015 % 0016 % 'Spin' = { Spin; (default=0) } 0017 % 'SpinLowered' = { true [Apply normalisation factors for spin-lowered 0018 % wavelets and scaling function.], 0019 % false [Apply the usual normalisation factors such 0020 % that the wavelets fulfil the admissibility 0021 % condition (default)]} 0022 % 'SpinLoweredFrom' = [integer; if the SpinLowered option is used, this 0023 % option indicates which spin number the wavelets 0024 % should be lowered from (default = 0)] 0025 % 0026 % ----------------------------------------------------------- 0027 % S2LET package to perform Wavelet Transform on the Sphere. 0028 % Copyright (C) 2012-2016 Boris Leistedt, Jennifer Chan & Jason McEwen 0029 % See LICENSE.txt for license details 0030 % ----------------------------------------------------------- 0031 0032 % Parse arguments. 0033 p = inputParser; 0034 p.addRequired('B', @isnumeric); 0035 p.addRequired('L', @isnumeric); 0036 p.addRequired('J_min', @isnumeric); 0037 p.addParamValue('Spin', 0, @isnumeric); 0038 p.addParamValue('SpinLowered', false, @islogical); 0039 p.addParamValue('SpinLoweredFrom', 0, @isnumeric); 0040 p.parse(B, L, J_min, varargin{:}); 0041 0042 args = p.Results; 0043 0044 B = args.B; 0045 L = args.L; 0046 J_min = args.J_min; 0047 Spin = args.Spin; 0048 J = s2let_jmax(L, B); 0049 0050 % --------------- 0051 % Tile curvelets: 0052 % --------------- 0053 [cur_lm scal_l] = s2let_curvelet_tiling(args.B, args.L, args.J_min, ... 0054 'Spin', args.Spin, 'SpinLowered', args.SpinLowered,... 0055 'SpinLoweredFrom',args.SpinLoweredFrom); 0056 0057 % Normalise and reshape the scaling functions: 0058 el_min = max(abs(args.Spin), abs(args.SpinLoweredFrom)); 0059 kappa0_cur = zeros(1,L); 0060 for el = el_min:L-1 0061 kappa0_cur(1,el+1) = scal_l(el^2+el+1,1)/sqrt((2*el+1)/(4.0*pi)) ; 0062 end 0063 0064 % Normalise and reshape the curvelet functions: 0065 kappa_cur = zeros(J+1,L); 0066 for j = J_min:J 0067 for el= el_min:L-1 0068 % ind = l^2 +l + m + 1 ; now consider m = el; 0069 kappa_cur(j+1,el+1) = cur_lm{j-J_min+1}(1,el^2+el+el+1)/ ... 0070 (sqrt(1./2.)* sqrt((2*el+1)/(8.0*pi*pi))) ; 0071 end 0072 end 0073 0074 0075 % Set for the output figures: 0076 pltroot = '../../../figs/' ; 0077 configstr = ['Spin',int2str(args.Spin),... 0078 '_L',int2str(L),'_B',int2str(B),... 0079 '_Jmin',int2str(J_min)]; 0080 0081 0082 % 0083 xi =0:0.01:L-1; 0084 x = 0:L-1; 0085 % ------------ 0086 % Plot the tiling of the scaling function: 0087 % ------------ 0088 figure('Position',[100 100 900 450]) 0089 yi = interp1(x, kappa0_cur, xi,'pchip'); 0090 semilogx(xi, yi, 'k', 'LineWidth', 2); 0091 %h = text(2, 1.07, 'k0', 'Color', [0 0 0]); 0092 hold on; 0093 % ------------ 0094 % Plot the tiling of the curvelet kernels : 0095 % ------------ 0096 for j = J_min:J 0097 colour = rand(1,3)*0.9; 0098 yi = interp1(x,kappa_cur(j+1,:),xi,'pchip'); 0099 plot(xi, yi, 'LineWidth', 2, 'Color', colour); 0100 %h = text(B.^j, 1.07, strcat('j',num2str(j+1)), 'Color', colour); 0101 end 0102 0103 %title('Harmonic tiling'); 0104 %xlabel('l'); 0105 axis([0 L -0.05 1.15]); 0106 set(gca,'XTick',2.^[0:(J+2)]); 0107 fname = [pltroot,'s2let_plot_cur_tiling_', configstr, '.png'] 0108 print('-r200', '-dpng', fname); 0109 0110 0111 0112 % ---------------------------- 0113 % Plot the scaling function in real space: 0114 % ---------------------------- 0115 nx = 3; 0116 ny = 3; 0117 [thetas, phis, n, ntheta, nphi] = ssht_sampling(L); 0118 figure('Position',[100 100 900 200]) 0119 h = subplot(nx, ny, 1); 0120 f = ssht_inverse(scal_l, L, 'Reality', true); 0121 plot(thetas, f(:,1), '-k', 'LineWidth', 2) 0122 mx = 1.1*max(f(:,1)); 0123 axis([0 3. -mx/8 mx ]) 0124 0125 % ---------------------------- 0126 % Plot the curvelet kernels in real space: 0127 % ---------------------------- 0128 Jmax = J; 0129 for j = J_min:Jmax 0130 h = subplot(nx, ny, j-J_min+2); 0131 hold on 0132 flm = zeros(L^2,1); 0133 for el = el_min:L-1 0134 flm(el^2+el+1,1) = kappa_cur(j+1,el+1); 0135 end 0136 f = ssht_inverse(flm, L, 'Reality', true); 0137 plot(thetas, f(:,1), '-k', 'LineWidth', 2) 0138 mx = 1.1*max(f(:,1)); 0139 axis([0 3. -mx/1.5 mx ]) 0140 end 0141 fname = [pltroot,'s2let_plot_cur_tiling_fn_real', configstr, '.png'] 0142 print('-r200', '-dpng', fname); 0143 0144 end 0145