Commit 193c900d authored by Thomas White's avatar Thomas White
Browse files

Remove all remaining PDB rendering stuff

parent 5508edc2
......@@ -25,7 +25,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/sfac.c src/peaks.c \
src/detector.c src/peaks.c \
src/reflections.c src/beam-parameters.c \
src/symmetry.c src/thread-pool.c src/reflist.c
if HAVE_OPENCL
......@@ -41,7 +41,7 @@ tests_gpu_sim_check_SOURCES = tests/gpu_sim_check.c src/utils.c \
src/image.c
endif
src_process_hkl_SOURCES = src/process_hkl.c src/sfac.c src/statistics.c \
src_process_hkl_SOURCES = src/process_hkl.c src/statistics.c \
src/cell.c src/utils.c \
src/symmetry.c src/stream.c src/beam-parameters.c \
src/thread-pool.c src/image.c src/detector.c \
......@@ -50,7 +50,7 @@ src_process_hkl_SOURCES = src/process_hkl.c src/sfac.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/sfac.c src/dirax.c src/mosflm.c \
src/dirax.c src/mosflm.c \
src/reflections.c src/symmetry.c \
src/geometry.c src/thread-pool.c \
src/beam-parameters.c src/reflist.c src/stream.c \
......@@ -66,15 +66,15 @@ src_hdfsee_SOURCES = src/hdfsee.c src/dw-hdfsee.c src/render.c \
src/thread-pool.c src/detector.c
endif
src_get_hkl_SOURCES = src/get_hkl.c src/sfac.c src/cell.c src/utils.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_compare_hkl_SOURCES = src/compare_hkl.c src/sfac.c src/cell.c src/utils.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_check_hkl_SOURCES = src/check_hkl.c src/sfac.c src/cell.c src/utils.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
......@@ -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/sfac.h src/reflections.h \
src/diffraction.h src/detector.h src/reflections.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 \
......@@ -125,16 +125,9 @@ EXTRA_DIST += src/cell.h src/hdf5-file.h src/image.h src/utils.h \
src/reflist.h
crystfeldir = $(datadir)/crystfel
crystfel_DATA = data/diffraction.cl data/defs.h data/sfac/Ca.nff \
data/sfac/C.nff data/sfac/Fe.nff data/sfac/H.nff \
data/sfac/Mg.nff data/sfac/N.nff data/sfac/O.nff \
data/sfac/P.nff data/sfac/S.nff data/sfac/f0_WaasKirf.dat \
data/hdfsee.ui
EXTRA_DIST += data/sfac/Ca.nff data/sfac/C.nff data/sfac/Fe.nff \
data/sfac/H.nff data/sfac/Mg.nff data/sfac/N.nff data/sfac/O.nff \
data/sfac/P.nff data/sfac/S.nff data/sfac/f0_WaasKirf.dat \
data/defs.h data/diffraction.cl data/hdfsee.ui
crystfel_DATA = data/diffraction.cl data/defs.h data/hdfsee.ui
EXTRA_DIST += $(crystfel_DATA)
crystfeldocdir = $(docdir)
crystfeldoc_DATA = doc/geometry.txt doc/indexamajig.txt doc/pattern_sim.txt \
......
......@@ -89,15 +89,15 @@ am_src_calibrate_detector_OBJECTS = src/calibrate_detector.$(OBJEXT) \
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/sfac.$(OBJEXT) \
src/cell.$(OBJEXT) src/utils.$(OBJEXT) \
src/reflections.$(OBJEXT) src/statistics.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT)
am_src_check_hkl_OBJECTS = src/check_hkl.$(OBJEXT) src/cell.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflections.$(OBJEXT) \
src/statistics.$(OBJEXT) src/symmetry.$(OBJEXT) \
src/thread-pool.$(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/sfac.$(OBJEXT) src/cell.$(OBJEXT) src/utils.$(OBJEXT) \
src/cell.$(OBJEXT) src/utils.$(OBJEXT) \
src/reflections.$(OBJEXT) src/statistics.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT)
src_compare_hkl_OBJECTS = $(am_src_compare_hkl_OBJECTS)
......@@ -119,10 +119,10 @@ am__src_cubeit_SOURCES_DIST = src/cubeit.c src/cell.c src/hdf5-file.c \
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/sfac.$(OBJEXT) \
src/cell.$(OBJEXT) src/utils.$(OBJEXT) \
src/reflections.$(OBJEXT) src/symmetry.$(OBJEXT) \
src/beam-parameters.$(OBJEXT) src/thread-pool.$(OBJEXT)
am_src_get_hkl_OBJECTS = src/get_hkl.$(OBJEXT) src/cell.$(OBJEXT) \
src/utils.$(OBJEXT) src/reflections.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/thread-pool.$(OBJEXT)
src_get_hkl_OBJECTS = $(am_src_get_hkl_OBJECTS)
src_get_hkl_LDADD = $(LDADD)
src_get_hkl_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
......@@ -141,18 +141,18 @@ src_hdfsee_LDADD = $(LDADD)
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/sfac.c \
src/dirax.c src/mosflm.c src/reflections.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/filters.c src/diffraction.c src/detector.c src/dirax.c \
src/mosflm.c src/reflections.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
@HAVE_OPENCL_TRUE@am__objects_1 = src/diffraction-gpu.$(OBJEXT) \
@HAVE_OPENCL_TRUE@ src/cl-utils.$(OBJEXT)
am_src_indexamajig_OBJECTS = src/indexamajig.$(OBJEXT) \
src/hdf5-file.$(OBJEXT) src/utils.$(OBJEXT) src/cell.$(OBJEXT) \
src/image.$(OBJEXT) src/peaks.$(OBJEXT) src/index.$(OBJEXT) \
src/filters.$(OBJEXT) src/diffraction.$(OBJEXT) \
src/detector.$(OBJEXT) src/sfac.$(OBJEXT) src/dirax.$(OBJEXT) \
src/detector.$(OBJEXT) src/dirax.$(OBJEXT) \
src/mosflm.$(OBJEXT) src/reflections.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/geometry.$(OBJEXT) \
src/thread-pool.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
......@@ -174,13 +174,13 @@ 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/sfac.c src/peaks.c src/reflections.c \
src/detector.c src/peaks.c src/reflections.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/sfac.$(OBJEXT) src/peaks.$(OBJEXT) \
src/detector.$(OBJEXT) src/peaks.$(OBJEXT) \
src/reflections.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/symmetry.$(OBJEXT) src/thread-pool.$(OBJEXT) \
src/reflist.$(OBJEXT) $(am__objects_1)
......@@ -195,7 +195,7 @@ src_powder_plot_OBJECTS = $(am_src_powder_plot_OBJECTS)
src_powder_plot_LDADD = $(LDADD)
src_powder_plot_DEPENDENCIES = $(top_builddir)/lib/libgnu.a
am_src_process_hkl_OBJECTS = src/process_hkl.$(OBJEXT) \
src/sfac.$(OBJEXT) src/statistics.$(OBJEXT) src/cell.$(OBJEXT) \
src/statistics.$(OBJEXT) src/cell.$(OBJEXT) \
src/utils.$(OBJEXT) src/symmetry.$(OBJEXT) \
src/stream.$(OBJEXT) src/beam-parameters.$(OBJEXT) \
src/thread-pool.$(OBJEXT) src/image.$(OBJEXT) \
......@@ -558,18 +558,14 @@ 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/sfac.h src/reflections.h src/list_tmp.h src/statistics.h \
src/reflections.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 \
src/povray.h src/index-priv.h src/geometry.h src/render_hkl.h \
src/stream.h src/thread-pool.h src/beam-parameters.h \
src/post-refinement.h src/hrs-scaling.h src/reflist.h \
data/sfac/Ca.nff data/sfac/C.nff data/sfac/Fe.nff \
data/sfac/H.nff data/sfac/Mg.nff data/sfac/N.nff \
data/sfac/O.nff data/sfac/P.nff data/sfac/S.nff \
data/sfac/f0_WaasKirf.dat data/defs.h data/diffraction.cl \
data/hdfsee.ui doc/geometry.txt doc/indexamajig.txt \
$(crystfel_DATA) doc/geometry.txt doc/indexamajig.txt \
doc/pattern_sim.txt doc/process_hkl.txt doc/symmetry.txt \
doc/twin-calculator.pdf doc/0-INDEX doc/examples/lcls-dec.geom \
doc/examples/lcls-june-r0013-r0128.geom \
......@@ -592,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/sfac.c src/peaks.c src/reflections.c \
src/detector.c src/peaks.c src/reflections.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 \
......@@ -601,7 +597,7 @@ src_pattern_sim_SOURCES = src/pattern_sim.c src/diffraction.c \
@HAVE_OPENCL_TRUE@ src/symmetry.c src/detector.c src/hdf5-file.c \
@HAVE_OPENCL_TRUE@ src/image.c
src_process_hkl_SOURCES = src/process_hkl.c src/sfac.c src/statistics.c \
src_process_hkl_SOURCES = src/process_hkl.c src/statistics.c \
src/cell.c src/utils.c \
src/symmetry.c src/stream.c src/beam-parameters.c \
src/thread-pool.c src/image.c src/detector.c \
......@@ -609,23 +605,23 @@ src_process_hkl_SOURCES = src/process_hkl.c src/sfac.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/sfac.c \
src/dirax.c src/mosflm.c src/reflections.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/filters.c src/diffraction.c src/detector.c src/dirax.c \
src/mosflm.c src/reflections.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)
@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/sfac.c src/cell.c src/utils.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_compare_hkl_SOURCES = src/compare_hkl.c src/sfac.c src/cell.c src/utils.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_check_hkl_SOURCES = src/check_hkl.c src/sfac.c src/cell.c src/utils.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
......@@ -663,12 +659,7 @@ tests_list_check_SOURCES = tests/list_check.c src/reflist.c src/thread-pool.c \
INCLUDES = "-I$(top_srcdir)/data"
crystfeldir = $(datadir)/crystfel
crystfel_DATA = data/diffraction.cl data/defs.h data/sfac/Ca.nff \
data/sfac/C.nff data/sfac/Fe.nff data/sfac/H.nff \
data/sfac/Mg.nff data/sfac/N.nff data/sfac/O.nff \
data/sfac/P.nff data/sfac/S.nff data/sfac/f0_WaasKirf.dat \
data/hdfsee.ui
crystfel_DATA = data/diffraction.cl data/defs.h data/hdfsee.ui
crystfeldocdir = $(docdir)
crystfeldoc_DATA = doc/geometry.txt doc/indexamajig.txt doc/pattern_sim.txt \
doc/process_hkl.txt doc/symmetry.txt \
......@@ -811,7 +802,6 @@ src/calibrate_detector$(EXEEXT): $(src_calibrate_detector_OBJECTS) $(src_calibra
$(AM_V_CCLD)$(LINK) $(src_calibrate_detector_OBJECTS) $(src_calibrate_detector_LDADD) $(LIBS)
src/check_hkl.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/sfac.$(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/$(DEPDIR)/$(am__dirstamp)
......@@ -963,7 +953,6 @@ mostlyclean-compile:
-rm -f src/reflist.$(OBJEXT)
-rm -f src/render.$(OBJEXT)
-rm -f src/render_hkl.$(OBJEXT)
-rm -f src/sfac.$(OBJEXT)
-rm -f src/statistics.$(OBJEXT)
-rm -f src/stream.$(OBJEXT)
-rm -f src/sum_stack.$(OBJEXT)
......@@ -1010,7 +999,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/reflist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/render.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/render_hkl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sfac.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/statistics.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/stream.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sum_stack.Po@am__quote@
......
......@@ -22,7 +22,6 @@
#include <getopt.h>
#include "utils.h"
#include "sfac.h"
#include "reflections.h"
#include "statistics.h"
#include "symmetry.h"
......
......@@ -22,7 +22,6 @@
#include <getopt.h>
#include "utils.h"
#include "sfac.h"
#include "reflections.h"
#include "statistics.h"
#include "symmetry.h"
......
......@@ -29,7 +29,6 @@
#include "utils.h"
#include "cell.h"
#include "diffraction.h"
#include "sfac.h"
#include "cl-utils.h"
#include "beam-parameters.h"
......
......@@ -22,7 +22,6 @@
#include "utils.h"
#include "cell.h"
#include "diffraction.h"
#include "sfac.h"
#include "beam-parameters.h"
#include "symmetry.h"
......
......@@ -36,7 +36,6 @@
#include "image.h"
#include "dirax.h"
#include "utils.h"
#include "sfac.h"
#include "peaks.h"
......
/*
* get_hkl.c
*
* Small program to write out a list of h,k,l,I values given a structure
* Small program to manipulate reflection lists
*
* (c) 2006-2010 Thomas White <taw@physics.org>
* (c) 2006-2011 Thomas White <taw@physics.org>
*
* Part of CrystFEL - crystallography with a FEL
*
......@@ -22,7 +22,6 @@
#include <getopt.h>
#include "utils.h"
#include "sfac.h"
#include "reflections.h"
#include "symmetry.h"
#include "beam-parameters.h"
......@@ -32,27 +31,34 @@ static void show_help(const char *s)
{
printf("Syntax: %s [options]\n\n", s);
printf(
"Create reflections lists.\n"
"Manipulate reflection lists.\n"
"\n"
" -h, --help Display this help message.\n"
"\n"
" -t, --template=<filename> Only include reflections mentioned in file.\n"
" -i, --input=<file> Read reflections from <file>.\n"
" -y, --symmetry=<sym> The symmetry of the input reflection list.\n"
"\n"
"You can add noise to the reflections with either of:\n"
" --poisson Simulate Poisson samples.\n"
" --noise Add 10%% random noise.\n"
" -y, --symmetry=<sym> The symmetry of the input file (-i).\n"
"\n"
"To calculate Poisson samples accurately, you must also give:\n"
" -b, --beam=<file> Get beam parameters from file.\n"
"\n"
"You can artificially 'twin' the reflections, or expand them out:\n"
" -w, --twin=<sym> Generate twinned data according to the given\n"
" point group.\n"
" -e, --expand=<sym> Expand reflections to this point group.\n"
" -o, --output=<filename> Output filename (default: stdout).\n"
" -i, --intensities=<file> Read intensities from file instead of\n"
" calculating them from scratch. You might use\n"
" this if you need to apply noise or twinning.\n"
" -p, --pdb=<file> PDB file from which to get the structure.\n"
" --no-phases Do not try to use phases in the input file.\n"
"\n"
"You can restrict which reflections are written out:\n"
" -t, --template=<filename> Only include reflections mentioned in file.\n"
"\n"
"You might sometimes need to do this:\n"
" --multiplicity Multiply intensities by the number of\n"
" equivalent reflections.\n"
" -b, --beam=<file> Get beam parameters from file (used for sigmas).\n"
" --max-res=<d> Calculate structure factors out to d=<d> nm.\n"
"\n"
"Don't forget to specify the output filename:\n"
" -o, --output=<filename> Output filename (default: stdout).\n"
);
}
......@@ -253,7 +259,6 @@ int main(int argc, char *argv[])
double *ideal_ref;
double *phases;
double *esds;
struct molecule *mol;
char *template = NULL;
int config_noise = 0;
int config_poisson = 0;
......@@ -269,10 +274,7 @@ int main(int argc, char *argv[])
ReflItemList *write_items;
UnitCell *cell = NULL;
char *beamfile = NULL;
char *rval;
struct beam_params *beam; /* Beam parameters for SF calculation */
int have_max_res = 0;
double max_res = 0.0;
struct beam_params *beam; /* Beam parameters for Poisson calculation */
/* Long options */
const struct option longopts[] = {
......@@ -285,16 +287,13 @@ int main(int argc, char *argv[])
{"twin", 1, NULL, 'w'},
{"expand", 1, NULL, 'e'},
{"intensities", 1, NULL, 'i'},
{"pdb", 1, NULL, 'p'},
{"no-phases", 0, &config_nophase, 1},
{"multiplicity", 0, &config_multi, 1},
{"beam", 1, NULL, 'b'},
{"max-res", 1, NULL, 2},
{0, 0, NULL, 0}
};
/* Short options */
while ((c = getopt_long(argc, argv, "ht:o:i:p:w:y:e:b:",
while ((c = getopt_long(argc, argv, "ht:o:i:w:y:e:b:",
longopts, NULL)) != -1) {
switch (c) {
......@@ -314,10 +313,6 @@ int main(int argc, char *argv[])
input = strdup(optarg);
break;
case 'p' :
filename = strdup(optarg);
break;
case 'y' :
mero = strdup(optarg);
break;
......@@ -334,16 +329,6 @@ int main(int argc, char *argv[])
beamfile = strdup(optarg);
break;
case 2 :
max_res = strtod(optarg, &rval);
if ( *rval != '\0' ) {
ERROR("Invalid maximum resolution.\n");
return 1;
}
max_res = 1.0 / (max_res * 1.0e-9);
have_max_res = 1;
break;
case 0 :
break;
......@@ -363,7 +348,6 @@ int main(int argc, char *argv[])
exit(1);
}
mol = load_molecule(filename);
cell = load_cell_from_pdb(filename);
if ( !config_nophase ) {
phases = new_list_phase();
......@@ -371,44 +355,15 @@ int main(int argc, char *argv[])
phases = NULL;
}
esds = new_list_sigma();
if ( input == NULL ) {
if ( beamfile == NULL ) {
ERROR("To calculate structure factors, you must"
" provide a beam parameters file (use -b)\n");
return 1;
}
beam = get_beam_parameters(beamfile);
if ( beam == NULL ) {
ERROR("Failed to read beam parameters from '%s'\n", beamfile);
return 1;
}
free(beamfile);
if ( !have_max_res ) {
STATUS("You didn't specify the maximum resolution to"
" calculate structure factors. I'll go to"
" d = 0.5 nm.\n");
max_res = 1.0/0.5e-9;
}
input_items = new_items();
ideal_ref = get_reflections(mol, eV_to_J(beam->photon_energy),
max_res, phases, input_items);
} else {
ideal_ref = new_list_intensity();
input_items = read_reflections(input, ideal_ref, phases,
NULL, esds);
free(input);
if ( check_symmetry(input_items, mero) ) {
ERROR("The input reflection list does not appear to"
" have symmetry %s\n", mero);
return 1;
}
ideal_ref = new_list_intensity();
input_items = read_reflections(input, ideal_ref, phases,
NULL, esds);
free(input);
if ( check_symmetry(input_items, mero) ) {
ERROR("The input reflection list does not appear to"
" have symmetry %s\n", mero);
return 1;
}
if ( config_poisson ) poisson_reflections(ideal_ref, input_items);
......
......@@ -26,7 +26,6 @@
#include "peaks.h"
#include "dirax.h"
#include "mosflm.h"
#include "sfac.h"
#include "detector.h"
#include "index.h"
#include "index-priv.h"
......
......@@ -30,7 +30,6 @@
#include "index.h"
#include "peaks.h"
#include "detector.h"
#include "sfac.h"
#include "filters.h"
#include "reflections.h"
#include "thread-pool.h"
......
......@@ -61,7 +61,6 @@
#include "image.h"
#include "mosflm.h"
#include "utils.h"
#include "sfac.h"
#include "peaks.h"
......
......@@ -29,7 +29,6 @@
#include "hdf5-file.h"
#include "detector.h"
#include "peaks.h"
#include "sfac.h"
#include "reflections.h"
#include "beam-parameters.h"
#include "symmetry.h"
......
......@@ -23,7 +23,6 @@
#include "utils.h"
#include "statistics.h"
#include "sfac.h"
#include "reflist-utils.h"
#include "symmetry.h"
#include "stream.h"
......
/*
* sfac.c
*
* Scattering factors
*
* (c) 2006-2010 Thomas White <taw@physics.org>
*
* Part of CrystFEL - crystallography with a FEL
*
*/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <complex.h>
#include <string.h>
#include <ctype.h>
#include "utils.h"
#include "sfac.h"
#define N_MEMO 1024
/* Look up f1 and f2 for this atom at this energy (in J/photon) */
static double complex get_f1f2(const char *n, double en)
{
FILE *fh;
char filename[64];
char line[1024];
char *rval;
double last_E, last_f1, last_f2;
static char *memo_n[N_MEMO];
static int memo_eV[N_MEMO];
static double complex memo_res[N_MEMO];
static int n_memo = 0;
int eV;
int i;
eV = (int)rint(J_to_eV(en));
for ( i=0; i<n_memo; i++ ) {
if ( (memo_eV[i] == eV) && (strcmp(memo_n[i], n) == 0) ) {
return memo_res[i];
}
}
snprintf(filename, 63, DATADIR"/crystfel/%s.nff", n);
fh = fopen(filename, "r");
if ( fh == NULL ) {
ERROR("Couldn't open file '%s'\n", filename);
return 0.0;
}
en = J_to_eV(en);
/* Discard first line */
fgets(line, 1023, fh);
last_E = 0.0;
last_f1 = 0.0;
last_f2 = 0.0;
do {
int r;
double E, f1, f2;
float E_f, f1_f, f2_f;
rval = fgets(line, 1023, fh);
r = sscanf(line, "%f %f %f", &E_f, &f1_f, &f2_f);
if ( r != 3 ) {
STATUS("I couldn't understand a line in the f1f2 "
"tables\n");
continue;
}
/* Promote to double precision */
E = E_f; f1 = f1_f; f2 = f2_f;
/* Find the first energy greater than the required value */
if ( E < en ) {
/* Store old values ready for interpolation*/
last_E = E;
last_f1 = f1;
last_f2 = f2;
} else {
/* Perform (linear) interpolation */
double f;
double actual_f1, actual_f2;
double complex res;
f = (en - last_E) / (E - last_E);
actual_f1 = last_f1 + f * (f1 - last_f1);
actual_f2 = last_f2 + f * (f2 - last_f2);
fclose(fh);
res = actual_f1 + I*actual_f2;
memo_n[n_memo] = strdup(n);