Skip to content
Snippets Groups Projects
Commit 7353b052 authored by Wolfgang Ludwig's avatar Wolfgang Ludwig
Browse files

Fixed some bugs in the fitting package

parent bb97e924
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ par.fit_global_rotwedge = false;
par.fit_grain_position = true;
par.fit_grain_orientation = true;
par.fit_grain_strain = true;
par.fit_grain_strain = false;
par.fit_drift_posX = false;
par.fit_drift_posY = false;
......
......@@ -156,8 +156,8 @@ for ii = 1:length(grain)
grain{ii}.fsim.plref = [plref, plref, plref, plref];
grain{ii}.fsim.refind = [refind, refind, refind, refind];
grain{ii}.fsim.hklspind = grain{ii}.fsim.refind;
grain{ii}.fsim.thetatype = [cryst.thetatypesp, cryst.thetatypesp, ...
cryst.thetatypesp, cryst.thetatypesp];
grain{ii}.fsim.thetatype = [cryst.thetatypesp', cryst.thetatypesp', ...
cryst.thetatypesp', cryst.thetatypesp'];
grain{ii}.fsim.hklind = grain{ii}.fsim.thetatype;
else
......@@ -276,13 +276,12 @@ for ii = 1:length(grain)
grain{ii}.fsim.plref = [plref, plref, plref, plref];
grain{ii}.fsim.refind = [refind, refind, refind, refind];
grain{ii}.fsim.hklspind = grain{ii}.fsim.refind;
grain{ii}.fsim.thetatype = [cryst.thetatypesp, cryst.thetatypesp, ...
cryst.thetatypesp, cryst.thetatypesp];
grain{ii}.fsim.thetatype = [cryst.thetatypesp', cryst.thetatypesp', ...
cryst.thetatypesp', cryst.thetatypesp'];
grain{ii}.fsim.hklind = grain{ii}.fsim.thetatype;
end
% Set NaN for spots that fall outside the detector area
if ~offdet
offd = (uv(1,:) <= 0.5) | (labgeo.detsizeu+0.5 <= uv(1,:)) | ...
......@@ -293,19 +292,19 @@ for ii = 1:length(grain)
grain{ii}.fsim.(fn{jj})(:,offd) = NaN;
end
end
% Delete spots with NaN values (no reflection (omega=NaN) or off
% the detector)
if ~keepNaN
if ~keepNaN
todel = isnan(grain{ii}.fsim.cu);
fn = fieldnames(grain{ii}.fsim);
for jj = 1:length(fn)
grain{ii}.fsim.(fn{jj})(:,todel) = [];
end
end
end
......
......@@ -102,8 +102,12 @@ if ~exist('spin','var') || isempty(spin)
fprintf('Loading diff. spot data from difspottable %s ...\n', difspottable)
gtDBConnect;
mysqlcmd = sprintf('SELECT difspotID,CentroidX,CentroidY,CentroidImage,BoundingBoxXsize,BoundingBoxYsize', ...
'BoundingBoxXOrigin, BoundingBoxYOrigin, Integral FROM %s ORDER BY difspotID',difspottable);
mysqlcmd = sprintf([ ...
'SELECT difspotID, CentroidX, CentroidY, CentroidImage, ' ...
' BoundingBoxXsize, BoundingBoxYsize, BoundingBoxXOrigin, ' ...
' BoundingBoxYOrigin, Integral ' ...
'FROM %s ' ...
'ORDER BY difspotID'], difspottable);
[spin.id, spin.cu, spin.cv, spin.cw, spin.bbx, spin.bby, spin.bbxo, spin.bbyo, spin.int] = mym(mysqlcmd);
end
......
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