Skip to content

Commit

Permalink
fixing some issues mentioned in #373
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfHielscher committed Oct 11, 2018
1 parent 0b842af commit ab1a365
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion S2Fun/@S2FunHarmonic/symmetrise.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

% maybe there is nothing to do
if sF.bandwidth == 0 || length(symX) == 1
sFs = S2FunHarmonicSym(sF.fhat, sym, varargin{:});
sFs = S2FunHarmonicSym(sF.fhat, sym);
return;
end

Expand Down
25 changes: 18 additions & 7 deletions geometry/@symmetry/calcAxisDistribution.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@
% See also

[oR,dcs,nSym] = fundamentalRegion(cs,varargin{:});
varargin = delete_option(varargin,'complete');
if isa(varargin{1},'symmetry'), varargin(1) = []; end


if nargin > 1 && isa(varargin{1},'vector3d')
varargin = delete_option(varargin,'complete');
h = varargin{1};
if ~isempty(varargin) && isa(varargin{1},'vector3d')

x = getValue(varargin{1});

else

f = @(h) getValue(h);
x = S2FunHarmonicSym.quadrature(f,dcs,'bandwidth',256,varargin{:});

end

function value = getValue(h)
h = project2FundamentalRegion(h,dcs);
omega = oR.maxAngle(h);
x = nSym * (omega - sin(omega)) ./ pi;
else
f = @(h) calcAxisDistribution(dcs,h,varargin{:});
x = S2FunHarmonicSym.quadrature(f,dcs,'bandwidth',128,varargin{:});
value = nSym * (omega - sin(omega)) ./ pi;

This comment has been minimized.

Copy link
@kilir

kilir Jan 14, 2019

Contributor

if it were value = nSym * (omega - sin(omega)) ./ pi ./ 2;, the distribution mean would be 1. See: #392

end

end
14 changes: 8 additions & 6 deletions geometry/plotAxisDistribution.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

[mtexFig,isNew] = newMtexFigure(varargin{:});

res = 2.5 * degree;
if isa(obj,'symmetry')
res = .5 * degree;
cs1 = obj;
if nargin > 1 && isa(varargin{1},'symmetry')
cs2 = varargin{1};
Expand Down Expand Up @@ -60,15 +62,15 @@

% plotting grid
sR = fundamentalSector(dcs,varargin{:});
h = plotS2Grid(sR,'resolution',res,varargin{:});

% plot
varargin = [delete_option(varargin,'complete'),dcs.plotOptions];
if isa(obj,'symmetry')
h = plotS2Grid(sR,'resolution',.5*degree,varargin{:});
density = pos(calcAxisDistribution(cs1,cs2,h,varargin{:}));
else
h = plotS2Grid(sR,'resolution',2.5*degree,varargin{:});
density = pos(calcAxisDistribution(obj,h,varargin{:}));
end

% plot
varargin = [delete_option(varargin,'complete'),dcs.plotOptions];
density = pos(calcAxisDistribution(obj,h,varargin{:}));
h = smooth(h,density,dcs,varargin{:});

end
Expand Down

0 comments on commit ab1a365

Please sign in to comment.