Commit ec2444d9 authored by Thomas White's avatar Thomas White
Browse files

Fussiness

parent ece683eb
......@@ -32,9 +32,6 @@
#include "image.h"
static void show_help(const char *s)
{
printf("Syntax: %s [options]\n\n", s);
......@@ -100,7 +97,7 @@ static void plot_histogram(double *vals, int n, float hist_min, float hist_max,
min = hist_min;
max = hist_max;
}
STATUS("min max nbins: \n %f %f %i\n", min, max, nbins);
STATUS("min max nbins: %f %f %i\n", min, max, nbins);
min--; max++;
for ( i=0; i<nbins; i++ ) {
......@@ -563,34 +560,44 @@ int main(int argc, char *argv[])
model = reflist_new();
if ( histo != NULL ) {
int r;
r = sscanf(histo, "%i,%i,%i", &hist_h, &hist_k, &hist_l);
if ( r != 3 ) {
ERROR("Invalid indices for '--histogram'\n");
return 1;
}
space_for_hist = n_total_patterns * num_equivs(sym, NULL);
hist_vals = malloc(space_for_hist * sizeof(double));
free(histo);
STATUS("Histogramming %i %i %i -> ", hist_h, hist_k, hist_l);
/* Put into the asymmetric cell for the target group */
get_asymm(sym, hist_h, hist_k, hist_l,
&hist_h, &hist_k, &hist_l);
STATUS("%i %i %i\n", hist_h, hist_k, hist_l);
}
if ( histo_params != NULL ) {
int rr;
rr = sscanf(histo_params, "%f,%f,%i", &hist_min, &hist_max, &hist_nbins);
rr = sscanf(histo_params, "%f,%f,%i", &hist_min, &hist_max,
&hist_nbins);
if ( rr != 3 ) {
ERROR("Invalid parameters for '--hist-parameters'\n");
return 1;
}
free(histo_params);
if ( (hist_max - hist_min) <=0 ) {
ERROR("Invalid range for '--hist-parameters' : check if min<max \n");
if ( hist_max <= hist_min ) {
ERROR("Invalid range for '--hist-parameters'. "
"Make sure that 'max' is greater than 'min'.\n");
return 1;
}
}
hist_i = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment