0001 function s2let_plot_curvelet_parametric(alpha, beta, gamma, B, L, J_min, varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 p = inputParser;
0042 p.addRequired('alpha', @isnumeric);
0043 p.addRequired('beta', @isnumeric);
0044 p.addRequired('gamma', @isnumeric);
0045 p.addRequired('B', @isnumeric);
0046 p.addRequired('L', @isnumeric);
0047 p.addRequired('J_min', @isnumeric);
0048 p.addParamValue('Spin', 0, @isnumeric);
0049 p.addParamValue('SpinLowered', false, @islogical);
0050 p.addParamValue('SpinLoweredFrom', 0, @isnumeric);
0051 p.addParamValue('Reality', false, @islogical);
0052 p.addParamValue('Sampling', 'MW', @ischar);
0053 p.parse(alpha, beta, gamma, B, L, J_min, varargin{:});
0054 args = p.Results;
0055
0056 B = args.B ;
0057 L = args. L;
0058 J_min = args.J_min;
0059 J = s2let_jmax(L, B);
0060
0061 original_spin = 0 ;
0062 if (args.SpinLowered ~= 0)
0063 original_spin= args.SpinLoweredFrom;
0064 end
0065 el_min = max(abs(args.Spin), abs(original_spin));
0066
0067
0068 d = zeros(L, 2*L-1, 2*L-1);
0069 d(1,:,:) = ssht_dl(squeeze(d(1,:,:)), L, 0, args.beta);
0070 for el = 1:L-1
0071 d(el+1,:,:) = ssht_dl(squeeze(d(el,:,:)), L, el, args.beta);
0072 end
0073
0074
0075 zoomfactor = 0.5;
0076 plot_caxis_scale = 2;
0077 sampling_method = args.Sampling;
0078 sphere_plot_type = 'parametric';
0079 sphere_plot_lighting = true;
0080 sphere_plot_scale = 1;
0081
0082 plot_component = @(x) real(x);
0083
0084 nx = 3;
0085 ny = 5;
0086 maxfigs = nx*ny;
0087 pltroot = '../../../figs/' ;
0088 configstr = ['Spin',int2str(args.Spin),...
0089 '_L',int2str(L),'_B',int2str(B),...
0090 '_Jmin',int2str(J_min)];
0091
0092
0093 [cur_lm scal_l] = s2let_curvelet_tiling(B, L, J_min, ...
0094 'Spin', args.Spin, ...
0095 'SpinLowered', args.SpinLowered,...
0096 'SpinLoweredFrom', args.SpinLoweredFrom);
0097
0098
0099
0100
0101
0102 if args.Spin == 0
0103 for j = J_min:J,
0104
0105 flm_cur_rot = ssht_rotate_flm(cur_lm{j-J_min+1}(:), d, args.alpha, args.gamma);
0106
0107 f_cur_rot = ssht_inverse(flm_cur_rot, L, 'Method', args.Sampling, 'Spin', args.Spin, 'Reality', true);
0108
0109 figure;
0110 ssht_plot_sphere(plot_component(f_cur_rot), L, ...
0111 'Lighting', sphere_plot_lighting, ...
0112 'Type', sphere_plot_type, ...
0113 'ParametricScale', sphere_plot_scale, ...
0114 'ParametricMin', true, ...
0115 'Method', sampling_method, ...
0116 'ColourBar', true);
0117 title(['Curvelet j = ',int2str(j-J_min+1)])
0118 v = caxis;
0119 temp = max(abs(v));
0120 caxis([-temp temp]*plot_caxis_scale);
0121 zoom(zoomfactor)
0122 view(90,20)
0123 end
0124 end
0125
0126
0127 if (args.Spin ~= 0)
0128 ind =0 ;
0129 figure;
0130 for j = J_min:J,
0131
0132 flm_cur_rot = ssht_rotate_flm(cur_lm{j-J_min+1}(:), d, args.alpha, args.gamma);
0133 f_cur_rot = ssht_inverse(flm_cur_rot, L, 'Method', args.Sampling,...
0134 'Spin', args.Spin,'Reality', args.Reality);
0135 ind = ind + 1;
0136 h = subplot(ny, nx, ind);
0137 if ind <= maxfigs
0138 h = subplot(ny, nx, ind);
0139 ssht_plot_sphere(plot_component(f_cur_rot), L, ...
0140 'Lighting', sphere_plot_lighting, ...
0141 'Type', sphere_plot_type, ...
0142 'ParametricScale', sphere_plot_scale, ...
0143 'ParametricMin', true, ...
0144 'Method', sampling_method, ...
0145 'ColourBar', true);
0146
0147 title(h, ['Spin Curvelet j = ',int2str(j-J_min+1), ', real part'])
0148 locate = get(h,'title');
0149 pos = get(locate,'position');
0150 pos(1,2) = pos(1,2)+0.7;
0151 pos(1,1) = pos(1,1)-0.7;
0152 set(locate,'pos',pos);
0153 v = caxis;
0154 temp = max(abs(v));
0155 caxis([-temp temp]*plot_caxis_scale)
0156 zoom(zoomfactor)
0157 view(70,26)
0158 end
0159
0160
0161 plot_component = @(x) imag(x);
0162 ind = ind + 1;
0163 if ind <= maxfigs
0164 h = subplot(ny, nx, ind);
0165 ssht_plot_sphere(plot_component(f_cur_rot), L, ...
0166 'Lighting', sphere_plot_lighting, ...
0167 'Type', sphere_plot_type, ...
0168 'ParametricScale', sphere_plot_scale, ...
0169 'ParametricMin', true, ...
0170 'Method', sampling_method, ...
0171 'ColourBar', true);
0172 title(h, ['Spin Curvelet j = ',int2str(j-J_min+1), ', imag part'])
0173 locate = get(h,'title');
0174 pos = get(locate,'position');
0175 pos(1,2) = pos(1,2)+0.7;
0176 pos(1,1) = pos(1,1)-0.7;
0177 set(locate,'pos',pos);
0178 v = caxis;
0179 temp = max(abs(v));
0180 caxis([-temp temp]*plot_caxis_scale)
0181 zoom(zoomfactor)
0182 view(70,26)
0183 end
0184
0185 plot_component = @(x) abs(x);
0186 ind = ind + 1;
0187 if ind <= maxfigs
0188 h = subplot(ny, nx, ind);
0189 ssht_plot_sphere(plot_component(f_cur_rot), L, ...
0190 'Lighting', sphere_plot_lighting, ...
0191 'Type', sphere_plot_type, ...
0192 'ParametricScale', sphere_plot_scale, ...
0193 'ParametricMin', true, ...
0194 'Method', sampling_method, ...
0195 'ColourBar', true);
0196 title(h, ['Spin Curvelet j = ',int2str(j-J_min+1), ', abs part'])
0197 locate = get(h,'title');
0198 pos = get(locate,'position');
0199 pos(1,2) = pos(1,2)+0.7;
0200 pos(1,1) = pos(1,1)-0.7;
0201 set(locate,'pos',pos);
0202 v = caxis;
0203 temp = max(abs(v));
0204 caxis([-temp temp]*plot_caxis_scale)
0205 zoom(zoomfactor)
0206 view(70,26)
0207 end
0208 end
0209 end
0210
0211 colormap(jet)
0212 fname = [pltroot,'s2let_plotfn_', configstr, '_cur_jet.png']
0213 print('-r200', '-dpng', fname);
0214
0215
0216
0217
0218 plot_component = @(x) real(x);
0219 figure('Position',[100 100 300 300])
0220 h=subplot(1, 1, 1);
0221 f_scal = ssht_inverse(scal_l, L, 'Reality', true);
0222 ssht_plot_sphere(plot_component(f_scal), L, ...
0223 'Lighting', sphere_plot_lighting, ...
0224 'Type', sphere_plot_type, 'ParametricScale', sphere_plot_scale, ...
0225 'Method', sampling_method, ...
0226 'ColourBar', true);
0227
0228 title(h,'Scaling function')
0229 zoom(zoomfactor)
0230 v = caxis;
0231 temp = max(abs(v));
0232 caxis([-temp temp]*plot_caxis_scale)
0233 view(0,-10)
0234
0235 colormap(jet)
0236 fname = [pltroot,'s2let_plotfn_', configstr, '_scal_jet.png']
0237 print('-r200', '-dpng', fname);
0238