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
bbc99085
Commit
bbc99085
authored
Feb 20, 2012
by
Thomas White
Browse files
Fix output logic
parent
d8014c51
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/partial_sim.c
View file @
bbc99085
...
...
@@ -515,29 +515,31 @@ int main(int argc, char *argv[])
}
if
(
phist_file
!=
NULL
)
{
fh
=
fopen
(
phist_file
,
"w"
);
}
else
{
fh
=
NULL
;
}
if
(
fh
!=
NULL
)
{
for
(
i
=
0
;
i
<
NBINS
;
i
++
)
{
if
(
fh
!=
NULL
)
{
double
rcen
;
for
(
i
=
0
;
i
<
NBINS
;
i
++
)
{
rcen
=
i
/
(
double
)
NBINS
*
qargs
.
max_q
+
qargs
.
max_q
/
(
2
.
0
*
NBINS
);
fprintf
(
fh
,
"%.2f %7li %.3f %.3f
\n
"
,
rcen
/
1.0e9
,
qargs
.
n_ref
[
i
],
qargs
.
p_hist
[
i
]
/
qargs
.
n_ref
[
i
],
qargs
.
p_max
[
i
]);
double
rcen
;
}
rcen
=
i
/
(
double
)
NBINS
*
qargs
.
max_q
+
qargs
.
max_q
/
(
2
.
0
*
NBINS
);
fprintf
(
fh
,
"%.2f %7li %.3f %.3f
\n
"
,
rcen
/
1.0e9
,
qargs
.
n_ref
[
i
],
qargs
.
p_hist
[
i
]
/
qargs
.
n_ref
[
i
],
qargs
.
p_max
[
i
]);
}
fclose
(
fh
);
fclose
(
fh
);
}
else
{
ERROR
(
"Failed to open file '%s' for writing.
\n
"
,
phist_file
);
}
}
else
{
ERROR
(
"Failed to open file '%s' for writing.
\n
"
,
phist_file
);
}
fclose
(
ofh
);
...
...
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