PSI UPDATE
r2720 | ffr | 2008-10-13 15:40:07 +1100 (Mon, 13 Oct 2008) | 2 lines
This commit is contained in:
23
mesure.c
23
mesure.c
@@ -987,10 +987,28 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static double getProtonAverage(pMesure self){
|
||||
int np, i;
|
||||
long *lData = NULL, lSum = 0;
|
||||
|
||||
np = GetScanNP(self->pScanner);
|
||||
lData = (long *)malloc((np+1)*sizeof(long));
|
||||
if(lData == NULL || np == 0){
|
||||
return 0.;
|
||||
}
|
||||
memset(lData,0,(np+1)*sizeof(long));
|
||||
GetScanMonitor(self->pScanner,2,lData, np);
|
||||
for(i = 0; i < np; i++){
|
||||
lSum += lData[i];
|
||||
}
|
||||
return (double)lSum/(double)np;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int WriteReflection(pMesure self, float fHKL[3],SConnection *pCon)
|
||||
{
|
||||
float fSum, fSigma, fSet[4], fTemp, fPreset, fStep;
|
||||
double prot;
|
||||
static float fMax = 10.;
|
||||
int iRet, i,ii, iLF, iNP;
|
||||
char pBueffel[512], pNum[10], pTime[132];
|
||||
@@ -1107,8 +1125,9 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
SNXFormatTime(pBueffel,512);
|
||||
GetScanVarStep(self->pScanner,0,&fStep);
|
||||
fPreset = GetScanPreset(self->pScanner);
|
||||
fprintf(self->fRefl,"%3d %7.4f %9.0f %7.3f %s\n",iNP,fStep,
|
||||
fPreset,fTemp,pBueffel);
|
||||
prot = getProtonAverage(self);
|
||||
fprintf(self->fRefl,"%3d %7.4f %9.0f %7.3f %12f %s\n",iNP,fStep,
|
||||
fPreset,fTemp,prot, pBueffel);
|
||||
for(i = 0; i < iNP; i++)
|
||||
{
|
||||
for(ii = 0; ii < 10 && i < iNP; ii++)
|
||||
|
||||
Reference in New Issue
Block a user