Skip to content
Snippets Groups Projects
Commit c60b934b authored by Nicola Vigano's avatar Nicola Vigano
Browse files

gtCalculateGrain: Passing full info to produced "grain" structure

parent beff7d39
No related branches found
No related tags found
No related merge requests found
......@@ -59,11 +59,6 @@ app.usestrain = false;
app = parse_pv_pairs(app,varargin);
% if ~isfield(grain, 'full') || isempty(grain.full)
% grain.full = app.overlay;
% end
grain.full = [];
% If strain data is not available, disable strain
if ~isfield(grain,'strain') || ~isfield(grain.strain,'strainT') || ...
isnan(grain.strain.strainT(1,1))
......@@ -150,22 +145,25 @@ end
% Four omegas of the plane normal (1-3 and 2-4 are the two Friedel pairs):
% pls is plus or minus pl, and St is the rotation tensor per each omega
[om4, pllab4, pls4, St4] = gtFedPredictOmegaMultiple(pl, sinth, beamdir, rotdir, rotcomp, []);
[om4, pllab4, pls4, St4, omind4] = gtFedPredictOmegaMultiple(pl, sinth, beamdir, rotdir, rotcomp, []);
% Delete those where no reflection occurs
todel = (isnan(om4(1, :)) | isnan(om4(3, :)));
om4(:, todel) = [];
omind4(:, todel) = [];
sinth(todel) = [];
theta(todel) = [];
pllab4(:, todel, :) = [];
pls4(:, todel, :) = [];
St4(:, :, todel, :) = [];
pl(:, todel) = [];
thetatypesp = cryst.thetatypesp(~todel);
hkl = cryst.hkl(:, thetatypesp)';
hklsp = cryst.hklsp(:, ~todel);
om = reshape(om4', [], 1)';
omind = reshape(omind4', [], 1)';
sinth = reshape(sinth, [], 1);
theta = reshape(theta, [], 1);
pllab = reshape(pllab4, 3, []);
......@@ -198,17 +196,21 @@ uvw = gtFedPredictUVWMultiple(St, dveclab, csam_v, detpos, detnorm, Qdet, uvorig
% Initialse output variables
grain.allblobs.uvw = uvw';
grain.allblobs.uv = uvw(1:2, :)';
grain.allblobs.plorig = [pl'; pl'; pl'; pl'];
grain.allblobs.pl = pls';
grain.allblobs.pllab = pllab';
grain.allblobs.hkl = [hkl; hkl; hkl; hkl];
grain.allblobs.hklsp = [hklsp'; -hklsp'; hklsp'; -hklsp'];
grain.allblobs.sintheta = [sinth; sinth; sinth; sinth];
grain.allblobs.theta = [theta; theta; theta; theta];
grain.allblobs.thetatype = [thetatypesp; thetatypesp; thetatypesp; thetatypesp];
grain.allblobs.thetatype = [thetatypesp'; thetatypesp'; thetatypesp'; thetatypesp'];
grain.allblobs.omega = om';
grain.allblobs.omind = omind';
grain.allblobs.dvec = dveclab';
grain.allblobs.srot = St;
grain.full = [];
% Visual Feedback
if (app.showfigure)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment