- Removed old code
- Extended tasker to support task groups - Added task functions for motors and counters - Modifed devexec to use the new task functions - Modified TAS to treat the monochromator separatly - Coded a EIGER monochromator module to reflect even more new requirements - Added EPICS counters and motors - Modified multicounter to be better performing SKIPPED: psi/eigermono.c psi/make_gen psi/makefile_linux psi/psi.c psi/sinqhttp.c
This commit is contained in:
49
hkl.c
49
hkl.c
@ -26,6 +26,10 @@
|
||||
Heavily reworked to fit into the new four circle setup
|
||||
|
||||
Mark Koennecke, July 2008
|
||||
|
||||
Added calculation of angles between reflection
|
||||
|
||||
Mark Koennecke, March 2013
|
||||
-----------------------------------------------------------------------------*/
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
@ -687,6 +691,47 @@ static int HKLCalculateTheta(pHKL self, float fHKL[3], double *stt)
|
||||
*stt = 2. * theta;
|
||||
return status;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static int HKLAngle(SConnection *pCon, int argc, char *argv[])
|
||||
{
|
||||
reflection r1, r2;
|
||||
lattice direct;
|
||||
const double *cell;
|
||||
MATRIX B;
|
||||
double ang;
|
||||
|
||||
if(argc < 8){
|
||||
SCWrite(pCon,"ERROR: insufficient no of arguments to hkl angle",eError);
|
||||
return 0;
|
||||
}
|
||||
r1.h = atof(argv[2]);
|
||||
r1.k = atof(argv[3]);
|
||||
r1.l = atof(argv[4]);
|
||||
|
||||
r2.h = atof(argv[5]);
|
||||
r2.k = atof(argv[6]);
|
||||
r2.l = atof(argv[7]);
|
||||
|
||||
cell = SXGetCell();
|
||||
direct.a = cell[0];
|
||||
direct.b = cell[1];
|
||||
direct.c = cell[2];
|
||||
direct.alpha = cell[3];
|
||||
direct.beta = cell[4];
|
||||
direct.gamma = cell[5];
|
||||
|
||||
B = mat_creat(3,3,ZERO_MATRIX);
|
||||
if(B == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory in HKL angle",eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
calculateBMatrix(direct,B);
|
||||
ang = angleBetweenReflections(B,r1,r2);
|
||||
SCPrintf(pCon,eValue,"angle = %f", ang);
|
||||
mat_free(B);
|
||||
return 1;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static int HandleBiToNB(SConnection *pCon, int argc, char *argv[])
|
||||
{
|
||||
@ -993,6 +1038,10 @@ int HKLAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
SCPrintf(pCon, eValue, "two-theta = %lf", stt);
|
||||
return 1;
|
||||
}
|
||||
/*--------------- calculate angle */
|
||||
else if (strcmp(argv[1], "angle") == 0) {
|
||||
return HKLAngle(pCon,argc,argv);
|
||||
}
|
||||
/*------------------ run */
|
||||
else if (strcmp(argv[1], "run") == 0) {
|
||||
if (!SCMatchRights(pCon, usUser)) {
|
||||
|
Reference in New Issue
Block a user