Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
f1f67516
Commit
f1f67516
authored
1 month ago
by
Zheheng Liu
Browse files
Options
Downloads
Patches
Plain Diff
some changes for gtCrystComputeExperimentalFamilyIntensities_v2
Signed-off-by:
Zheheng Liu
<
zheheng.liu@esrf.fr
>
parent
814e27b9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_Cryst/gtCrystComputeExperimentalFamilyIntensities_v2.m
+20
-15
20 additions, 15 deletions
zUtil_Cryst/gtCrystComputeExperimentalFamilyIntensities_v2.m
with
20 additions
and
15 deletions
zUtil_Cryst/gtCrystComputeExperimentalFamilyIntensities_v2.m
+
20
−
15
View file @
f1f67516
function
[
fams_ints
,
fams_ints_raw
,
usable
,
fams_counts
,
gr_vols
]
=
gtCrystComputeExperimentalFamilyIntensities_v2
(
phase_id
,
p
,
det_ind
,
varargin
)
function
[
fams_ints
,
fams_intsp
,
fams_ints_raw
,
usable
,
fams_counts
,
gr_vols
]
=
gtCrystComputeExperimentalFamilyIntensities_v2
(
phase_id
,
p
,
det_ind
,
varargin
)
% FUNCTION GTCRYSTCOMPUTEEXPERIMENTALFAMILYINTENSITIES_V2
% [fams_ints, fams_intsp, usable, fams_counts] = gtCrystComputeExperimentalFamilyIntensities_v2(phase_id, p, det_ind, varargin)
% [fams_ints, fams_intsp,
fams_ints_raw,
usable, fams_counts
, gr_vols
] = gtCrystComputeExperimentalFamilyIntensities_v2(phase_id, p, det_ind, varargin)
% INPUTS:
% phase_id = <int> Phase ID. The default is 1.
% p = <struct> The parameter structure.
% det_ind = <int> Detector index. The default is 1.
% OPTIONAL INPUTS:
% only_selected = <bool> If true, only selected spots will be
% considered. (The default is false)
% deselect_annealing_twin_shared_spots
% = <bool> If true, the spots shared by
% annealing twins will be deselected.
% fams_ints_norm = <int> Estimate the intensity of each hkl
% family by [1]: median spot intensity,
% or 2: average spot intensity.
% only_selected = <bool> [true]: only use selected spots;
% false: use all the included spots.
% use_spot2grain = <bool> [true]: deselect the shared spots
% indicated by spot2grain.mat;
% mu_att = <double> Attenuation coefficient. If empty,
% absorption volume will be used.
% flat_image = Flat image used for direct beam profile.
% If empty, it will be generated automatically.
% gr_ids = <int> ID of used grains.
% usedfam = <bool> Used hkl families.
% fams_counts_thres = <int> For each grain, only if the spots are
% more than this threshold, the hkl
% family will be used. Default: 4
% abs_vol = Absorption volume.
%
% 06-09-2021 by Zheheng. (based on Nicola's function gtCrystComputeExperimentalFamilyIntensities)
if
(
~
exist
(
'phase_id'
,
'var'
)
||
isempty
(
phase_id
))
...
...
@@ -25,11 +37,9 @@ function [fams_ints, fams_ints_raw, usable, fams_counts, gr_vols] = gtCrystCompu
conf
=
struct
(
...
'fams_ints_norm'
,
1
,
...
% 0 and 1 are median, 2 is average
'use_nullspace'
,
true
,
...
'only_selected'
,
true
,
...
% To use included spots or only use selected spots
'use_spot2grain'
,
true
,
...
% deselect the shared spots indicated by spot2grain.mat
'mu_att'
,
[],
...
% 32.2686 cm^-1 43.57keV Ni
'verbose'
,
false
,
...
'flat_image'
,
[],
...
'gr_ids'
,
[],
...
'usedfam'
,
[],
...
...
...
@@ -47,12 +57,6 @@ function [fams_ints, fams_ints_raw, usable, fams_counts, gr_vols] = gtCrystCompu
num_grains
=
numel
(
conf
.
gr_ids
);
end
% if conf.deselect_annealing_twin_shared_spots
% clusters = sfTwinClusters(conf.gr_ids, tot_grains, sample.phases{phase_id}.clusters);
% else
% clusters = num2cell(conf.gr_ids);
% end
fams_ints
=
nan
(
num_grains
,
numel
(
p
.
cryst
(
phase_id
)
.
int
));
fams_counts
=
zeros
(
num_grains
,
numel
(
p
.
cryst
(
phase_id
)
.
int
));
...
...
@@ -150,6 +154,7 @@ function [fams_ints, fams_ints_raw, usable, fams_counts, gr_vols] = gtCrystCompu
[
fams_ints
,
gr_vols
]
=
gtMathsEstimateCoefVecFromIncompDataMatByNullSpace
(
fams_ints
'
);
% fams_ints contain 1/sin(2theta), which is part of Lorentz factor.
fams_ints
=
fams_ints
'
.
/
sind
(
2
*
p
.
cryst
(
phase_id
)
.
theta
(
1
:
numel
(
fams_ints
)));
fams_intsp
=
fams_ints
(
p
.
cryst
(
phase_id
)
.
thetatypesp
);
fprintf
(
'Theoretical Intensities:\n'
);
disp
(
p
.
cryst
(
phase_id
)
.
int
/
norm
(
p
.
cryst
(
phase_id
)
.
int
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment