-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from ralfHielscher/master
mtex 4.3.0
- Loading branch information
Showing
139 changed files
with
2,912 additions
and
871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function [ebsdGrid,newId] = gridify(ebsd,varargin) | ||
% extend EBSD data to an grid | ||
% | ||
% Syntax | ||
% [ebsdGrid,newId] = gridify(ebsd) | ||
% | ||
% Input | ||
% | ||
% Output | ||
% ebsdGrid - | ||
% newId - | ||
|
||
% generate regular grid | ||
prop = ebsd.prop; | ||
ext = ebsd.extend; | ||
dx = max(ebsd.unitCell(:,1))-min(ebsd.unitCell(:,1)); | ||
dy = max(ebsd.unitCell(:,2))-min(ebsd.unitCell(:,2)); | ||
[prop.x,prop.y] = meshgrid(linspace(ext(1),ext(2),1+round((ext(2)-ext(1))/dx)),... | ||
linspace(ext(3),ext(4),1+round((ext(4)-ext(3))/dy))); % ygrid runs first | ||
sGrid = size(prop.x); | ||
|
||
% detect position within grid | ||
newId = sub2ind(sGrid, 1 + round((ebsd.prop.y - ext(3))/dy), ... | ||
1 + round((ebsd.prop.x - ext(1))/dx)); | ||
|
||
% set phaseId to notIndexed at all empty grid points | ||
phaseId = nan(sGrid); | ||
phaseId(newId) = ebsd.phaseId; | ||
|
||
% update rotations | ||
a = nan(sGrid); b = a; c = a; d = a; | ||
a(newId) = ebsd.rotations.a; | ||
b(newId) = ebsd.rotations.b; | ||
c(newId) = ebsd.rotations.c; | ||
d(newId) = ebsd.rotations.d; | ||
|
||
% update all other properties | ||
for fn = fieldnames(ebsd.prop).' | ||
if any(strcmp(char(fn),{'x','y','z'})), continue;end | ||
if isnumeric(prop.(char(fn))) | ||
prop.(char(fn)) = nan(sGrid); | ||
else | ||
prop.(char(fn)) = prop.(char(fn)).nan(sGrid); | ||
end | ||
prop.(char(fn))(newId) = ebsd.prop.(char(fn)); | ||
end | ||
|
||
ebsdGrid = EBSDsquare(rotation(quaternion(a,b,c,d)),phaseId(:),... | ||
ebsd.phaseMap,ebsd.CSList,[dx,dy],'options',prop); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function h = quiver(ebsd,dir,varargin) | ||
% plot directions at ebsd centers | ||
% | ||
% Syntax | ||
% quiver(ebsd,dir,'linecolor','r') | ||
% | ||
% mtexdata small | ||
% quiver(ebsd,ebsd.rotations.axis) | ||
% | ||
% Input | ||
% ebsd - @grain2d | ||
% dir - @vector3d | ||
% | ||
% Options | ||
% antipodal - | ||
% maxHeadSize | ||
% | ||
|
||
xy = [ebsd.prop.x(:),ebsd.prop.y(:)]; | ||
|
||
if check_option(varargin,'antipodal') || dir.antipodal | ||
|
||
varargin = [{'MaxHeadSize',0,'linewidth',2,'autoScaleFactor',0.5},varargin]; | ||
xy = [xy;xy]; | ||
dir = [dir(:);-dir(:)]; | ||
|
||
else | ||
|
||
varargin = [{'MaxHeadSize',5,'linewidth',2,'autoScaleFactor',0.5},varargin]; | ||
|
||
end | ||
|
||
h = optiondraw(quiver(xy(:,1),xy(:,2),dir.x,dir.y),varargin{:}); | ||
|
||
if nargout == 0, clear h; end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.