aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diffraction.c18
-rw-r--r--src/diffraction.h3
-rw-r--r--src/indexamajig.c2
-rw-r--r--src/pattern_sim.c4
4 files changed, 18 insertions, 9 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index 84206908..27037839 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -133,7 +133,7 @@ double water_intensity(struct rvec q, double en,
}
-void get_diffraction(struct image *image, int na, int nb, int nc)
+void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac)
{
int x, y;
double ax, ay, az;
@@ -158,11 +158,13 @@ void get_diffraction(struct image *image, int na, int nb, int nc)
na, nb, nc, na*a/1.0e-9, nb*b/1.0e-9, nc*c/1.0e-9);
image->sfacs = malloc(image->width * image->height
- * sizeof(double complex));
+ * sizeof(double complex));
- if ( image->molecule->reflections == NULL ) {
- get_reflections_cached(image->molecule,
- ph_lambda_to_en(image->lambda));
+ if ( !no_sfac ) {
+ if ( image->molecule->reflections == NULL ) {
+ get_reflections_cached(image->molecule,
+ ph_lambda_to_en(image->lambda));
+ }
}
for ( x=0; x<image->width; x++ ) {
@@ -177,8 +179,12 @@ void get_diffraction(struct image *image, int na, int nb, int nc)
f_lattice = lattice_factor(q, ax,ay,az,bx,by,bz,cx,cy,cz,
na, nb, nc);
- f_molecule = molecule_factor(image->molecule, q,
+ if ( no_sfac ) {
+ f_molecule = 1.0;
+ } else {
+ f_molecule = molecule_factor(image->molecule, q,
ax,ay,az,bx,by,bz,cx,cy,cz);
+ }
val = f_molecule * f_lattice;
image->sfacs[x + image->width*y] = val;
diff --git a/src/diffraction.h b/src/diffraction.h
index cc5f89b1..efc59d36 100644
--- a/src/diffraction.h
+++ b/src/diffraction.h
@@ -19,7 +19,8 @@
#include "image.h"
#include "cell.h"
-extern void get_diffraction(struct image *image, int na, int nb, int nc);
+extern void get_diffraction(struct image *image, int na, int nb, int nc,
+ int nosfac);
extern double water_intensity(struct rvec q, double en,
double beam_r, double water_r);
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 3f75f8b0..d05db543 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -259,7 +259,7 @@ int main(int argc, char *argv[])
image.data = NULL;
- get_diffraction(&image, 8, 8, 8);
+ get_diffraction(&image, 8, 8, 8, 0);
if ( image.molecule == NULL ) {
ERROR("Couldn't open molecule.pdb\n");
return 1;
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index d3056643..433a7589 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -156,6 +156,7 @@ int main(int argc, char *argv[])
int config_nowater = 0;
int config_nonoise = 0;
int config_nobloom = 0;
+ int config_nosfac = 0;
int number = 1; /* Index for the current image */
int n_images = 1; /* Generate one image by default */
int done = 0;
@@ -171,6 +172,7 @@ int main(int argc, char *argv[])
{"no-water", 0, &config_nowater, 1},
{"no-noise", 0, &config_nonoise, 1},
{"no-bloom", 0, &config_nobloom, 1},
+ {"no-sfac", 0, &config_nosfac, 1},
{0, 0, NULL, 0}
};
@@ -272,7 +274,7 @@ int main(int argc, char *argv[])
image.twotheta = NULL;
image.hdr = NULL;
- get_diffraction(&image, na, nb, nc);
+ get_diffraction(&image, na, nb, nc, config_nosfac);
if ( image.molecule == NULL ) {
ERROR("Couldn't open molecule.pdb\n");
return 1;