aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-23 14:39:12 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:21 +0100
commit8af55d282069373612e51db65345ee9eaf317ed5 (patch)
tree04b9f653cd15259bc8c49285d32958832312afb8
parent257838dfdc212aa7bfea8c88cdffdd8f06aaf371 (diff)
Use calculated max wavelength for calculating number of possible reflections
-rw-r--r--src/check_hkl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/check_hkl.c b/src/check_hkl.c
index d220252d..898846d4 100644
--- a/src/check_hkl.c
+++ b/src/check_hkl.c
@@ -72,6 +72,10 @@ static void plot_shells(RefList *list, UnitCell *cell, const char *sym,
int nout = 0;
Reflection *refl;
RefListIterator *iter;
+ int hmax, kmax, lmax;
+ double asx, asy, asz;
+ double bsx, bsy, bsz;
+ double csx, csy, csz;
if ( cell == NULL ) {
ERROR("Need the unit cell to plot resolution shells.\n");
@@ -151,9 +155,15 @@ static void plot_shells(RefList *list, UnitCell *cell, const char *sym,
/* Count the number of reflections possible in each shell */
counted = new_list_count();
- for ( h=-150; h<=+150; h++ ) {
- for ( k=-150; k<=+150; k++ ) {
- for ( l=-150; l<=+150; 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;