aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Aquila <andrew.aquila@cfel.de>2011-08-03 13:48:32 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:35 +0100
commitd8cda669297841e6d920c20300404e10816a8f3f (patch)
tree302292085dd2fdf6d553b639c1518f6e599202f5 /src
parent7d294dca8bbf4a464cabb058d8ea68f759441481 (diff)
Change logic in powder_plot to make q_min and q_max work.
Diffstat (limited to 'src')
-rw-r--r--src/powder_plot.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/powder_plot.c b/src/powder_plot.c
index bdf9b040..c668814e 100644
--- a/src/powder_plot.c
+++ b/src/powder_plot.c
@@ -952,13 +952,13 @@ int main(int argc, char *argv[])
} else if ( strcmp(datatype, "hkl") == 0 ) {
data_type = PLOT_HKL;
need_pdb = 1;
- if ((hist_info.q_min <= 0.0) || (hist_info.q_max <= 0.0)) {
+ if ((hist_info.q_min < 0.0) || (hist_info.q_max < 0.0)) {
need_geometry = 1;
}
} else if ( strcmp(datatype, "d") == 0 ) {
data_type = PLOT_D;
- if ((hist_info.q_min <= 0.0) || (hist_info.q_max <= 0.0)) {
+ if ((hist_info.q_min < 0.0) || (hist_info.q_max < 0.0)) {
need_geometry = 1;
}
@@ -985,12 +985,6 @@ int main(int argc, char *argv[])
"bins\n");
return 1;
}
- if ( hist_info.q_min > hist_info.q_max ) {
- ERROR("the minimum q value of: %e "
- "is greator then your max q value of: %e\n",
- hist_info.q_min, hist_info.q_max);
- return 1;
- }
/* Get geometry, beam and pdb files and parameters as needed */
if ( need_geometry ) {
@@ -1055,12 +1049,18 @@ int main(int argc, char *argv[])
free(sym_str);
/* Set up histogram info*/
- if (hist_info.q_min <= 0.0 ) {
+ if (hist_info.q_min < 0.0 ) {
hist_info.q_min = smallest_q(&image);
}
- if (hist_info.q_max <= 0.0 ) {
+ if (hist_info.q_max < 0.0 ) {
hist_info.q_max = largest_q(&image);
}
+ if ( hist_info.q_min >= hist_info.q_max ) {
+ ERROR("the minimum q value of: %e "
+ "is greator then your max q value of: %e\n",
+ hist_info.q_min, hist_info.q_max);
+ return 1;
+ }
if (hist_info.spacing == LINEAR) {
hist_info.q_delta = (hist_info.q_max - hist_info.q_min)/
hist_info.histsize;