Skip to content

Commit

Permalink
Merge pull request #1 from ralfHielscher/master
Browse files Browse the repository at this point in the history
bug fixes for release 4.0
  • Loading branch information
ralfHielscher committed Oct 17, 2014
2 parents 39ac1b6 + 0b894f8 commit c106cd4
Show file tree
Hide file tree
Showing 35 changed files with 160 additions and 115 deletions.
2 changes: 1 addition & 1 deletion EBSDAnalysis/@EBSD/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

datacursormode on;

if isNew, mtexFig.drawNow('position','large',varargin{:}); end
if isNew, mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:}); end
mtexFig.keepAspectRatio = false;

end
Expand Down
2 changes: 1 addition & 1 deletion EBSDAnalysis/@grain2d/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

datacursormode on;

if isNew, mtexFig.drawNow('position','large',varargin{:}); end
if isNew, mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:}); end
mtexFig.keepAspectRatio = false;

end
Expand Down
2 changes: 1 addition & 1 deletion EBSDAnalysis/@grainBoundary/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@
axis(mP.ax,'tight'); set(mP.ax,'zlim',[0,1]);

if nargout == 0, clear h; end
if isNew, mtexFig.drawNow('position','large',varargin{:}); end
if isNew, mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:}); end
mtexFig.keepAspectRatio = false;
2 changes: 1 addition & 1 deletion ODFAnalysis/@ODF/plotIPDF.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function plotIPDF(odf,r,varargin)

if isNew % finalize plot

mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
setappdata(gcf,'inversePoleFigureDirection',r);
setappdata(gcf,'CS',odf.CS);
setappdata(gcf,'SS',odf.SS);
Expand Down
2 changes: 1 addition & 1 deletion ODFAnalysis/@ODF/plotODF.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function plotODF(odf,varargin)
setappdata(gcf,'h',h);
end

mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});

end

Expand Down
2 changes: 1 addition & 1 deletion ODFAnalysis/@ODF/plotPDF.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function plotPDF(odf,h,varargin)
setappdata(gcf,'h',h);
set(gcf,'Name',['Pole figures of "',inputname(1),'"']);

mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
end

% -------------- Tooltip function ---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion PoleFigureAnalysis/@PoleFigure/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ function plot(pf,varargin)
setappdata(gcf,'CS',pf.CS);
set(gcf,'Name',['Pole Figures of Specimen ',inputname(1)]);
set(gcf,'Tag','pdf');
mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
end
2 changes: 1 addition & 1 deletion examples/PoleFigureDemo.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

close;figure('position',[100 100 900 300])
plot(pf)

colorbar

%% Extract information from imported pole figure data
%
Expand Down
2 changes: 1 addition & 1 deletion examples/SeismicsMultiplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@

% add colorbars to all plots
colorbar
drawNow(gcm,'position','auto')
drawNow(gcm,'figSize','large')

%%
%
Expand Down
18 changes: 8 additions & 10 deletions examples/geometry_demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
%%
% *plotting*

close;figure('position',[43 362 300 300])
plot([v,w],'FontSize',20)
close all
plot([v,w])

%% Rotations

Expand All @@ -47,10 +47,6 @@
rot \ v
rot2 = rot * rot

%%
% *plotting*

scatter([rot rot2])

%%
% *Basic Functions*
Expand All @@ -69,7 +65,9 @@
SS = specimenSymmetry ('mmm');

% load from a cif file
loadCIF('quartz')
CS = loadCIF('quartz')



%%
% *Basic Functions*
Expand All @@ -81,8 +79,8 @@

%%
% *plotting*
set(gcf,'position',[50,50,400,400]);
plot(CS,'FontSize',15,'antipodal')

plot(CS)

%%
%
Expand All @@ -104,7 +102,7 @@
eq(h1,h2)
angle(h1,h2,'antipodal')
symmetrise(h)
plot([h1,h2],'all','labeled')
plot([h1,h2],'all','labeled','backGroundColor','w')

%% Orientations

Expand Down
7 changes: 6 additions & 1 deletion geometry/@DelaunaySO3/DelaunaySO3.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
classdef (InferiorClasses = {?rotation,?quaternion}) DelaunaySO3 < orientation

%
% Syntax
%
% % define a Delaunay trinangulation from a list of orientations
% DSO3 = DelaunaySO3(ori)
%
properties

tetra % list of vertices of the tetrahegons
Expand Down
2 changes: 1 addition & 1 deletion geometry/@crystalSymmetry/plotHKL.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ function plotHKL(s,varargin)
% postprocess figure
setappdata(gcf,'CS',s);
set(gcf,'tag','ipdf');
mtexFig.drawNow('position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});

48 changes: 25 additions & 23 deletions geometry/@orientation/calcODF.m
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
function odf = calcODF(ori,varargin)
% calculate ODF from individuel orientations via kernel density estimation
% computes an ODF from individuel orientations
%
% *calcODF* is one of the core function of the MTEX toolbox.
% It estimates an ODF from a set of individual crystal orientations by
% <EBSD2odf.html kernel density estimation>.
% The function *calcODF* applies one of the following algorithms to compute
% an ODF from a list of orientations.
%
% The function *calcODF* has several options to control the halfwidth of
% the kernel functions, the resolution, etc. Most important the estimated
% ODF is affected by the *halfwidth* of the kernel function.
%
% If the halfwidth is large the estimated ODF is smooth whereas a small halfwidth
% results in a sharp ODF. It depends on your prior information about the
% ODF to choose this parameter right. Look at this
% <EBSDSimulation_demo.html description> for exhausive discussion.
% # direct kernel density estimation
% # kernel density estimation via Fourier series
% # Bingham estimation
%
% Syntax
% calcODF(ori)
%
% % use kernel density estimation with a 10 degree kernel
% odf = calcODF(ori,'halfwidth',10*degree)
%
% % use a specific kernel
% psi = AbelPoissonKernel('halfwidth',10*degree)
% odf = calcODF(ori,'kernel',psi)
%
% % compute the ODF as a Fourier series of order 16
% odf = calcODF(ori,'order',16)
%
% Input
% ori - @orientation
% ebsd - @EBSD
%
% Output
% odf - @ODF
%
% Options
% HALFWIDTH - halfwidth of the kernel function
% RESOLUTION - resolution of the grid where the ODF is approximated
% KERNEL - kernel function (default -- de la Valee Poussin kernel)
% L/HARMONICDEGREE - (if Fourier) order up to which Fourier coefficients are calculated
% halfwidth - halfwidth of the kernel function
% resolution - resolution of the grid where the ODF is approximated
% kernel - kernel function (default -- de la Valee Poussin kernel)
% order - order up to which Fourier coefficients are calculated
%
% Flags
% SILENT - no output
% EXACT - no approximation to a corser grid
% FOURIER - force Fourier method
% BINGHAM - model bingham odf
% silent - no output
% exact - no approximation to a corser grid
% Fourier - force Fourier method
% Bingham - model bingham odf
% noFourier - no Fourier method
%
% See also
% ebsd_demo EBSD2odf EBSDSimulation_demo loadEBSD ODF/calcEBSD EBSD/calcKernel kernel/kernel
% orientation/calcFourierODF orientation/calcKernelODF orientation/calcBinghamODF ebsd_demo EBSD2odf EBSDSimulation_demo

% Bingham ODF estimation
if check_option(varargin,'bingham')
Expand Down
2 changes: 1 addition & 1 deletion geometry/@orientation/plotIPDF.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function plotIPDF(o,varargin)
end

if isNew
mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
end

% --------------- Tooltip function ------------------
Expand Down
2 changes: 1 addition & 1 deletion geometry/@orientation/plotODF.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ function plotODF(o,varargin)
setappdata(gcf,'h',h);
end

mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
end

2 changes: 1 addition & 1 deletion geometry/@orientation/plotPDF.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function plotPDF(o,h,varargin)

end

if isNew, mtexFig.drawNow('Position','auto',varargin{:}); end
if isNew, mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:}); end

% ----------- Tooltip function ------------------------
function txt = tooltip(varargin)
Expand Down
4 changes: 2 additions & 2 deletions geometry/@sphericalRegion/sphericalRegion.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
sR.N = [sR.N,vector3d('theta',90*degree,'rho',[90*degree+minRho,maxRho-90*degree])];
sR.alpha = [sR.alpha,0,0];
end


if check_option(varargin,{'complete','3d'}), sR = sphericalRegion; end
if check_option(varargin,'upper'), sR = sR.restrict2Upper; end
if check_option(varargin,'lower'), sR = sR.restrict2Lower; end
if check_option(varargin,{'complete','3d'}), sR = sphericalRegion; end

end

Expand Down
2 changes: 1 addition & 1 deletion geometry/@symmetry/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function plot(s,varargin)
set(ax,'xlim',1.1*get(ax,'xlim'));
set(ax,'ylim',1.1*get(ax,'ylim'));
end
mtexFig.drawNow('position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});

hold off

Expand Down
14 changes: 12 additions & 2 deletions geometry/@tensor/plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,17 @@ function plot(T,varargin)
end
end

[vp,vs1,vs2,pp,ps1,ps2] = velocity(T,S2); %#ok<ASGLU>
if isfield(T.opt,'density')
rho = T.opt.density;
elseif check_option(varargin,'density')
rho = get_option(varargin,'density',1);
else
error(['No density given! For computing wave velocities '...
'the material density has to be specified. ' ...
'Please use the option ..''density'',value.. to do this.']);
end

[vp,vs1,vs2,pp,ps1,ps2] = velocity(T,S2,rho); %#ok<ASGLU>
d = eval(get_option(varargin,'velocity','pp','char'));

otherwise
Expand Down Expand Up @@ -149,6 +159,6 @@ function plot(T,varargin)

set(gcf,'tag','tensor');

if isNew, mtexFig.drawNow('position','auto',varargin{:}); end
if isNew, mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:}); end

%plot(S2,'data',d,'antipodal','smooth',varargin{:});
9 changes: 9 additions & 0 deletions geometry/@tensor/plotS2Grid.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function S2G = plotS2Grid(T,varargin)
% define a plotting grid suitable for tensor plots

if iseven(T.rank)
varargin = [varargin,'antipodal'];
end

sR = fundamentalSector(T.CS,varargin{:});
S2G = plotS2Grid(sR,varargin{:});
6 changes: 6 additions & 0 deletions geometry/@tensor/quiverGrid.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function S2G = quiverGrid(T,varargin)

if iseven(T.rank), varargin = [varargin,'antipodal']; end
sR = fundamentalSector(T.CS,varargin{:});
S2G = equispacedS2Grid('resolution',10*degree,'no_center','antipodal',varargin{:});
S2G = S2G(sR.checkInside(S2G));
6 changes: 3 additions & 3 deletions geometry/@tensor/velocity.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@

end

pp = vector3d(pp);
ps1 = vector3d(ps1);
ps2 = vector3d(ps2);
pp = vector3d(pp,'antipodal');
ps1 = vector3d(ps1,'antipodal');
ps2 = vector3d(ps2,'antipodal');
2 changes: 1 addition & 1 deletion geometry/@vector3d/quiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function quiver(v, d, varargin )

% make the quiver plot

mhs = get_option(varargin,'MaxHeadSize',0.9);
mhs = get_option(varargin,'MaxHeadSize',0.9*d.antipodal);
arrowSize = get_option(varargin,'arrowSize',0.03);

proj = sP(j).proj;
Expand Down
2 changes: 1 addition & 1 deletion geometry/@vector3d/scatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

if isappdata(sP(1).parent,'mtexFig')
mtexFig = getappdata(sP(1).parent,'mtexFig');
mtexFig.drawNow('Position','auto',varargin{:});
mtexFig.drawNow('figSize',getMTEXpref('figSize'),varargin{:});
end
end

Expand Down
7 changes: 6 additions & 1 deletion geometry/@vector3d/subsref.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
v.x = subsref(v.x,s(1));
v.y = subsref(v.y,s(1));
v.z = subsref(v.z,s(1));


if v.isOption('plot')
v.opt = rmfield(v.opt,{'theta','rho','plot','resolution'});
end


if numel(s)>1
[varargout{1:nargout}] = builtin('subsref',v,s(2:end));
else
Expand Down
15 changes: 10 additions & 5 deletions geometry/@vector3d/vector3d.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@

function v = vector3d(x,y,z,varargin)
% Constructor
% Syntax
% v = vector3d(1,2,3)
%
% Syntax
% v = vector3d(x,y,z)
%
% Input
% x,y,z - cart. coordinates
% v - @vector3d
% empty -> vector3d(0,0,0)
%
% Flags
% antipodal - consider vector as an axis and not as an direction
%
% See also
% AxialDirectional

if nargin == 0
elseif nargin ==1
elseif nargin <= 2
if isa(x,'vector3d') % copy-constructor
[v.x,v.y,v.z] = double(x);
v.antipodal = x.antipodal;
Expand Down
Loading

0 comments on commit c106cd4

Please sign in to comment.