From d8cda669297841e6d920c20300404e10816a8f3f Mon Sep 17 00:00:00 2001 From: Andrew Aquila Date: Wed, 3 Aug 2011 13:48:32 +0200 Subject: Change logic in powder_plot to make q_min and q_max work. --- src/powder_plot.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/powder_plot.c') 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; -- cgit v1.2.3