From 06aac2e9e85b226c61d06ab63dce525f39bec6fe Mon Sep 17 00:00:00 2001
From: Nicola Vigano <vigano@yoda.esrf.fr>
Date: Sat, 14 May 2016 16:28:59 +0200
Subject: [PATCH] Omega prediction: do not compute stuff that is not emitted

Signed-off-by: Nicola Vigano <vigano@yoda.esrf.fr>
---
 7_fed2/gtFedPredictOmegaMultiple.m | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/7_fed2/gtFedPredictOmegaMultiple.m b/7_fed2/gtFedPredictOmegaMultiple.m
index 44ef0ea8..4f23664d 100644
--- a/7_fed2/gtFedPredictOmegaMultiple.m
+++ b/7_fed2/gtFedPredictOmegaMultiple.m
@@ -115,20 +115,22 @@ if (~isempty(omind))
 
     % ROTATION MATRICES AND PLANE NORMALS IN LAB
 
-    % Get rotation matrix and multpily the input plane normals to get
-    % them in the diffracting position
-    rot = gtMathsRotationTensor(om, rotcomp);
+    if (nargout > 1)
+        % Get rotation matrix and multiply the input plane normals to get
+        % them in the diffracting position
+        rot = gtMathsRotationTensor(om, rotcomp);
 
-    % expand for multiplication
-    plt = reshape(pl, 1, 3, []);
-    plt = plt([1 1 1], :, :);
+        % expand for multiplication
+        plt = reshape(pl, 1, 3, []);
+        plt = plt([1 1 1], :, :);
 
-    plrot = rot .* plt;
-    plrot = sum(plrot, 2);
-    plrot = reshape(plrot, 3, []);
+        plrot = rot .* plt;
+        plrot = sum(plrot, 2);
+        plrot = reshape(plrot, 3, []);
 
-    plrot    = ss3 .* plrot;
-    plsigned = ss3 .* pl;
+        plrot    = ss3 .* plrot;
+        plsigned = ss3 .* pl;
+    end
 else
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     %%% All four omega indices
-- 
GitLab