- Fixed SICS up to run with up to three TRICS detectors.

- added 150 detectors the default for FOCUS middle bank.
- added documentation for el734_test
This commit is contained in:
cvs
2001-02-09 16:04:46 +00:00
parent 96e2fc44c0
commit 5be8359212
24 changed files with 1842 additions and 224 deletions

View File

@@ -6,6 +6,8 @@
Mark Koennecke, August 1997 - November 1998
Updated to support the larger detector resolution and possible
TOF and stroboscopic modes, Mark Koennecke, February 2001
Copyright:
@@ -198,10 +200,11 @@
char pBueffel[512];
float fVal;
int iVal, iSet;
int32 iAxis[128];
int32 iAxis[256];
int i, iRet;
long lVal;
HistInt lData[65536];
HistInt *lData = NULL;
const float *fTime = NULL;
CommandList *pCom = NULL;
pHistMem self = NULL;
CounterMode eMode;
@@ -211,6 +214,7 @@
float fRot, fTilt, fLambda;
pDummy pDum;
pIDrivable pDrive;
int iDim[MAXDIM], nDim, histSize;
/* start file */
Nfil = SNXStartSANS(pCon,pSics);
@@ -555,14 +559,64 @@
NXDputalias(Nfil,pDict,"ddmo",&iVal);
fVal = GetHistCountTime(self,pCon);
NXDputalias(Nfil,pDict,"ddtime",&fVal);
GetHistogram(self,pCon,0,0,65536,lData,65536*sizeof(HistInt));
/*
Deal with actual histogram. Due to stroboscopic modes and the
new detector electronics we need to find out about the size
ourselves now. And possibly write time binning information.
*/
GetHistDim(self, iDim,&nDim);
histSize = 1;
for(i = 0; i < nDim; i++)
{
histSize *= iDim[i];
}
lData = (HistInt *)malloc(histSize*sizeof(HistInt));
if(!lData)
{
SCWrite(pCon,"ERROR: out of memory, FAILED to store data, file corrupt",
eError);
NXclose(&Nfil);
return 0;
}
GetHistogram(self,pCon,0,0,histSize,lData,histSize*sizeof(HistInt));
sprintf(pBueffel," %d ",iDim[0]);
NXDupdate(pDict,"dim1",pBueffel);
sprintf(pBueffel," %d ",iDim[1]);
NXDupdate(pDict,"dim2",pBueffel);
if(nDim == 2)
{
sprintf(pBueffel," -rank 2 -dim {%d,%d} ", iDim[0], iDim[1]);
NXDupdate(pDict,"countdim",pBueffel);
}
else if (nDim == 3)
{
sprintf(pBueffel," -rank 3 -dim {%d,%d,%d} ", iDim[0], iDim[1],
iDim[2]);
NXDupdate(pDict,"countdim",pBueffel);
sprintf(pBueffel," %d ",iDim[2]);
NXDupdate(pDict,"timedim",pBueffel);
}
NXDputalias(Nfil,pDict,"ddcounts",lData);
for(i = 0; i < 256; i++)
free(lData);
/* write x and y axis */
for(i = 0; i < iDim[0]; i++)
{
iAxis[i] = i;
}
NXDputalias(Nfil,pDict,"ddcx",iAxis);
for(i = 0; i < iDim[1]; i++)
{
iAxis[i] = i;
}
NXDputalias(Nfil,pDict,"ddcy",iAxis);
/* write time binning if appropriate */
if(nDim == 3)
{
fTime = GetHistTimeBin(self,&iVal);
NXDputalias(Nfil,pDict,"ddtb",(void *)fTime);
}
if(pSiem)
{
iRet = SPSGetADC(pSiem,1,&iVal);
@@ -579,6 +633,10 @@
NXDaliaslink(Nfil,pDict,"dan","ddcy");
NXDaliaslink(Nfil,pDict,"dan","ddmo");
NXDaliaslink(Nfil,pDict,"dan","vlambda");
if(nDim == 3)
{
NXDaliaslink(Nfil,pDict,"dan","ddtb");
}
/* send quieck message for autoamtic copying*/
i = 131;