- Added brute force indexing support to ubcalc

- Added calculation of UB from 3 reflections to ubcalc
- Added calculation of lattice constants from UB to ubcalc
- Some fixes in stdscan in order to make the scripted scan work
This commit is contained in:
koennecke
2005-04-01 13:48:25 +00:00
parent 152bc961ec
commit 5c30a7ea7b
10 changed files with 637 additions and 45 deletions

View File

@@ -3,8 +3,9 @@
* The algorithm and setting definitions is from:
* Busing & Levy, Acta Cryst. (1967), 22, 457ff
*
* This initial version only supports the calculation of the UB matrix from
* cell constants and two reflections.
* Implemented:
* - UB from cell cell constants and two reflections.
* - Brute force index search
*
* Mark Koennecke, march 2005
*/
@@ -19,7 +20,8 @@
* error codes: also see cell.h
*/
#define UBNOMEMORY -200
#define INVALID_LAMBDA -201
#define NOTRIGHTHANDED -202
/**
* a reflection data structure holding the indices h,k,l and
* the magic four circle angles two_theta, om, chi and phi.
@@ -37,4 +39,38 @@ typedef struct{
* @return The resulting UB matrix or NULL on errors
*/
MATRIX calcUBFromCellAndReflections(lattice direct, reflection r1, reflection r2, int *errCode);
/**
* calculate the UB matrix from three reflections. The three reflections must not be
* coplanar and must reflect a right handed
* @param r1 The first reflection
* @param r2 The second reflection
* @param r3 The third reflection.
* @param errCode a code indictang errors which happened.
* @return A UB matrix on success or NULL on errors. Then errcode will indicate
* the type of teh error.
*/
MATRIX calcUBFromThreeReflections(reflection r1, reflection r2, reflection r3,
double lambda, int *errCode);
/**
* a data structure holding an indexing suggestion
*/
typedef struct {
double h, k, l; /* suggested index */
double t2obs, t2calc, t2diff; /* 2 theta observed and calculated and the difference */
}refIndex, *prefIndex;
/**
* search for possible indexes matching the two theta value given. This is a brute force search
* @param direct The lattice constants of the crystal
* @param lambda The wavelength used
* @param two_theta The two theta value of the reflection
* @param max_deviation maximum allowed diviation of calculated two thetas from tw-Theta given
* @param limit Index limit for the search
* @param index Preallocated array for storing index suggestions. The procedure will
* sort the entries in this array according to the difference in two theta
* @param maxIndex The number of entries allowed for index.
* @return The number of indexes in index or a negative error code when an error
* occurs.
*/
int searchIndex(lattice direct, double lambda, double two_theta, double max_deviation,
int limit, refIndex index[], int maxIndex);
#endif