Commit 86e621ad authored by Thomas White's avatar Thomas White
Browse files

Remove old reflections.h

parent eaee0f64
......@@ -26,7 +26,7 @@ LDADD = $(top_builddir)/lib/libgnu.a @IGNORE_UNUSED_LIBRARIES_CFLAGS@
src_pattern_sim_SOURCES = src/pattern_sim.c src/diffraction.c src/utils.c \
src/image.c src/cell.c src/hdf5-file.c \
src/detector.c src/peaks.c \
src/reflections.c src/beam-parameters.c \
src/reflist-utils.c src/beam-parameters.c \
src/symmetry.c src/thread-pool.c src/reflist.c
if HAVE_OPENCL
src_pattern_sim_SOURCES += src/diffraction-gpu.c src/cl-utils.c
......@@ -51,10 +51,10 @@ src_indexamajig_SOURCES = src/indexamajig.c src/hdf5-file.c src/utils.c \
src/cell.c src/image.c src/peaks.c src/index.c \
src/filters.c src/diffraction.c src/detector.c \
src/dirax.c src/mosflm.c \
src/reflections.c src/symmetry.c \
src/reflist-utils.c src/symmetry.c \
src/geometry.c src/thread-pool.c \
src/beam-parameters.c src/reflist.c src/stream.c \
src/reflist-utils.c
src/beam-parameters.c src/reflist.c src/stream.c
if HAVE_OPENCL
src_indexamajig_SOURCES += src/diffraction-gpu.c src/cl-utils.c
endif
......@@ -67,25 +67,25 @@ src_hdfsee_SOURCES = src/hdfsee.c src/dw-hdfsee.c src/render.c \
endif
src_get_hkl_SOURCES = src/get_hkl.c src/cell.c src/utils.c \
src/reflections.c src/symmetry.c src/beam-parameters.c \
src/thread-pool.c
src/reflist-utils.c src/symmetry.c src/beam-parameters.c \
src/thread-pool.c src/reflist.c
src_compare_hkl_SOURCES = src/compare_hkl.c src/cell.c src/utils.c \
src/reflections.c src/statistics.c src/symmetry.c \
src/thread-pool.c
src/reflist-utils.c src/statistics.c src/symmetry.c \
src/thread-pool.c src/reflist.c
src_check_hkl_SOURCES = src/check_hkl.c src/cell.c src/utils.c \
src/reflections.c src/statistics.c src/symmetry.c \
src/thread-pool.c
src/reflist-utils.c src/statistics.c src/symmetry.c \
src/thread-pool.c src/reflist.c
src_powder_plot_SOURCES = src/powder_plot.c src/cell.c src/utils.c src/image.c \
src/hdf5-file.c src/detector.c src/thread-pool.c \
src/beam-parameters.c
src_render_hkl_SOURCES = src/render_hkl.c src/cell.c src/reflections.c \
src/utils.c src/povray.c src/symmetry.c src/render.c \
src_render_hkl_SOURCES = src/render_hkl.c src/cell.c src/reflist-utils.c \
src/utils.c src/povray.c src/symmetry.c src/render.c \
src/hdf5-file.c src/image.c src/filters.c \
src/thread-pool.c
src/thread-pool.c src/reflist.c
src_sum_stack_SOURCES = src/sum_stack.c src/utils.c src/hdf5-file.c \
src/image.c src/filters.c src/peaks.c src/detector.c \
......@@ -97,10 +97,10 @@ src_calibrate_detector_SOURCES = src/calibrate_detector.c src/utils.c \
src_partialator_SOURCES = src/partialator.c src/cell.c src/hdf5-file.c \
src/utils.c src/detector.c src/peaks.c src/image.c \
src/geometry.c src/reflections.c src/stream.c \
src/geometry.c src/reflist-utils.c src/stream.c \
src/thread-pool.c src/beam-parameters.c \
src/symmetry.c src/post-refinement.c \
src/hrs-scaling.c src/reflist.c src/reflist-utils.c
src/hrs-scaling.c src/reflist.c
if BUILD_CUBEIT
src_cubeit_SOURCES = src/cubeit.c src/cell.c src/hdf5-file.c src/utils.c \
......@@ -115,7 +115,7 @@ tests_list_check_SOURCES = tests/list_check.c src/reflist.c src/thread-pool.c \
INCLUDES = "-I$(top_srcdir)/data"
EXTRA_DIST += src/cell.h src/hdf5-file.h src/image.h src/utils.h \
src/diffraction.h src/detector.h src/reflections.h \
src/diffraction.h src/detector.h src/reflist-utils.h \
src/list_tmp.h src/statistics.h src/dw-hdfsee.h \
src/render.h src/hdfsee.h src/dirax.h src/mosflm.h src/peaks.h \
src/index.h src/filters.h src/diffraction-gpu.h src/cl-utils.h \
......
......@@ -90,16 +90,17 @@ src_calibrate_detector_OBJECTS = $(am_src_calibrate_detector_OBJECTS)
src_calibrate_detector_LDADD = $(LDADD)
src_calibrate_detector_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_check_hkl_OBJECTS = src/check_hkl.$(OBJEXT) src/cell.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflections.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflist-utils.$(OBJEXT) \
src/statistics.$(OBJEXT) src/symmetry.$(OBJEXT) \
src/thread-pool.$(OBJEXT)
src/thread-pool.$(OBJEXT) src/reflist.$(OBJEXT)
src_check_hkl_OBJECTS = $(am_src_check_hkl_OBJECTS)
src_check_hkl_LDADD = $(LDADD)
src_check_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_compare_hkl_OBJECTS = src/compare_hkl.$(OBJEXT) \
src/cell.$(OBJEXT) src/utils.$(OBJEXT) \
src/reflections.$(OBJEXT) src/statistics.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT)
src/reflist-utils.$(OBJEXT) src/statistics.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT) \
src/reflist.$(OBJEXT)
src_compare_hkl_OBJECTS = $(am_src_compare_hkl_OBJECTS)
src_compare_hkl_LDADD = $(LDADD)
src_compare_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
......@@ -120,9 +121,9 @@ src_cubeit_OBJECTS = $(am_src_cubeit_OBJECTS)
src_cubeit_LDADD = $(LDADD)
src_cubeit_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_get_hkl_OBJECTS = src/get_hkl.$(OBJEXT) src/cell.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflections.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflist-utils.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/thread-pool.$(OBJEXT)
src/thread-pool.$(OBJEXT) src/reflist.$(OBJEXT)
src_get_hkl_OBJECTS = $(am_src_get_hkl_OBJECTS)
src_get_hkl_LDADD = $(LDADD)
src_get_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
......@@ -142,10 +143,9 @@ src_hdfsee_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am__src_indexamajig_SOURCES_DIST = src/indexamajig.c src/hdf5-file.c \
src/utils.c src/cell.c src/image.c src/peaks.c src/index.c \
src/filters.c src/diffraction.c src/detector.c src/dirax.c \
src/mosflm.c src/reflections.c src/symmetry.c src/geometry.c \
src/mosflm.c src/reflist-utils.c src/symmetry.c src/geometry.c \
src/thread-pool.c src/beam-parameters.c src/reflist.c \
src/stream.c src/reflist-utils.c src/diffraction-gpu.c \
src/cl-utils.c
src/stream.c src/diffraction-gpu.c src/cl-utils.c
@HAVE_OPENCL_TRUE@am__objects_1 = src/diffraction-gpu.$(OBJEXT) \
@HAVE_OPENCL_TRUE@ src/cl-utils.$(OBJEXT)
am_src_indexamajig_OBJECTS = src/indexamajig.$(OBJEXT) \
......@@ -153,35 +153,34 @@ am_src_indexamajig_OBJECTS = src/indexamajig.$(OBJEXT) \
src/image.$(OBJEXT) src/peaks.$(OBJEXT) src/index.$(OBJEXT) \
src/filters.$(OBJEXT) src/diffraction.$(OBJEXT) \
src/detector.$(OBJEXT) src/dirax.$(OBJEXT) \
src/mosflm.$(OBJEXT) src/reflections.$(OBJEXT) \
src/mosflm.$(OBJEXT) src/reflist-utils.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/geometry.$(OBJEXT) \
src/thread-pool.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/reflist.$(OBJEXT) src/stream.$(OBJEXT) \
src/reflist-utils.$(OBJEXT) $(am__objects_1)
src/reflist.$(OBJEXT) src/stream.$(OBJEXT) $(am__objects_1)
src_indexamajig_OBJECTS = $(am_src_indexamajig_OBJECTS)
src_indexamajig_LDADD = $(LDADD)
src_indexamajig_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_partialator_OBJECTS = src/partialator.$(OBJEXT) \
src/cell.$(OBJEXT) src/hdf5-file.$(OBJEXT) src/utils.$(OBJEXT) \
src/detector.$(OBJEXT) src/peaks.$(OBJEXT) src/image.$(OBJEXT) \
src/geometry.$(OBJEXT) src/reflections.$(OBJEXT) \
src/geometry.$(OBJEXT) src/reflist-utils.$(OBJEXT) \
src/stream.$(OBJEXT) src/thread-pool.$(OBJEXT) \
src/beam-parameters.$(OBJEXT) src/symmetry.$(OBJEXT) \
src/post-refinement.$(OBJEXT) src/hrs-scaling.$(OBJEXT) \
src/reflist.$(OBJEXT) src/reflist-utils.$(OBJEXT)
src/reflist.$(OBJEXT)
src_partialator_OBJECTS = $(am_src_partialator_OBJECTS)
src_partialator_LDADD = $(LDADD)
src_partialator_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am__src_pattern_sim_SOURCES_DIST = src/pattern_sim.c src/diffraction.c \
src/utils.c src/image.c src/cell.c src/hdf5-file.c \
src/detector.c src/peaks.c src/reflections.c \
src/detector.c src/peaks.c src/reflist-utils.c \
src/beam-parameters.c src/symmetry.c src/thread-pool.c \
src/reflist.c src/diffraction-gpu.c src/cl-utils.c
am_src_pattern_sim_OBJECTS = src/pattern_sim.$(OBJEXT) \
src/diffraction.$(OBJEXT) src/utils.$(OBJEXT) \
src/image.$(OBJEXT) src/cell.$(OBJEXT) src/hdf5-file.$(OBJEXT) \
src/detector.$(OBJEXT) src/peaks.$(OBJEXT) \
src/reflections.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/reflist-utils.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT) \
src/reflist.$(OBJEXT) $(am__objects_1)
src_pattern_sim_OBJECTS = $(am_src_pattern_sim_OBJECTS)
......@@ -205,11 +204,12 @@ src_process_hkl_OBJECTS = $(am_src_process_hkl_OBJECTS)
src_process_hkl_LDADD = $(LDADD)
src_process_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_render_hkl_OBJECTS = src/render_hkl.$(OBJEXT) \
src/cell.$(OBJEXT) src/reflections.$(OBJEXT) \
src/cell.$(OBJEXT) src/reflist-utils.$(OBJEXT) \
src/utils.$(OBJEXT) src/povray.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/render.$(OBJEXT) \
src/hdf5-file.$(OBJEXT) src/image.$(OBJEXT) \
src/filters.$(OBJEXT) src/thread-pool.$(OBJEXT)
src/filters.$(OBJEXT) src/thread-pool.$(OBJEXT) \
src/reflist.$(OBJEXT)
src_render_hkl_OBJECTS = $(am_src_render_hkl_OBJECTS)
src_render_hkl_LDADD = $(LDADD)
src_render_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
......@@ -558,7 +558,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = configure m4/gnulib-cache.m4 src/cell.h src/hdf5-file.h \
src/image.h src/utils.h src/diffraction.h src/detector.h \
src/reflections.h src/list_tmp.h src/statistics.h \
src/reflist-utils.h src/list_tmp.h src/statistics.h \
src/dw-hdfsee.h src/render.h src/hdfsee.h src/dirax.h \
src/mosflm.h src/peaks.h src/index.h src/filters.h \
src/diffraction-gpu.h src/cl-utils.h src/symmetry.h \
......@@ -588,7 +588,7 @@ AM_CPPFLAGS = -DDATADIR=\""$(datadir)"\" -I$(top_builddir)/lib -I$(top_srcdir)/l
LDADD = $(top_builddir)/lib/libgnu.a @IGNORE_UNUSED_LIBRARIES_CFLAGS@
src_pattern_sim_SOURCES = src/pattern_sim.c src/diffraction.c \
src/utils.c src/image.c src/cell.c src/hdf5-file.c \
src/detector.c src/peaks.c src/reflections.c \
src/detector.c src/peaks.c src/reflist-utils.c \
src/beam-parameters.c src/symmetry.c src/thread-pool.c \
src/reflist.c $(am__append_3)
@HAVE_OPENCL_TRUE@tests_gpu_sim_check_SOURCES = tests/gpu_sim_check.c src/utils.c \
......@@ -606,33 +606,33 @@ src_process_hkl_SOURCES = src/process_hkl.c src/statistics.c \
src_indexamajig_SOURCES = src/indexamajig.c src/hdf5-file.c \
src/utils.c src/cell.c src/image.c src/peaks.c src/index.c \
src/filters.c src/diffraction.c src/detector.c src/dirax.c \
src/mosflm.c src/reflections.c src/symmetry.c src/geometry.c \
src/mosflm.c src/reflist-utils.c src/symmetry.c src/geometry.c \
src/thread-pool.c src/beam-parameters.c src/reflist.c \
src/stream.c src/reflist-utils.c $(am__append_6)
src/stream.c $(am__append_6)
@BUILD_HDFSEE_TRUE@src_hdfsee_SOURCES = src/hdfsee.c src/dw-hdfsee.c src/render.c \
@BUILD_HDFSEE_TRUE@ src/hdf5-file.c src/utils.c src/image.c src/filters.c \
@BUILD_HDFSEE_TRUE@ src/thread-pool.c src/detector.c
src_get_hkl_SOURCES = src/get_hkl.c src/cell.c src/utils.c \
src/reflections.c src/symmetry.c src/beam-parameters.c \
src/thread-pool.c
src/reflist-utils.c src/symmetry.c src/beam-parameters.c \
src/thread-pool.c src/reflist.c
src_compare_hkl_SOURCES = src/compare_hkl.c src/cell.c src/utils.c \
src/reflections.c src/statistics.c src/symmetry.c \
src/thread-pool.c
src/reflist-utils.c src/statistics.c src/symmetry.c \
src/thread-pool.c src/reflist.c
src_check_hkl_SOURCES = src/check_hkl.c src/cell.c src/utils.c \
src/reflections.c src/statistics.c src/symmetry.c \
src/thread-pool.c
src/reflist-utils.c src/statistics.c src/symmetry.c \
src/thread-pool.c src/reflist.c
src_powder_plot_SOURCES = src/powder_plot.c src/cell.c src/utils.c src/image.c \
src/hdf5-file.c src/detector.c src/thread-pool.c \
src/beam-parameters.c
src_render_hkl_SOURCES = src/render_hkl.c src/cell.c src/reflections.c \
src/utils.c src/povray.c src/symmetry.c src/render.c \
src_render_hkl_SOURCES = src/render_hkl.c src/cell.c src/reflist-utils.c \
src/utils.c src/povray.c src/symmetry.c src/render.c \
src/hdf5-file.c src/image.c src/filters.c \
src/thread-pool.c
src/thread-pool.c src/reflist.c
src_sum_stack_SOURCES = src/sum_stack.c src/utils.c src/hdf5-file.c \
src/image.c src/filters.c src/peaks.c src/detector.c \
......@@ -644,10 +644,10 @@ src_calibrate_detector_SOURCES = src/calibrate_detector.c src/utils.c \
src_partialator_SOURCES = src/partialator.c src/cell.c src/hdf5-file.c \
src/utils.c src/detector.c src/peaks.c src/image.c \
src/geometry.c src/reflections.c src/stream.c \
src/geometry.c src/reflist-utils.c src/stream.c \
src/thread-pool.c src/beam-parameters.c \
src/symmetry.c src/post-refinement.c \
src/hrs-scaling.c src/reflist.c src/reflist-utils.c
src/hrs-scaling.c src/reflist.c
@BUILD_CUBEIT_TRUE@src_cubeit_SOURCES = src/cubeit.c src/cell.c src/hdf5-file.c src/utils.c \
@BUILD_CUBEIT_TRUE@ src/detector.c src/render.c src/filters.c src/image.c \
......@@ -803,12 +803,14 @@ src/calibrate_detector$(EXEEXT): $(src_calibrate_detector_OBJECTS) $(src_calibra
src/check_hkl.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/cell.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/reflections.$(OBJEXT): src/$(am__dirstamp) \
src/reflist-utils.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/statistics.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/symmetry.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/reflist.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/check_hkl$(EXEEXT): $(src_check_hkl_OBJECTS) $(src_check_hkl_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/check_hkl$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(src_check_hkl_OBJECTS) $(src_check_hkl_LDADD) $(LIBS)
......@@ -825,10 +827,6 @@ src/filters.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/stream.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/reflist.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/reflist-utils.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/cubeit$(EXEEXT): $(src_cubeit_OBJECTS) $(src_cubeit_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/cubeit$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(src_cubeit_OBJECTS) $(src_cubeit_LDADD) $(LIBS)
......@@ -948,7 +946,6 @@ mostlyclean-compile:
-rm -f src/povray.$(OBJEXT)
-rm -f src/powder_plot.$(OBJEXT)
-rm -f src/process_hkl.$(OBJEXT)
-rm -f src/reflections.$(OBJEXT)
-rm -f src/reflist-utils.$(OBJEXT)
-rm -f src/reflist.$(OBJEXT)
-rm -f src/render.$(OBJEXT)
......@@ -994,7 +991,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/povray.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/powder_plot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/process_hkl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/reflections.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/reflist-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/reflist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/render.Po@am__quote@
......
......@@ -22,9 +22,10 @@
#include <getopt.h>
#include "utils.h"
#include "reflections.h"
#include "statistics.h"
#include "symmetry.h"
#include "reflist.h"
#include "reflist-utils.h"
/* Number of bins for plot of resolution shells */
......@@ -46,9 +47,8 @@ static void show_help(const char *s)
}
static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
const char *sym, unsigned int *counts,
const double *sigma, double rmin_fix, double rmax_fix)
static void plot_shells(RefList *list, UnitCell *cell, const char *sym,
double rmin_fix, double rmax_fix)
{
double num[NBINS];
int cts[NBINS];
......@@ -70,6 +70,8 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
int nmeas = 0;
int nmeastot = 0;
int nout = 0;
Reflection *refl;
RefListIterator *iter;
if ( cell == NULL ) {
ERROR("Need the unit cell to plot resolution shells.\n");
......@@ -93,16 +95,17 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
mean[i] = 0;
}
rmin = +INFINITY;
rmax = 0.0;
for ( i=0; i<num_items(items); i++ ) {
/* Iterate over all common reflections and calculate min and max
* resolution */
rmin = +INFINITY; rmax = 0.0;
for ( refl = first_refl(list, &iter);
refl != NULL;
refl = next_refl(refl, iter) ) {
struct refl_item *it;
signed int h, k, l;
double d;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl, &h, &k, &l);
d = resolution(cell, h, k, l) * 2.0;
if ( d > rmax ) rmax = d;
......@@ -179,16 +182,16 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
free(counted);
/* Calculate means */
for ( i=0; i<num_items(items); i++ ) {
for ( refl = first_refl(list, &iter);
refl != NULL;
refl = next_refl(refl, iter) ) {
struct refl_item *it;
signed int h, k, l;
double d;
int bin;
int j;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl, &h, &k, &l);
d = resolution(cell, h, k, l) * 2.0;
......@@ -205,7 +208,7 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
}
measured[bin]++;
mean[bin] += lookup_intensity(ref, h, k, l);
mean[bin] += get_intensity(refl);
}
......@@ -214,21 +217,21 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
}
/* Characterise the data set */
for ( i=0; i<num_items(items); i++ ) {
for ( refl = first_refl(list, &iter);
refl != NULL;
refl = next_refl(refl, iter) ) {
struct refl_item *it;
signed int h, k, l;
double d;
int bin;
int j;
double val, esd;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl, &h, &k, &l);
d = resolution(cell, h, k, l) * 2.0;
val = lookup_intensity(ref, h, k, l);
esd = lookup_sigma(sigma, h, k, l);
val = get_intensity(refl);
esd = get_esd_intensity(refl);
bin = -1;
for ( j=0; j<NBINS; j++ ) {
......@@ -245,11 +248,11 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
if ( !isfinite(val/esd) ) continue;
/* measured[bin] was done earlier */
measurements[bin] += lookup_count(counts, h, k, l);
measurements[bin] += get_redundancy(refl);
snr[bin] += val / esd;
snr_total += val / esd;
nmeas++;
nmeastot += lookup_count(counts, h, k, l);
nmeastot += get_redundancy(refl);
var[bin] += pow(val-mean[bin], 2.0);
......@@ -289,17 +292,15 @@ static void plot_shells(const double *ref, ReflItemList *items, UnitCell *cell,
int main(int argc, char *argv[])
{
int c;
double *ref;
UnitCell *cell;
char *file = NULL;
char *sym = NULL;
int i;
ReflItemList *items;
ReflItemList *good_items;
RefList *raw_list;
RefList *list;
Reflection *refl;
RefListIterator *iter;
char *pdb = NULL;
double *esd;
int rej = 0;
unsigned int *cts;
float rmin_fix = -1.0;
float rmax_fix = -1.0;
......@@ -369,37 +370,35 @@ int main(int argc, char *argv[])
cell = load_cell_from_pdb(pdb);
free(pdb);
ref = new_list_intensity();
esd = new_list_sigma();
cts = new_list_count();
items = read_reflections(file, ref, NULL, cts, esd);
if ( items == NULL ) {
ERROR("Couldn't open file '%s'\n", file);
raw_list = read_reflections(file);
if ( raw_list == NULL ) {
ERROR("Couldn't read file '%s'\n", file);
return 1;
}
/* Check that the intensities have the correct symmetry */
if ( check_symmetry(items, sym) ) {
if ( check_list_symmetry(raw_list, sym) ) {
ERROR("The input reflection list does not appear to"
" have symmetry %s\n", sym);
return 1;
}
/* Reject reflections */
good_items = new_items();
for ( i=0; i<num_items(items); i++ ) {
/* Reject some reflections */
list = reflist_new();
for ( refl = first_refl(list, &iter);
refl != NULL;
refl = next_refl(refl, iter) ) {
struct refl_item *it;
signed int h, k, l;
double val, sig;
int ig = 0;
double d;
Reflection *new;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl, &h, &k, &l);
val = lookup_intensity(ref, h, k, l);
sig = lookup_sigma(esd, h, k, l);
val = get_intensity(refl);
sig = get_esd_intensity(refl);
if ( val < 3.0 * sig ) {
rej++;
......@@ -412,11 +411,12 @@ int main(int argc, char *argv[])
//if ( ig ) continue;
add_item(good_items, h, k, l);
new = add_refl(list, h, k, l);
copy_data(new, refl);
}
plot_shells(ref, items, cell, sym, cts, esd, rmin_fix, rmax_fix);
plot_shells(list, cell, sym, rmin_fix, rmax_fix);
return 0;
}
......@@ -20,11 +20,12 @@
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
#include "utils.h"
#include "reflections.h"
#include "statistics.h"
#include "symmetry.h"
#include "reflist-utils.h"
/* Number of bins for plot of resolution shells */
......@@ -38,7 +39,7 @@ static void show_help(const char *s)
"Compare intensity lists.\n"
"\n"
" -h, --help Display this help message.\n"
" -o, --output=<filename> Specify output filename for correction factor.\n"
" -o, --ratio=<filename> Specify output filename for ratios.\n"
" -y, --symmetry=<sym> The symmetry of both the input files.\n"
" -p, --pdb=<filename> PDB file to use (default: molecule.pdb).\n"
" --shells Plot the figures of merit by resolution.\n"
......@@ -48,9 +49,9 @@ static void show_help(const char *s)
}
static void plot_shells(const double *ref1, const double *ref2,
ReflItemList *items, double scale, UnitCell *cell,
const char *sym, double rmin_fix, double rmax_fix)
static void plot_shells(RefList *list1, RefList *list2, double scale,
UnitCell *cell, const char *sym,
double rmin_fix, double rmax_fix)
{
double num[NBINS];
int cts[NBINS];
......@@ -69,6 +70,12 @@ static void plot_shells(const double *ref1, const double *ref2,
int ctot;
FILE *fh;
int nout = 0;
Reflection *refl1;
RefListIterator *iter;
double asx, asy, asz;
double bsx, bsy, bsz;
double csx, csy, csz;
int hmax, kmax, lmax;
if ( cell == NULL ) {
ERROR("Need the unit cell to plot resolution shells.\n");
......@@ -90,16 +97,20 @@ static void plot_shells(const double *ref1, const double *ref2,
snr[i] = 0;
}
rmin = +INFINITY;
rmax = 0.0;
for ( i=0; i<num_items(items); i++ ) {
/* Iterate over all common reflections and calculate min and max
* resolution */
rmin = +INFINITY; rmax = 0.0;
for ( refl1 = first_refl(list1, &iter);
refl1 != NULL;
refl1 = next_refl(refl1, iter) ) {
struct refl_item *it;
signed int h, k, l;
double d;
Reflection *refl2;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl1, &h, &k, &l);
refl2 = find_refl(list2, h, k, l);
if ( refl2 == NULL ) continue; /* No common reflection */
d = resolution(cell, h, k, l) * 2.0;
if ( d > rmax ) rmax = d;
......@@ -117,6 +128,7 @@ static void plot_shells(const double *ref1, const double *ref2,
if ( rmin_fix > 0.0 ) rmin = rmin_fix;
if ( rmax_fix > 0.0 ) rmax = rmax_fix;
/* Calculate the resolution bins */
total_vol = pow(rmax, 3.0) - pow(rmin, 3.0);
vol_per_shell = total_vol / NBINS;
rmins[0] = rmin;
......@@ -145,9 +157,16 @@ static void plot_shells(const double *ref1, const double *ref2,
/* Count the number of reflections possible in each shell */
counted = new_list_count();
for ( h=-50; h<=+50; h++ ) {
for ( k=-50; k<=+50; k++ ) {
for ( l=-50; l<=+50; l++ ) {
cell_get_reciprocal(cell, &asx, &asy, &asz,
&bsx, &bsy, &bsz,
&csx, &csy, &csz);
hmax = rmax / modulus(asx, asy, asz);
kmax = rmax / modulus(bsx, bsy, bsz);
lmax = rmax / modulus(csx, csy, csz);
for ( h=-hmax; h<hmax; h++ ) {
for ( k=-kmax; k<kmax; k++ ) {
for ( l=-lmax; l<lmax; l++ ) {
double d;
signed int hs, ks, ls;
......@@ -178,17 +197,21 @@ static void plot_shells(const double *ref1, const double *ref2,
den = 0.0;
ctot = 0;
nout = 0;
for ( i=0; i<num_items(items); i++ ) {
struct refl_item *it;
for ( refl1 = first_refl(list1, &iter);
refl1 != NULL;
refl1 = next_refl(refl1, iter) ) {
signed int h, k, l;
double d;
int bin;
double i1, i2;
int j;
Reflection *refl2;
it = get_item(items, i);
h = it->h; k = it->k; l = it->l;
get_indices(refl1, &h, &k, &l);
refl2 = find_refl(list2, h, k, l);
if ( refl2 == NULL ) continue; /* No common reflection