Home > src > main > matlab > s2let_demo5.m

s2let_demo5

PURPOSE ^

s2let_demo5

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 s2let_demo5
 Compute and plot the harmonic tiling and the wavelet kernels, and output png figures.

 S2LET package to perform Wavelets on the Sphere.
 Copyright (C) 2012-2015  Boris Leistedt & Jason McEwen
 See LICENSE.txt for license details

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % s2let_demo5
0002 % Compute and plot the harmonic tiling and the wavelet kernels, and output png figures.
0003 %
0004 % S2LET package to perform Wavelets on the Sphere.
0005 % Copyright (C) 2012-2015  Boris Leistedt & Jason McEwen
0006 % See LICENSE.txt for license details
0007 
0008 B = 2;
0009 zoomfactor = 1.4;
0010 J_min = 2;
0011 L = 64;
0012 Spin = 0;
0013 N = 0;
0014 J = s2let_jmax(L, B);
0015 plot_caxis_scale = 20
0016 type = 'colour';
0017 lighting = false;
0018 
0019 ns = ceil(sqrt(2+J-J_min+1)) ;
0020 ny = 4;
0021 nx = 3;
0022 
0023 maxfigs = nx*ny;
0024 pltroot = '../../../figs'
0025 configstr = ['Spin',int2str(Spin),'_N',int2str(N),'_L',int2str(L),'_B',int2str(B),'_Jmin',int2str(J_min)]
0026 [psi_lm phi_l] = s2let_wavelet_tiling(B, L, N, Spin, J_min);
0027 
0028 figure('Position',[100 100 300 300])
0029 h=subplot(1, 1, 1);
0030 flm = zeros(L^2,1);
0031 for l = 0:L-1
0032     flm(l^2+l+1,1) = phi_l(l+1);
0033 end
0034 f = ssht_inverse(flm, L, 'Reality', true);
0035 ssht_plot_sphere(f, L, 'Type', type, 'Lighting', lighting);
0036 title(h,'Scaling fct')
0037 locate = get(h,'title');
0038 pos = get(locate,'position');
0039 pos(1,2) = pos(1,2)+0.7;
0040 pos(1,1) = pos(1,1)-0.7;
0041 set(locate,'pos',pos);
0042 zoom(1.2)%
0043 %v = caxis;
0044 %temp = max(abs(v));
0045 %caxis([-temp temp]*plot_caxis_scale)
0046 
0047 
0048 %colormap(jet)
0049 %fname = [pltroot,'/s2let_demo5_', configstr, '_scal_jet.png']
0050 %print('-r200', '-dpng', fname)
0051 %colormap(hot)
0052 %fname = [pltroot,'/s2let_demo5_', configstr, '_scal_hot.png']
0053 %print('-r200', '-dpng', fname)
0054 
0055 figure('Position',[100 100 1200 600])
0056 ind = 0;
0057 for j = J_min:J
0058    flm = psi_lm(:,j+1);
0059 
0060    if Spin == 0
0061        f = ssht_inverse(flm, L, 'Reality', true);
0062        ind = ind + 1;
0063        if ind <= maxfigs
0064            h = subplot(ny, nx, ind);
0065            ssht_plot_sphere(f, L, 'Type', type, 'Lighting', lighting);
0066            title(h, ['Wavelet j = ',int2str(j-J_min+1)])
0067            locate = get(h,'title');
0068            pos = get(locate,'position');
0069            pos(1,2) = pos(1,2)+0.7;
0070            pos(1,1) = pos(1,1)-0.7;
0071            set(locate,'pos',pos);
0072            %v = caxis;
0073            %temp = max(abs(v));
0074            %caxis([-temp temp]*plot_caxis_scale)
0075            %zoom(zoomfactor)
0076        end
0077    end
0078    if Spin > 0
0079        f = ssht_inverse(flm, L, 'spin', Spin);
0080        ind = ind + 1;
0081        if ind <= maxfigs
0082            h = subplot(ny, nx, ind);
0083            ssht_plot_sphere(real(f), L, 'Type', type, 'Lighting', lighting);
0084            title(h, ['Wavelet j = ',int2str(j-J_min+1), ', real part'])
0085            locate = get(h,'title');
0086            pos = get(locate,'position');
0087            pos(1,2) = pos(1,2)+0.7;
0088            pos(1,1) = pos(1,1)-0.7;
0089            set(locate,'pos',pos);
0090            %v = caxis;
0091            %temp = max(abs(v));
0092            %caxis([-temp temp]*plot_caxis_scale)
0093            %zoom(zoomfactor)
0094        end
0095        ind = ind + 1;
0096        if ind <= maxfigs
0097            h = subplot(ny, nx, ind);
0098            ssht_plot_sphere(imag(f), L, 'Type', type, 'Lighting', lighting);
0099            title(h, ['Wavelet j = ',int2str(j-J_min+1), ', imag part'])
0100            locate = get(h,'title');
0101            pos = get(locate,'position');
0102            pos(1,2) = pos(1,2)+0.7;
0103            pos(1,1) = pos(1,1)-0.7;
0104            set(locate,'pos',pos);
0105            %v = caxis;
0106            %temp = max(abs(v));
0107            %caxis([-temp temp]*plot_caxis_scale)
0108            %zoom(zoomfactor)
0109        end
0110        
0111        ind = ind + 1;
0112        if ind <= maxfigs
0113            h = subplot(ny, nx, ind);
0114            ssht_plot_sphere(abs(f), L, 'Type', type, 'Lighting', lighting);
0115            title(h, ['Wavelet j = ',int2str(j-J_min+1), ', abs part'])
0116            locate = get(h,'title');
0117            pos = get(locate,'position'); 
0118            pos(1,2) = pos(1,2)+0.7;
0119            pos(1,1) = pos(1,1)-0.7;
0120            set(locate,'pos',pos);
0121            %v = caxis;
0122            %temp = max(abs(v));
0123            %caxis([-temp temp]*plot_caxis_scale)
0124            %zoom(zoomfactor)
0125        end
0126        
0127    end
0128 end
0129 
0130 
0131 colormap(jet)
0132 fname = [pltroot,'/s2let_demo5_', configstr, '_wav_jet.png']
0133 print('-r200', '-dpng', fname)
0134 colormap(hot)
0135 fname = [pltroot,'/s2let_demo5_', configstr, '_wav_hot.png']
0136 print('-r200', '-dpng', fname)
0137

Generated on Fri 11-Nov-2016 11:50:36 by m2html © 2005