aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-29 16:15:57 +0200
committerThomas White <taw@physics.org>2010-03-29 16:15:57 +0200
commit2f515b4fe79633279baf989191fc3c1e04f56175 (patch)
tree74483273fb22ab4907cc844a160380031e8a1318
parente2b7964688457b12fa171ec1d8c6c5e7670f0e96 (diff)
get_hkl: Only *save* reflections out to a certain resolution
-rw-r--r--src/get_hkl.c10
-rw-r--r--src/sfac.c4
-rw-r--r--src/sfac.h3
3 files changed, 13 insertions, 4 deletions
diff --git a/src/get_hkl.c b/src/get_hkl.c
index d59af595..5e27f2a1 100644
--- a/src/get_hkl.c
+++ b/src/get_hkl.c
@@ -109,6 +109,7 @@ int main(int argc, char *argv[])
int config_za = 0;
char *output = NULL;
unsigned int *counts;
+ unsigned int *cts;
signed int h, k, l;
/* Long options */
@@ -153,7 +154,8 @@ int main(int argc, char *argv[])
}
mol = load_molecule();
- ideal_ref = get_reflections(mol, eV_to_J(1790.0), 1/(0.6e-9));
+ cts = new_list_count();
+ ideal_ref = get_reflections(mol, eV_to_J(1790.0), 1/(0.6e-9), cts);
counts = new_list_count();
@@ -166,10 +168,14 @@ int main(int argc, char *argv[])
} else {
+ /* No template? Then only mark reflections which were
+ * calculated. */
for ( h=-INDMAX; h<=INDMAX; h++ ) {
for ( k=-INDMAX; k<=INDMAX; k++ ) {
for ( l=-INDMAX; l<=INDMAX; l++ ) {
- set_count(counts, h, k, l, 1);
+ unsigned int c;
+ c = lookup_count(cts, h, k, l);
+ set_count(counts, h, k, l, c);
}
}
}
diff --git a/src/sfac.c b/src/sfac.c
index dcb49110..3d39fa42 100644
--- a/src/sfac.c
+++ b/src/sfac.c
@@ -490,7 +490,8 @@ void free_molecule(struct molecule *mol)
}
-double *get_reflections(struct molecule *mol, double en, double res)
+double *get_reflections(struct molecule *mol, double en, double res,
+ unsigned int *counts)
{
double *reflections;
double asx, asy, asz;
@@ -553,6 +554,7 @@ double *get_reflections(struct molecule *mol, double en, double res)
}
set_intensity(reflections, h, k, l, pow(cabs(F), 2.0));
+ set_count(counts, h, k, l, 1);
}
progress_bar((k+INDMAX)+IDIM*(h+INDMAX), IDIM*IDIM-1,
diff --git a/src/sfac.h b/src/sfac.h
index 93aeaab8..f6b4874f 100644
--- a/src/sfac.h
+++ b/src/sfac.h
@@ -60,7 +60,8 @@ 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, double res);
+extern double *get_reflections(struct molecule *mol, double en, double res,
+ unsigned int *counts);
#endif /* SFAC_H */