Skip to content
GitLab
Menu
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
0cb609aa
Commit
0cb609aa
authored
Oct 05, 2010
by
Thomas White
Browse files
compare_hkl: Get denominator correct for resolution shell graph
.. I think?
parent
60640f82
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/compare_hkl.c
View file @
0cb609aa
...
...
@@ -54,6 +54,7 @@ static void plot_shells(const double *ref1, const double *ref2,
double
den
[
NBINS
];
double
rmin
,
rmax
,
rstep
;
int
i
;
double
dentot
;
FILE
*
fh
;
if
(
cell
==
NULL
)
{
...
...
@@ -90,6 +91,27 @@ static void plot_shells(const double *ref1, const double *ref2,
}
rstep
=
(
rmax
-
rmin
)
/
NBINS
;
dentot
=
0
.
0
;
for
(
i
=
0
;
i
<
num_items
(
items
);
i
++
)
{
struct
refl_item
*
it
;
signed
int
h
,
k
,
l
;
double
i1
,
i2
,
f1
,
f2
;
it
=
get_item
(
items
,
i
);
h
=
it
->
h
;
k
=
it
->
k
;
l
=
it
->
l
;
i1
=
lookup_intensity
(
ref1
,
h
,
k
,
l
);
if
(
i1
<
0
.
0
)
continue
;
f1
=
sqrt
(
i1
);
i2
=
lookup_intensity
(
ref2
,
h
,
k
,
l
);
if
(
i2
<
0
.
0
)
continue
;
f2
=
sqrt
(
i2
);
dentot
+=
(
f1
+
f2
)
/
2
.
0
;
}
for
(
i
=
0
;
i
<
num_items
(
items
);
i
++
)
{
struct
refl_item
*
it
;
...
...
@@ -113,16 +135,16 @@ static void plot_shells(const double *ref1, const double *ref2,
f2
=
sqrt
(
i2
);
num
[
bin
]
+=
fabs
(
f1
-
f2
);
den
[
bin
]
+
=
fabs
(
f1
+
f2
)
/
2
.
0
;
den
[
bin
]
=
dentot
;
}
for
(
i
=
0
;
i
<
NBINS
;
i
++
)
{
double
r
2
,
cen
;
double
r
,
cen
;
cen
=
rmin
+
rstep
*
i
+
rstep
/
2
.
0
;
r
2
=
num
[
i
]
/
den
[
i
];
fprintf
(
fh
,
"%f %f
\n
"
,
cen
/
1.0e-10
,
r
2
*
100
.
0
);
r
=
num
[
i
]
/
den
[
i
];
fprintf
(
fh
,
"%f %f
\n
"
,
cen
/
1.0e-10
,
r
*
100
.
0
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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