diff options
Diffstat (limited to 'src/geometry.c')
-rw-r--r-- | src/geometry.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/geometry.c b/src/geometry.c index 2329b0c7..56bb2b0a 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -236,9 +236,24 @@ RefList *find_intersections(struct image *image, UnitCell *cell) int hmax, kmax, lmax; double mres; signed int h, k, l; + double a, b, c, al, be, ga; reflections = reflist_new(); + /* Cell angle check from Foadi and Evans (2011) */ + cell_get_parameters(cell, &a, &b, &c, &al, &be, &ga); + if ( al + be + ga >= 2.0*M_PI ) return NULL; + if ( al + be - ga >= 2.0*M_PI ) return NULL; + if ( al - be + ga >= 2.0*M_PI ) return NULL; + if ( - al + be + ga >= 2.0*M_PI ) return NULL; + if ( al + be + ga <= 0.0 ) return NULL; + if ( al + be - ga <= 0.0 ) return NULL; + if ( al - be + ga <= 0.0 ) return NULL; + if ( - al + be + ga <= 0.0 ) return NULL; + if ( isnan(al) ) return NULL; + if ( isnan(be) ) return NULL; + if ( isnan(ga) ) return NULL; + cell_get_reciprocal(cell, &asx, &asy, &asz, &bsx, &bsy, &bsz, &csx, &csy, &csz); |