Skip to content
Snippets Groups Projects
Commit 4fdd9d05 authored by Laura Nervo's avatar Laura Nervo Committed by Nicola Vigano
Browse files

Adapt the code to the changed output 'theta' instead of 'twotheta' of gtCalculateTwotheta

A bit of formatting for gtCalculateTwotheta and gtSymmetricReflections.

Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@963 4c865b51-4357-4376-afb4-474e03ccb993
parent 8ae23442
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,7 @@ if all(isfield(geo, FEDgeofields)) && codeflag
omstep = 180/acq.nproj;
% given a hkl plane, calculate the interplanar distance.
[~,twotheta] = gtCalculateDist(hkl,parameters.cryst,parameters.acq.energy);
Theta = twotheta/2;
[~,Theta] = gtCalculateDist(hkl,parameters.cryst,parameters.acq.energy);
sinth = sind(Theta);
% calc Omega angles
......
function [dsp,twotheta] = gtCalculateDist(hkl,cryst,energy)
function [dsp,theta] = gtCalculateDist(hkl,cryst,energy)
% GTCALCULATEDIST Calculates d-spacing and twice the Bragg angle for a given hkl
% [dsp,twotheta] = gtCalculateDist(hkl,cryst,energy)
% --------------------------------------------------
% GTCALCULATEDIST Calculates d-spacing and the Bragg angle for a given hkl
% [dsp,theta] = gtCalculateDist(hkl,cryst,energy)
% -----------------------------------------------
%
% INPUT:
% hkl - row vector of Miller indices;
% size 1x3 or 1x4 for hexagonal
% cryst.latticepar - lattice parameters
% cryst.spacegroup - spacegroup
% cryst.hermann_mauguin - Hermann-Mauguin symbol
% energy - beam energy in keV
% hkl = row vector of Miller indices;
% size 1x3 or 1x4 for hexagonal
% cryst.latticepar = lattice parameters
% cryst.spacegroup = spacegroup
% cryst.hermann_mauguin = Hermann-Mauguin symbol
% energy = beam energy in keV
%
% OUTPUT:
% dsp - d-spacing of the specified hkl family
% twotheta - twice the Bragg angle of the specified hkl family
%
% dsp = d-spacing of the specified hkl family
% theta = the Bragg angle of the specified hkl family
%
%
% Version 006 10-12-2012 by LNervo
% Changed output from twotheta to theta
%
% Version 005 14-05-2012 by LNervo
% Remove crystal_system calculation
%
......@@ -128,7 +132,7 @@ end
% d-spacing
dsp = 1/(invdsp2)^0.5;
% 2theta
twotheta = 2*asind(lambda/(2*dsp));
% theta from the Bragg's law
theta = asind(lambda/(2*dsp));
end % end of function
function results=gtDetectorTwotheta(parameters, phaseID)
% GTCALCULATETWOTHETA Returns reflections and theta values on detector
% [twotheta,results]=gtDetectorTwotheta(parameters, phaseID)
% results=gtDetectorTwotheta(parameters, phaseID)
% ----------------------------------------------------------
% INPUT:
% parameters
......@@ -44,8 +44,6 @@ disp(['Saved xop reflections: ' num2str(size(parameters.xop(phaseID).hkl,1))]
results=[];
hkl = gtFindFamilies(parameters,'hkl', phaseID);
%tt = gtFindFamilies(parameters,'twotheta', phaseID);
%d0 = gtFindFamilies(parameters,'dspacing', phaseID);
int = gtFindFamilies(parameters,'int', phaseID);
mult = gtFindFamilies(parameters,'mult', phaseID);
......@@ -89,7 +87,7 @@ disp(['Families on the detector: ' num2str(size(hkl,1))])
disp('Now reflections are sorted by increasing theta values')
results.hkl = hkl;
results.theta = tt/2;
results.theta = tt;
results.dspacing = d0;
results.int = int;
results.thetatype = thtype;
......
......@@ -5,26 +5,35 @@ function results = gtSymmetricReflections(cryst,energy)
% ----------------------------------------------
%
% INPUT:
% cryst.hkl - row vector of Miller indices;
% cryst.crystal_system - crystal system of lattice
% size nx3 or nx4 for hexagonal
% cryst.latticepar - lattice parameters
% cryst.spacegroup - spacegroup
% cryst.hermann_mauguin - Hermann-Mauguin symbol
% energy - beam energy in keV
% cryst.hkl = row vector of Miller indices;
% cryst.crystal_system = crystal system of lattice
% size nx3 or nx4 for hexagonal
% cryst.latticepar = lattice parameters
% cryst.spacegroup = spacegroup
% cryst.hermann_mauguin = Hermann-Mauguin symbol
% energy = beam energy in keV
%
% MODIFICATIONS
% 14-03-2012 by PReischig
% OUTPUT:
% results = structure with fields:
% .hklsp
% .thetasp
% .dspacingsp
% .thetatypesp
% .intsp
% .mult
%
%
% Version 003 14-03-2012 by PReischig
% Adapted to gtCalculateDist.
%
% 08-03-2012 by PReischig
% Version 002 08-03-2012 by PReischig
% Changed input format: separated 'parameters' into 'cryst' and
% 'energy'.
%
% 27-04-2012 by A King
% Version 001 27-04-2012 by AKing
% recalculate multiplicities here because possible errors arising
% from how xop dat file is processed
%
hkltypes_used = cryst.hkl;
hkltypes_used = double(hkltypes_used);
......@@ -56,12 +65,12 @@ end
for j = 1:size(hklsp,1)
% calculate d-spacing and twotheta for each reflection
[dsp(j), twoth(j)] = gtCalculateDist(hklsp(j,:), cryst, energy);
[dsp(j), theta(j)] = gtCalculateDist(hklsp(j,:), cryst, energy);
end
% simpler output (should ditch the hashtable)
results.hklsp = hklsp;
results.thetasp = twoth'/2;
results.thetasp = theta';
results.dspacingsp = dsp';
results.thetatypesp = thtype;
results.intsp = int;
......
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