- Added bridge functions to histmemsec to make it look more like histmem
- Modifed many modules using histmem to work also with histmemsec - Extended tasker with task names and task groups - There is a new taskobj which allows to list tasks and to interact with them. - Task now supports running Tcl functions as tasks - There is a new experimental sctcomtask module which allows to define communication tasks against a scriptcontext. This is a new feature which should facilitate writing sequential scripts using asynchronous communication. - A fix to make spss7 work when there are no switches - ORION support for single X. TRICS measures crystals hanging down, ORION standing up SKIPPED: psi/ease.c psi/faverage.c psi/jvlprot.c psi/make_gen psi/pardef.c psi/polterwrite.c psi/psi.c psi/sinq.c psi/spss7.c
This commit is contained in:
100
singlebi.c
100
singlebi.c
@ -228,6 +228,46 @@ static int hklInRange(void *data, double fSet[4], int mask[4])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
static int hklInRangeOrion(void *data, double fSet[4], int mask[4])
|
||||
{
|
||||
pSingleDiff self = (pSingleDiff) data;
|
||||
float fHard, fLimit;
|
||||
char pError[132];
|
||||
int i, test;
|
||||
double dTheta;
|
||||
pMotor pOmega, pChi, pPhi;
|
||||
|
||||
pOmega = SXGetMotor(Omega);
|
||||
pChi = SXGetMotor(Chi);
|
||||
pPhi = SXGetMotor(Phi);
|
||||
if (pOmega == NULL || pChi == NULL || pPhi == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check two theta */
|
||||
dTheta = fSet[0];
|
||||
mask[0] = checkTheta(self, &dTheta);
|
||||
fSet[0] = dTheta;
|
||||
|
||||
/* Orion is not upside down... */
|
||||
fSet[2] = -1.*(fSet[2]+180.) + 360. ;
|
||||
fSet[3] = circlify(fSet[3]+180.);
|
||||
|
||||
mask[1] = MotorCheckBoundary(pOmega, fSet[1], &fHard, pError, 131);
|
||||
mask[2] = MotorCheckBoundary(pChi, fSet[2], &fHard, pError, 131);
|
||||
mask[3] = MotorCheckBoundary(pPhi, fSet[3], &fHard, pError, 131);
|
||||
for (i = 0, test = 0; i < 4; i++) {
|
||||
test += mask[i];
|
||||
}
|
||||
if (test != 4) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int calculateBiSettings(pSingleDiff self,
|
||||
double *hkl, double *settings)
|
||||
@ -282,6 +322,60 @@ static int calculateBiSettings(pSingleDiff self,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int calculateBiSettingsOrion(pSingleDiff self,
|
||||
double *hkl, double *settings)
|
||||
{
|
||||
MATRIX z1;
|
||||
double stt, om, chi, phi, psi, ompsi, chipsi, phipsi, myPsi;
|
||||
int i, test, mask[4], iRetry;
|
||||
double lambda;
|
||||
|
||||
myPsi = hkl[3];
|
||||
if (myPsi > 0.1) {
|
||||
iRetry = 1;
|
||||
} else {
|
||||
iRetry = 699;
|
||||
}
|
||||
|
||||
z1 = calculateScatteringVector(self, hkl);
|
||||
|
||||
/*
|
||||
just the plain angle calculation
|
||||
*/
|
||||
if (!z1mToBisecting(self->lambda, z1, &stt, &om, &chi, &phi)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
settings[0] = stt;
|
||||
settings[1] = om;
|
||||
settings[2] = -1.*(180.+chi) + 360.;
|
||||
settings[3] = phi+180.;
|
||||
if (iRetry == 1) {
|
||||
rotatePsi(om, chi, phi, myPsi, &ompsi, &chipsi, &phipsi);
|
||||
settings[1] = ompsi;
|
||||
settings[2] = circlify(chipsi);
|
||||
settings[3] = circlify(phipsi);
|
||||
return 1;
|
||||
} else {
|
||||
if (hklInRange(self, settings, mask) == 1) {
|
||||
return 1;
|
||||
} else {
|
||||
if (tryOmegaTweak(self, z1, &stt, &om, &chi, &phi) == 1) {
|
||||
settings[0] = stt;
|
||||
settings[1] = om;
|
||||
settings[2] = chi;
|
||||
settings[3] = phi;
|
||||
return 1;
|
||||
} else {
|
||||
return findAllowedBisecting(self->lambda, z1, settings, hklInRangeOrion,
|
||||
self);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int settingsToBiList(struct __SingleDiff *self, double *settings)
|
||||
{
|
||||
@ -471,3 +565,9 @@ void initializeSingleBisecting(pSingleDiff diff)
|
||||
diff->calcUBFromThree = calcBiUBFromThree;
|
||||
diff->calcZ1 = calcBiZ1;
|
||||
}
|
||||
/*--------------------------------------------------------------------*/
|
||||
void initializeSingleBisectingOrion(pSingleDiff diff)
|
||||
{
|
||||
initializeSingleBisecting(diff);
|
||||
diff->calculateSettings = calculateBiSettingsOrion;
|
||||
}
|
||||
|
Reference in New Issue
Block a user