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
50b3fdf3
Commit
50b3fdf3
authored
11 years ago
by
Laura Nervo
Browse files
Options
Downloads
Patches
Plain Diff
Small formatting fixing...
Signed-off-by:
Laura Nervo
<
laura.nervo@esrf.fr
>
parent
87023b08
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
zUtil_Cryst/gtVectorCryst2Lab.m
+2
-2
2 additions, 2 deletions
zUtil_Cryst/gtVectorCryst2Lab.m
zUtil_Parameters/gtSubList.m
+16
-12
16 additions, 12 deletions
zUtil_Parameters/gtSubList.m
zUtil_Parameters/make_parameters.m
+23
-24
23 additions, 24 deletions
zUtil_Parameters/make_parameters.m
with
41 additions
and
38 deletions
zUtil_Cryst/gtVectorCryst2Lab.m
+
2
−
2
View file @
50b3fdf3
...
@@ -56,7 +56,7 @@ elseif isnumeric(mode)
...
@@ -56,7 +56,7 @@ elseif isnumeric(mode)
elseif
ischar
(
mode
)
&&
strcmp
(
mode
,
'diag'
)
elseif
ischar
(
mode
)
&&
strcmp
(
mode
,
'diag'
)
if
M
~=
N
if
M
~=
N
gtError
(
'gtVectorCryst2Lab:wrong_mode'
,
...
gtError
(
'gtVectorCryst2Lab:wrong_mode'
,
...
[
'
''
diag
''
mode needs as many vectors as matrices!'
]
);
'
''
diag
''
mode needs as many vectors as matrices!'
);
end
end
diag
=
true
;
diag
=
true
;
else
else
...
@@ -113,7 +113,7 @@ elseif M > 1 && N > 1
...
@@ -113,7 +113,7 @@ elseif M > 1 && N > 1
Vc
=
reshape
(
Vc
.'
,
[
3
1
1
M
]);
Vc
=
reshape
(
Vc
.'
,
[
3
1
1
M
]);
% Multiply and sum along 1st axis to reproduce Vs = Vc . g
% Multiply and sum along 1st axis to reproduce Vs = Vc . g
Vs
=
permute
(
squeeze
(
sum
(
bsxfun
(
@
times
,
Vc
,
g
),
1
)),
[
mode
]
);
Vs
=
permute
(
squeeze
(
sum
(
bsxfun
(
@
times
,
Vc
,
g
),
1
)),
mode
);
else
else
gtError
(
'gtVectorCryst2Lab:wrong_input_size'
,
...
gtError
(
'gtVectorCryst2Lab:wrong_input_size'
,
...
...
...
This diff is collapsed.
Click to expand it.
zUtil_Parameters/gtSubList.m
+
16
−
12
View file @
50b3fdf3
function
sublist
=
gtSubList
(
list
,
varargin
)
function
sublist
=
gtSubList
(
list
,
varargin
)
% GTSUBLIST Creates sub-list to give to gtModifyStructure
% sublist = gtSubList(list, varargin)
% -----------------------------------
% based on a list created using make_parameters / build_list,
% make a sublist suitable for gtModifyStructure, containing only the
% requested fields.
%
%
% based on a list created using make_parameters / build_list,
% input, for example: gtSubList(list.acq, 'name', 'dir', energy')
% make a sublist suitable for gtModifyStructure, containing only the
% output: sublist, a 3x2 cell for gtModifyStructure
% requested fields.
%
% input, for example: gtSubList(list.acq, 'name', 'dir', energy')
% output: sublist, a 3x2 cell for gtModifyStructure
% preallocate sublist
% preallocate sublist
sublist
=
cell
(
length
(
varargin
),
2
);
sublist
=
cell
(
length
(
varargin
),
2
);
for
i
=
1
:
length
(
varargin
)
for
i
i
=
1
:
length
(
varargin
)
ndx
=
find
(
strcmp
(
list
(:,
1
),
varargin
{
i
}));
ndx
=
find
(
strcmp
(
list
(:,
1
),
varargin
{
i
i
}));
if
~
isempty
(
ndx
)
if
~
isempty
(
ndx
)
sublist
{
i
,
1
}
=
list
{
ndx
,
1
};
sublist
{
i
i
,
1
}
=
list
{
ndx
,
1
};
sublist
{
i
,
2
}
=
list
{
ndx
,
2
};
sublist
{
i
i
,
2
}
=
list
{
ndx
,
2
};
else
else
disp
(
sprintf
(
'problem with input to gtSubList - field name
%s
not found in main list'
,
varargin
{
i
})
)
disp
(
[
'problem with input to gtSubList - field name
'
varargin
{
ii
}
'
not found in main list'
]
)
end
end
end
end
\ No newline at end of file
end
% end of function
This diff is collapsed.
Click to expand it.
zUtil_Parameters/make_parameters.m
+
23
−
24
View file @
50b3fdf3
function
[
parameters
,
list
]
=
make_parameters
(
version
)
function
[
parameters
,
list
]
=
make_parameters
(
version
)
% MAKE_PARAMETERS Create a parameters.mat file with empty fields
% MAKE_PARAMETERS Create a parameters.mat file with empty fields
% [parameters, list] = make_parameters(version
,debug
)
% [parameters, list] = make_parameters(version)
% ---------------------------------------------
------
% ---------------------------------------------
%
%
% INPUT:
% INPUT:
% version = -1 (load a specific .mat file)
% version = -1 (load a specific .mat file)
...
@@ -18,26 +18,25 @@ function [parameters, list] = make_parameters(version)
...
@@ -18,26 +18,25 @@ function [parameters, list] = make_parameters(version)
% Creates a .mat file with description for each field in the parameters.mat to be used with gtModifyStructure.m
% Creates a .mat file with description for each field in the parameters.mat to be used with gtModifyStructure.m
%
%
disp
(
'Getting the field list of parameters...'
)
disp
(
'Getting the field list of parameters...'
)
switch
(
version
)
switch
(
version
)
case
-
1
case
-
1
filename
=
inputwdefault
(
'Insert filepath of the mat file to load'
,
...
filename
=
inputwdefault
(
'Insert filepath of the mat file to load'
,
...
'./parameters.mat'
);
'./parameters.mat'
);
pars
=
load
(
filename
,
'parameters'
);
pars
=
load
(
filename
,
'parameters'
);
pars
=
pars
.
parameters
;
pars
=
pars
.
parameters
;
list
=
complete_structure
(
pars
,
[],
true
,
'__'
);
list
=
complete_structure
(
pars
,
[],
true
,
'__'
);
parameters
=
build_structure
(
list
,
'__'
);
parameters
=
build_structure
(
list
,
'__'
);
case
0
case
0
list
=
build_list_v0
();
list
=
build_list_v0
();
parameters
=
build_structure
(
list
,
'__'
);
parameters
=
build_structure
(
list
,
'__'
);
case
1
case
1
list
=
build_list_v1
();
list
=
build_list_v1
();
parameters
=
build_structure
(
list
,
'__'
);
parameters
=
build_structure
(
list
,
'__'
);
case
2
case
2
list
=
build_list_v2
();
list
=
build_list_v2
();
parameters
=
build_structure
(
list
,
'__'
);
parameters
=
build_structure
(
list
,
'__'
);
parameters
.
version
.
number
=
2
;
parameters
.
version
.
number
=
2
;
end
end
end
% end of function
end
% end of function
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