aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-29 14:25:53 +0200
committerThomas White <taw@physics.org>2010-03-29 14:25:53 +0200
commitbdd926190e83f032d99e2a4946a4fab37cbd6ce3 (patch)
treec4b4764257e84e497ae3a5ee0f5ad7826170418e /src
parente76906248c006dedf8217b7dee540d182d6d242b (diff)
get_hkl: Generate reflections out to a certain resolution
Diffstat (limited to 'src')
-rw-r--r--src/get_hkl.c2
-rw-r--r--src/sfac.c6
-rw-r--r--src/sfac.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/get_hkl.c b/src/get_hkl.c
index ec2b898e..d59af595 100644
--- a/src/get_hkl.c
+++ b/src/get_hkl.c
@@ -153,7 +153,7 @@ int main(int argc, char *argv[])
}
mol = load_molecule();
- ideal_ref = get_reflections(mol, eV_to_J(1790.0));
+ ideal_ref = get_reflections(mol, eV_to_J(1790.0), 1/(0.6e-9));
counts = new_list_count();
diff --git a/src/sfac.c b/src/sfac.c
index 00bbd6ba..dcb49110 100644
--- a/src/sfac.c
+++ b/src/sfac.c
@@ -490,7 +490,7 @@ void free_molecule(struct molecule *mol)
}
-double *get_reflections(struct molecule *mol, double en)
+double *get_reflections(struct molecule *mol, double en, double res)
{
double *reflections;
double asx, asy, asz;
@@ -511,10 +511,12 @@ double *get_reflections(struct molecule *mol, double en)
double complex F = 0.0;
int i;
- double s;
+ double s, oneoverd;
/* We need sin(theta)/lambda = 1/2d */
s = resolution(mol->cell, h, k, l);
+ oneoverd = 2.0 * s;
+ if ( oneoverd > res ) continue;
/* Atoms are grouped by species for faster calculation */
for ( i=0; i<mol->n_species; i++ ) {
diff --git a/src/sfac.h b/src/sfac.h
index 1367abbd..93aeaab8 100644
--- a/src/sfac.h
+++ b/src/sfac.h
@@ -60,7 +60,7 @@ extern double complex get_sfac(const char *n, double s, double en);
extern struct molecule *load_molecule(void);
extern void free_molecule(struct molecule *mol);
-extern double *get_reflections(struct molecule *mol, double en);
+extern double *get_reflections(struct molecule *mol, double en, double res);
#endif /* SFAC_H */