Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oleksii Turkot
CrystFEL
Commits
d7de985a
Commit
d7de985a
authored
Nov 13, 2019
by
Yaroslav Gevorkov
Browse files
rename "overriden" to "custom"
parent
21b12a07
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcrystfel/src/pinkindexer.c
View file @
d7de985a
...
...
@@ -157,7 +157,7 @@ void *pinkIndexer_prepare(IndexingMethod *indm, UnitCell *cell,
struct
pinkIndexer_options
*
pinkIndexer_opts
,
struct
detector
*
det
,
struct
beam_params
*
beam
)
{
if
(
beam
->
photon_energy_from
!=
NULL
&&
pinkIndexer_opts
->
overriden
PhotonEnergy
>
0
)
{
if
(
beam
->
photon_energy_from
!=
NULL
&&
pinkIndexer_opts
->
custom
PhotonEnergy
>
0
)
{
ERROR
(
"For pinkIndexer, the photon_energy must be defined as a "
"constant in the geometry file or a parameter
\n
"
);
return
NULL
;
...
...
@@ -206,11 +206,11 @@ void *pinkIndexer_prepare(IndexingMethod *indm, UnitCell *cell,
float
beamEenergy_eV
=
beam
->
photon_energy
;
float
nonMonochromaticity
=
beam
->
bandwidth
*
5
;
if
(
pinkIndexer_opts
->
overriden
PhotonEnergy
>
0
){
beamEenergy_eV
=
pinkIndexer_opts
->
overriden
PhotonEnergy
;
if
(
pinkIndexer_opts
->
custom
PhotonEnergy
>
0
){
beamEenergy_eV
=
pinkIndexer_opts
->
custom
PhotonEnergy
;
}
if
(
pinkIndexer_opts
->
overriden
Bandwidth
>=
0
){
nonMonochromaticity
=
pinkIndexer_opts
->
overriden
Bandwidth
;
if
(
pinkIndexer_opts
->
custom
Bandwidth
>=
0
){
nonMonochromaticity
=
pinkIndexer_opts
->
custom
Bandwidth
;
}
float
reflectionRadius_1_per_A
;
...
...
@@ -441,8 +441,8 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
(
*
opts_ptr
)
->
no_check_indexed
=
0
;
(
*
opts_ptr
)
->
min_peaks
=
2
;
(
*
opts_ptr
)
->
reflectionRadius
=
-
1
;
(
*
opts_ptr
)
->
overriden
PhotonEnergy
=
-
1
;
(
*
opts_ptr
)
->
overriden
Bandwidth
=
-
1
;
(
*
opts_ptr
)
->
custom
PhotonEnergy
=
-
1
;
(
*
opts_ptr
)
->
custom
Bandwidth
=
-
1
;
break
;
case
1
:
...
...
@@ -518,7 +518,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break
;
case
11
:
if
(
sscanf
(
arg
,
"%f"
,
&
(
*
opts_ptr
)
->
overriden
PhotonEnergy
)
!=
1
)
if
(
sscanf
(
arg
,
"%f"
,
&
(
*
opts_ptr
)
->
custom
PhotonEnergy
)
!=
1
)
{
ERROR
(
"Invalid value for --pinkIndexer-override-photon-energy
\n
"
);
return
EINVAL
;
...
...
@@ -526,7 +526,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break
;
case
12
:
if
(
sscanf
(
arg
,
"%f"
,
&
(
*
opts_ptr
)
->
overriden
Bandwidth
)
!=
1
)
if
(
sscanf
(
arg
,
"%f"
,
&
(
*
opts_ptr
)
->
custom
Bandwidth
)
!=
1
)
{
ERROR
(
"Invalid value for --pinkIndexer-override-bandwidth
\n
"
);
return
EINVAL
;
...
...
@@ -538,10 +538,10 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
ERROR
(
"Invalid value for --pinkIndexer-override-visible-energy-range
\n
"
);
return
EINVAL
;
}
(
*
opts_ptr
)
->
overriden
PhotonEnergy
=
(
tmp
+
tmp2
)
/
2
;
(
*
opts_ptr
)
->
overriden
Bandwidth
=
(
tmp2
-
tmp
)
/
(
*
opts_ptr
)
->
overriden
PhotonEnergy
;
if
((
*
opts_ptr
)
->
overriden
Bandwidth
<
0
){
(
*
opts_ptr
)
->
overriden
Bandwidth
*=
-
1
;
(
*
opts_ptr
)
->
custom
PhotonEnergy
=
(
tmp
+
tmp2
)
/
2
;
(
*
opts_ptr
)
->
custom
Bandwidth
=
(
tmp2
-
tmp
)
/
(
*
opts_ptr
)
->
custom
PhotonEnergy
;
if
((
*
opts_ptr
)
->
custom
Bandwidth
<
0
){
(
*
opts_ptr
)
->
custom
Bandwidth
*=
-
1
;
}
break
;
}
...
...
libcrystfel/src/pinkindexer.h
View file @
d7de985a
...
...
@@ -47,8 +47,8 @@ struct pinkIndexer_options {
int
min_peaks
;
int
no_check_indexed
;
float
reflectionRadius
;
/* In m^-1 */
float
overriden
PhotonEnergy
;
float
overriden
Bandwidth
;
float
custom
PhotonEnergy
;
float
custom
Bandwidth
;
};
#include
<stddef.h>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment