- added third monitor to AMOR
- prepared monitor writing for SANS - created a separate powder diffractometer simulation - updated histogram memory code to read SANS gummi monitor packets - updated histogram memory to read third single detector = TOF-monitor
This commit is contained in:
16
nxamor.c
16
nxamor.c
@@ -9,6 +9,7 @@
|
||||
|
||||
Mark Koennecke, September 1999
|
||||
Updated, Mark Koennecke, August 2001
|
||||
Updated to store TOF-monitor, Mark Koennecke, September 2002
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -624,11 +625,12 @@ static int WriteTOFDetector(char *name, pHistMem pHM, int *iDim,
|
||||
} else {
|
||||
SCWrite(pCon,"PSD writing supressed!",eWarning);
|
||||
}
|
||||
#define MAXSINGLE 3
|
||||
/*
|
||||
now get and write single detectors
|
||||
*/
|
||||
iLength = iDim[0]*iDim[1]*iDim[2];
|
||||
lData = (HistInt *)malloc(2*iDim[2]*sizeof(HistInt));
|
||||
lData = (HistInt *)malloc(MAXSINGLE*iDim[2]*sizeof(HistInt));
|
||||
if(!lData)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: out of memory while writing single detectors",
|
||||
@@ -636,12 +638,18 @@ static int WriteTOFDetector(char *name, pHistMem pHM, int *iDim,
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(lData,0,2*iDim[2]*sizeof(HistInt));
|
||||
GetHistogramDirect(pHM,pCon,0,iLength,2*iDim[2],
|
||||
lData, 2*iDim[2]*sizeof(HistInt));
|
||||
memset(lData,0,MAXSINGLE*iDim[2]*sizeof(HistInt));
|
||||
GetHistogramDirect(pHM,pCon,0,iLength,MAXSINGLE*iDim[2],
|
||||
lData, MAXSINGLE*iDim[2]*sizeof(HistInt));
|
||||
NXDputalias(hfil,hdict,"singleup",lData);
|
||||
NXDaliaslink(hfil,hdict,"singledana","singleup");
|
||||
NXDaliaslink(hfil,hdict,"singledana","singletime");
|
||||
/*
|
||||
the TOF monitor
|
||||
*/
|
||||
NXDputalias(hfil,hdict,"singletofmon",lData+2*iDim[2]);
|
||||
NXDaliaslink(hfil,hdict,"dana","singletofmon");
|
||||
NXDaliaslink(hfil,hdict,"singledana","singletofmon");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user