From 714b8ae84d7379d71310e513ff9ebf42644b8ed5 Mon Sep 17 00:00:00 2001 From: cvs Date: Fri, 31 Mar 2000 13:16:50 +0000 Subject: [PATCH] - Fixed a bug which caused the SICServer to die when a socket was broken. - Fixed many things in DIFRAC subsystem: * Recoded tcentr.f etc so that the course centering will work and will not go into an endless loop. * fixed boundary overwrites which occurred when yesno or alfnum where uset to get a single character and several were given. * Addeded documentation for DIFRAC - Added tcl-files which support the WWW status system --- commandlog.c | 8 + conman.c | 65 +- danu.dat | 2 +- devexec.c | 10 +- difrac/Makefile | 2 +- difrac/align.f | 11 +- difrac/blind.f | 5 +- difrac/cfind.f | 43 +- difrac/cinput.f | 5 +- difrac/difint.f | 22 +- difrac/mesint.f | 5 +- difrac/pfind.f | 17 +- difrac/prnbas.f | 6 +- difrac/profil.f | 14 +- difrac/rcpcor.f | 7 +- difrac/setop.f | 25 +- difrac/tcentr.f | 123 +- difrac/tfind.f | 27 +- difrac/yesno.f | 5 +- doc/user/diftrics.htm | 2606 +++++++++++++++++++++++++++++++++++++++ doc/user/tricsingle.htm | 10 +- drive.c | 32 +- fowrite.c | 8 +- histmem.c | 7 +- nread.c | 3 +- nxsans.c | 3 + scan.c | 24 + sicsstatus.tcl | 28 +- tcl/count.tcl | 14 +- tcl/scancom.tcl | 45 +- tcl/wwwpulver.tcl | 43 + telnet.c | 29 +- test.tcl | 15 +- topsi.hdd | 1 + ufortify.h | 2 +- 35 files changed, 3069 insertions(+), 203 deletions(-) create mode 100644 doc/user/diftrics.htm create mode 100644 tcl/wwwpulver.tcl diff --git a/commandlog.c b/commandlog.c index 0f29dfd0..12748631 100644 --- a/commandlog.c +++ b/commandlog.c @@ -58,6 +58,14 @@ { return; } + + /* suppress TRANSACTIONFINISHED as well in order to make the WWW + commandlog work + */ + if(strstr(pText,"TRANSACTIONFINISHED") != NULL) + { + return; + } /* create tail buffer as needed */ if(!pTail) diff --git a/conman.c b/conman.c index 83cf6ffe..150bfefb 100644 --- a/conman.c +++ b/conman.c @@ -367,6 +367,21 @@ extern pServer pServ; return; } + if(pVictim->inUse > 0) + { + SCnoSock(pVictim); + if(pVictim->pSock) + { + NETClosePort(pVictim->pSock); + free(pVictim->pSock); + pVictim->pSock = NULL; + } + WriteToCommandLog("SYS> ", + "ERROR: Erraneous deletion of used Connection stopped"); + return; + } + + /* remove the connection from the server log if it has captured something */ @@ -471,6 +486,7 @@ extern pServer pServ; { char *pStart = NULL, *pPtr; int iCount, iState; + int iRet = 1; pStart = pBuffer; pPtr = pStart; @@ -484,8 +500,8 @@ extern pServer pServ; if( (*pPtr == '\r') || (*pPtr == '\n') ) { iState = LF; - NETWrite(pSock,pStart,iCount); - NETWrite(pSock,"\r\n",2); + iRet = NETWrite(pSock,pStart,iCount); + iRet = NETWrite(pSock,"\r\n",2); iCount = 0; } else @@ -510,10 +526,10 @@ extern pServer pServ; } if(iCount > 0) { - NETWrite(pSock,pStart,iCount); - NETWrite(pSock,"\r\n",2); + iRet = NETWrite(pSock,pStart,iCount); + iRet = NETWrite(pSock,"\r\n",2); } - return 1; + return iRet; } /*-------------------------------------------------------------------------*/ int SCWrite(SConnection *self, char *pBuffer, int iOut) @@ -566,7 +582,7 @@ extern pServer pServ; { if(self->iTelnet) { - TelnetWrite(self->pSock,buffer); + iRet = TelnetWrite(self->pSock,buffer); } else { @@ -576,6 +592,11 @@ extern pServer pServ; iRet = NETWrite(self->pSock,"\n",sizeof("\n")); } } + if(!iRet) + { + SCnoSock(self); + WriteToCommandLog("SYS> ","Connection broken on send"); + } } else { @@ -594,7 +615,7 @@ extern pServer pServ; { if(self->iTelnet) { - TelnetWrite(self->pSock,buffer); + iRet = TelnetWrite(self->pSock,buffer); } else { @@ -605,7 +626,10 @@ extern pServer pServ; } } if(!iRet) - return 0; + { + SCnoSock(self); + WriteToCommandLog("SYS> ","Send broken to connection"); + } } else { @@ -863,6 +887,7 @@ extern pServer pServ; int iRet, i; char *pPtr = NULL; + char pFrom[50]; Status eOld; if(!VerifyConnection(pCon)) @@ -890,6 +915,8 @@ extern pServer pServ; SetStatus(eOld); CostaLock(pCon->pStack); strncpy(pResult,pPtr,iLen); + sprintf(pFrom,"Prompted from sock %2.2d: ", pCon->pSock->sockid); + WriteToCommandLog(pFrom,pPtr); return 1; } } @@ -1360,9 +1387,16 @@ extern pServer pServ; return 0; } - if(self->iEnd) + if(self->iEnd) { - return 0; + if(self->inUse != 0) + { + return 1; + } + else + { + return 0; + } } @@ -1379,9 +1413,16 @@ extern pServer pServ; free(pPtr); } } - if(self->iEnd) + if(self->iEnd) { - return 0; + if(self->inUse != 0) + { + return 1; + } + else + { + return 0; + } } return 1; diff --git a/danu.dat b/danu.dat index 3f83a3ad..0140f812 100644 --- a/danu.dat +++ b/danu.dat @@ -1,3 +1,3 @@ - 5378 + 5424 NEVER, EVER modify or delete this file You'll risk eternal damnation and a reincarnation as a cockroach!|n \ No newline at end of file diff --git a/devexec.c b/devexec.c index b27bff3b..8b9fd467 100644 --- a/devexec.c +++ b/devexec.c @@ -386,6 +386,11 @@ DeleteDevEntry(pDev); LLDnodeDelete(self->iList); iRet = LLDnodePtr2Prev(self->iList); + if(SCGetInterrupt(self->pOwner) != eContinue) + { + self->iStatus = DEVINT; + return -1; + } self->iStatus = DEVDONE; break; case HWFault: /* real HW error: burning, no net etc.. */ @@ -400,7 +405,6 @@ if(SCGetInterrupt(self->pOwner) != eContinue) { self->iStatus = DEVINT; - StopExe(self,"all"); return -1; } break; @@ -443,7 +447,6 @@ if(SCGetInterrupt(self->pOwner) != eContinue) { self->iStatus = DEVINT; - StopExe(self,"all"); return -1; } break; @@ -907,7 +910,8 @@ { if(self->pOwner) { - SCWrite(self->pOwner,"ERROR: Interrupting Current Hardware Operation", + SCWrite(self->pOwner, + "ERROR: Interrupting Current Hardware Operation", eError); SCSetInterrupt(self->pOwner,*iInt); } diff --git a/difrac/Makefile b/difrac/Makefile index 392e251e..ed6875b8 100644 --- a/difrac/Makefile +++ b/difrac/Makefile @@ -3,7 +3,7 @@ # # Mark Koennecke, November 1999 #---------------------------------------------------------------------------- -CFLAGS = -g -c +CFLAGS = -C -g -c FL = f77 $(CFLAGS) ROOT = .. LIBS = $(ROOT)\libs diff --git a/difrac/align.f b/difrac/align.f index edde08e7..65393f9c 100644 --- a/difrac/align.f +++ b/difrac/align.f @@ -474,7 +474,7 @@ C----------------------------------------------------------------------- SUBROUTINE ALEDIT (NTOT) INCLUDE 'COMDIF' DIMENSION NDEL(100) - CHARACTER IOPT*1 + CHARACTER IOPT*1,LINE*80 C----------------------------------------------------------------------- C Read in the existing list of h,k,l values and write it to terminal C----------------------------------------------------------------------- @@ -504,7 +504,8 @@ C----------------------------------------------------------------------- C Get the edit option IOPT C----------------------------------------------------------------------- WRITE (COUT,13000) - CALL ALFNUM (IOPT) + CALL ALFNUM (LINE) + IOPT = LINE(1:1) IF (IOPT .EQ. ' ') IOPT = 'U' C----------------------------------------------------------------------- C Option E. Exit from AL with 0 reflns @@ -519,7 +520,8 @@ C----------------------------------------------------------------------- IF (IOPT .EQ. 'U') THEN ITRUE = 0 WRITE (COUT,14100) - CALL YESNO ('N',ANS) + CALL YESNO ('N',LINE) + ANS = LINE(1:1) IF (ANS .EQ. 'Y') ITRUE = 1 RETURN ENDIF @@ -530,7 +532,8 @@ C----------------------------------------------------------------------- IF (IOPT .EQ. 'N') NTOT = 0 ISYMOR = 0 WRITE (COUT,14000) - CALL YESNO ('Y',ANS) + CALL YESNO ('Y',LINE) + ANS = LINE(1:1) IF (ANS .EQ. 'Y') THEN ISYMOR = 1 IOUT = -1 diff --git a/difrac/blind.f b/difrac/blind.f index 3830d1a5..c1a2eacc 100644 --- a/difrac/blind.f +++ b/difrac/blind.f @@ -576,7 +576,7 @@ C EDLIST Edit the reflection list C-------------------------------------------------------------------- SUBROUTINE EDLIST INCLUDE 'COMDIF' - CHARACTER FLAG*1,REFNAM*40 + CHARACTER FLAG*1,REFNAM*40,LINE*80 DIMENSION THETAS(NSIZE), $ OMEGAS(NSIZE),CHIS(NSIZE),PHIS(NSIZE),ICNTS(NSIZE) EQUIVALENCE (ACOUNT( 1),THETAS(1)), @@ -596,7 +596,8 @@ C-------------------------------------------------------------------- 90 WRITE (COUT,11000) CALL GWRITE (ITP,' ') 100 WRITE (COUT,12000) - CALL ALFNUM (ANS) + CALL ALFNUM (LINE) + ANS = LINE(1:1) IF (ANS .NE. 'L' .AND. ANS .NE. 'D' .AND. ANS .NE. 'R' .AND. $ ANS .NE. 'A' .AND. ANS .NE. 'F' .AND. ANS .NE. 'E') $ GO TO 90 diff --git a/difrac/cfind.f b/difrac/cfind.f index 5bf774aa..beed4b8d 100644 --- a/difrac/cfind.f +++ b/difrac/cfind.f @@ -1,24 +1,31 @@ C----------------------------------------------------------------------- C Subroutine to find the coarse centre for Chi C----------------------------------------------------------------------- - SUBROUTINE CFIND (TIM) + SUBROUTINE CFIND (TIM,MAXCOUNT) INCLUDE 'COMDIF' + REAL MAXCOUNT, MCOUNT DIMENSION TCOUNT(NSIZE) EQUIVALENCE (ACOUNT(9*NSIZE+1),TCOUNT(1)) ICPSMX = 25000 STEPM = 0.02 SENSE = -1.0 - CSTEP = 0.25 + CSTEP = 1.5 NPTS = 10 - CHI = CHI + NPTS*CSTEP/2 + NRUN = 0 100 IF (CHI .LT. 0) CHI = CHI + 360 IF (CHI .GE. 360) CHI = CHI - 360 + CHI = CHI + NPTS*CSTEP/2 CHISV = CHI 110 CALL ANGSET (THETA,OMEGA,CHISV,PHI,NATT,ICOL) ICOUNT = 0 MCOUNT = 0 DO 120 I = 1,NPTS CALL CCTIME (TIM,TCOUNT(I)) + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF IF (TCOUNT(I)/TIM .GT. ICPSMX .AND. NATT .LT. NATTEN) THEN NATT = NATT + 1 GO TO 110 @@ -32,25 +39,25 @@ C----------------------------------------------------------------------- IF (CHI .GE. 360) CHI = CHI - 360 CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) 120 CONTINUE + MAXCOUNT = REAL(MCOUNT) IF (ICOUNT .EQ. 1) THEN +C +C try the other direction, but only once otherwise we get into an +C endless loop +C + IF(NRUN .GT. 0) THEN + MAXCOUNT = 0. + RETURN + ENDIF SENSE = -SENSE - CHI = CHI + 9*SENSE*CSTEP + CHI = CHISV + 9*SENSE*CSTEP + NRUN = NRUN + 1 GO TO 100 - ELSE IF (ICOUNT .EQ. 10) THEN - CHI = CHI - 3*SENSE*CSTEP + ELSE IF (ICOUNT .EQ. 20) THEN + CHI = CHISV - 3*SENSE*CSTEP GO TO 100 ENDIF - CHI = CHI + (ICOUNT - 12.25)*SENSE*CSTEP - IF(TCOUNT(ICOUNT) .GT. 0)THEN - TIM = 500.*TIM/TCOUNT(ICOUNT) - ELSE - TIM = 500 * TIM - ENDIF - IF (TIM .LT. 10000.0) THEN - IF (TIM .LT. 1000.) TIM =1000. - CSTEP = CSTEP/4 - IF (CSTEP .GT. STEPM) GO TO 100 - ENDIF - CHI = CHI + 5*SENSE*CSTEP +C CHI = CHI + (ICOUNT - 12.25)*SENSE*CSTEP + CHI = CHISV + ICOUNT*SENSE*CSTEP RETURN END diff --git a/difrac/cinput.f b/difrac/cinput.f index 189be3ee..c0c73884 100644 --- a/difrac/cinput.f +++ b/difrac/cinput.f @@ -5,7 +5,7 @@ C----------------------------------------------------------------------- INCLUDE 'COMDIF' DIMENSION A(3),ALP(3),SYS(7),TRANS(3,3,7),AA(3,3),PRIM(3), $ ANPRIM(3),TRANSF(3,3),H(3,3) - CHARACTER CATMOD*1,SYS*1 + CHARACTER CATMOD*1,SYS*1,LINE*80 DATA SYS/'P','A','B','C','I','F','R'/ DATA TRANS/ 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0,.5,.5, $ 0, 0, 1, .5, 0,.5, 0, 1, 0, 0, 0, 1, .5,.5, 0, @@ -20,7 +20,8 @@ C----------------------------------------------------------------------- ALP(I) = RADEG*ATAN2(SANG(I),CANG(I)) 100 CONTINUE 110 WRITE (COUT,10000) - CALL ALFNUM (CATMOD) + CALL ALFNUM (LINE) + CATMOD = LINE(1:1) IF (CATMOD .EQ. ' ') CATMOD = 'P' READ (CATMOD,11000) ATMOD WRITE (COUT,12000) A,ALP,CATMOD diff --git a/difrac/difint.f b/difrac/difint.f index 6d93997c..949585d3 100644 --- a/difrac/difint.f +++ b/difrac/difint.f @@ -12,6 +12,7 @@ C----------------------------------------------------------------------- SUBROUTINE DIFINT(COMMAND, LEN) INTEGER COMMAND(256), LEN INCLUDE 'COMDIF' + CHARACTER STRING*80 KI(1:1) = CHAR(COMMAND(1)) KI(2:2) = CHAR(COMMAND(2)) @@ -83,7 +84,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 2) THEN @@ -91,7 +93,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 3) THEN @@ -99,7 +102,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 4) THEN @@ -107,7 +111,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 5) THEN @@ -115,7 +120,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 6) THEN @@ -125,7 +131,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (DFMODL .EQ. 'CAD4' .AND. (I .EQ. 0 .OR. I .EQ. 7)) THEN @@ -133,7 +140,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF ENDIF diff --git a/difrac/mesint.f b/difrac/mesint.f index 85b543db..5ddf9799 100644 --- a/difrac/mesint.f +++ b/difrac/mesint.f @@ -26,7 +26,10 @@ C----------------------------------------------------------------------- IWARN = 0 ISIGN = 1 IF (THETA .LT. 0.0 .OR. THETA .GT. 180.0) ISIGN = -1 - D12 = BS*ABS(TAN(0.5*THETA/DEG)) +C---- Modified MK: there is no alpha1 alpha2 separation with neutrons +C D12 = BS*ABS(TAN(0.5*THETA/DEG)) + D12 = 0. +C---- end of modification TTIME = 0.20*PRESET 110 CALL SHUTTR (1) IF (NATTEN .GT. 0) THEN diff --git a/difrac/pfind.f b/difrac/pfind.f index 9b0b9fd9..d7630ed9 100644 --- a/difrac/pfind.f +++ b/difrac/pfind.f @@ -1,8 +1,9 @@ C----------------------------------------------------------------------- C Get the coarse value of Phi for PCENTR C----------------------------------------------------------------------- - SUBROUTINE PFIND (TIM) + SUBROUTINE PFIND (TIM,MAXCOUNT) INCLUDE 'COMDIF' + REAL MAXCOUNT, MCOUNT DIMENSION PCOUNT(NSIZE) EQUIVALENCE (ACOUNT(9*NSIZE + 1), PCOUNT(1)) C----------------------------------------------------------------------- @@ -30,6 +31,11 @@ C----------------------------------------------------------------------- MCOUNT = 0 DO 110 I = 1,NPTS CALL CCTIME (TIM,PCOUNT(I)) + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF IF (PCOUNT(I) .GT. MCOUNT) THEN MCOUNT = PCOUNT(I) ICOUNT = I @@ -39,16 +45,11 @@ C----------------------------------------------------------------------- IF (PHI .GE. 360.0) PHI = PHI - 360.0 CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) 110 CONTINUE + MAXCOUNT = REAL(MCOUNT) IF (ICOUNT .EQ. 1 .OR. ICOUNT .EQ. NPTS) THEN - TIM = 5.0 + TIM = -5.0 RETURN ENDIF PHI = PHIOFF + (ICOUNT - 1)*PSTEP - TIM = 500.0*TIM/PCOUNT(ICOUNT) - IF (TIM .LT. 10000.0) THEN - IF (TIM .LT. 1000.) TIM = 1000. - PSTEP = PSTEP/4 - IF (PSTEP .GT. STEPM) GO TO 100 - ENDIF RETURN END diff --git a/difrac/prnbas.f b/difrac/prnbas.f index 983d2efb..dcb45401 100644 --- a/difrac/prnbas.f +++ b/difrac/prnbas.f @@ -6,7 +6,8 @@ C----------------------------------------------------------------------- DIMENSION RW(3,3),ANG(3) CHARACTER CPROF*4,STRING*10 WRITE (COUT,10000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) KZ = -1 IF (ANS .EQ. ' ' .OR. ANS .EQ. '0') KZ = 0 IF (ANS .EQ. '1') KZ = 1 @@ -115,7 +116,8 @@ C----------------------------------------------------------------------- C Pause to allow users to read the screen C----------------------------------------------------------------------- WRITE (COUT,20000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) C----------------------------------------------------------------------- C Theta min/max and h,k,l max data C----------------------------------------------------------------------- diff --git a/difrac/profil.f b/difrac/profil.f index ad564c49..e813c335 100644 --- a/difrac/profil.f +++ b/difrac/profil.f @@ -183,8 +183,10 @@ C The profile is suitable for analysis to find the limits C J1 is the beginning of the low angle search C J2 is the beginning of the high angle search C----------------------------------------------------------------------- - J1 = MAXI - STEPOF*CON*AS - A2*ID12 - J2 = MAXI + STEPOF*CON*CS + A1*ID12 +C J1 = MAXI - STEPOF*CON*AS - A2*ID12 +C J2 = MAXI + STEPOF*CON*CS + A1*ID12 + J1 = MAXI - ((STEPOF*AS)/STEP) - A2*ID12 + J2 = MAXI + ((STEPOF*CS)/STEP) + A1*ID12 IF (J1 .LE. NWIND .OR. J2 .GE. NP-NWIND) THEN ILOW = 1 IHIGH = NP @@ -255,6 +257,9 @@ C----------------------------------------------------------------------- DO 220 I = 1,ILOW-1 B1 = B1 + ACOUNT(I) 220 CONTINUE +C---mk + B1 = B1/ILOW +C--- ENDIF FRAC1 = (FRAC*NP + ILOW - 1)/NPK PEAK = 0.0 @@ -266,9 +271,12 @@ C----------------------------------------------------------------------- DO 230 I = IHIGH+1,NP B2 = B2 + ACOUNT(I) 230 CONTINUE + IDIV = NP - IHIGH + IF(IDIV .LE. 0)IDIV =1 + B2 = B2/IDIV ENDIF FRAC2 = (FRAC*NP + NP - IHIGH)/NPK - BTOT = 0.5*(B1/FRAC1 + B2/FRAC2) + BTOT = 0.5*(B1/FRAC1 + B2/FRAC2)*NP TOP1 = PEAK - BTOT BOT1 = SQRT(PEAK + 0.25*(B1/(FRAC1*FRAC1) + B2/(FRAC2*FRAC2))) FRAC1 = 0.5*(FRAC1 + FRAC2) diff --git a/difrac/rcpcor.f b/difrac/rcpcor.f index f6ec4b2f..50cf7957 100644 --- a/difrac/rcpcor.f +++ b/difrac/rcpcor.f @@ -8,6 +8,7 @@ C----------------------------------------------------------------------- SUBROUTINE RCPCOR INCLUDE 'COMDIF' DIMENSION RM1(3,3),XA(3),HA(3) + CHARACTER STRING*80 IF (KI .EQ. 'AH') THEN WRITE (COUT,10000) CALL GWRITE (ITP,' ') @@ -58,7 +59,8 @@ C Index faces for ABSORP when they are set so that the face normal is C in the equator plane and normal to the microscope viewing direction C at the Kappa angles -45, 78, kappa (-60 start), phi (0 start) C----------------------------------------------------------------------- - SUBROUTINE FACEIN + SUBROUTINE FACEIN + CHARACTER STRING*80 INCLUDE 'COMDIF' DATA ISENSE/-1/ NATT = 0 @@ -79,7 +81,8 @@ C----------------------------------------------------------------------- C Get the adjusted angles and transform them C----------------------------------------------------------------------- 100 WRITE (COUT,11000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) C write (cout,99990) C99990 format (' Type omk, kap, phk for face ',$) C call freefm (itr) diff --git a/difrac/setop.f b/difrac/setop.f index 3221efa5..0b36b1c9 100644 --- a/difrac/setop.f +++ b/difrac/setop.f @@ -11,8 +11,10 @@ C C----------------------------------------------------------------------- SUBROUTINE SETOP INCLUDE 'COMDIF' + CHARACTER STRING*80 100 WRITE (COUT,10000) - CALL ALFNUM (KI) + CALL ALFNUM (STRING) + KI = STRING(1:2) IF (KI .EQ. 'Q') THEN CALL WNEND STOP @@ -74,7 +76,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 2) THEN @@ -82,7 +85,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 3) THEN @@ -90,7 +94,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 4) THEN @@ -98,7 +103,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 5) THEN @@ -106,7 +112,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (I .EQ. 0 .OR. I .EQ. 6) THEN @@ -116,7 +123,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF IF (DFMODL .EQ. 'CAD4' .AND. (I .EQ. 0 .OR. I .EQ. 7)) THEN @@ -124,7 +132,8 @@ C----------------------------------------------------------------------- CALL GWRITE (ITP,' ') IF (I .EQ. 0) THEN WRITE (COUT,14000) - CALL ALFNUM (ANS) + CALL ALFNUM (STRING) + ANS = STRING(1:1) ENDIF ENDIF ENDIF diff --git a/difrac/tcentr.f b/difrac/tcentr.f index 20bf3cc3..fb545541 100644 --- a/difrac/tcentr.f +++ b/difrac/tcentr.f @@ -16,6 +16,7 @@ C----------------------------------------------------------------------- $ (ACOUNT(6*NSIZE+1),OMEGP(1)), $ (ACOUNT(7*NSIZE+1),CHIP(1)), $ (ACOUNT(8*NSIZE+1),PHIP(1)) + REAL CURCTS,MAXCTS WIDTH = 1.25 C----------------------------------------------------------------------- C Read the peaks from disk @@ -60,85 +61,57 @@ C Set the angles at the approximate position of the peak and adjust C Phi, Chi and 2Theta to get maximum intensity in the detector. C Sietronics interface works via MAXPOINT; CAD4 via CADCEN C----------------------------------------------------------------------- +C CAD-4 and Sietronics deleted for clarity: Mark Koennecke CALL SHUTTR (99) - ITIMS(J) = 0 - IF (DFMODL .EQ. 'CAD4') THEN - KI = 'SP' - CALL CADCEN (0) - IF (KI .EQ. 'FF') THEN - WHICH = 'Phi' - WRITE (COUT,13000) WHICH - CALL GWRITE (ITP,' ') - WRITE (LPT,13000) WHICH - GO TO 200 - ENDIF - 110 CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) - KI = 'ST' - IGOOD = 0 - CALL CADCEN (IGOOD) -C write (lpt,99993) ki,igood -C99993 format (' KI,igood ',a,i4) - IF (KI .EQ. 'FF' .OR. KI .EQ. 'TO' .OR. KI .EQ. 'BO') THEN - CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,IERR) - KI = 'SC' - RTIM = PRESET - CALL CFIND (RTIM) - CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) - IF (RTIM .GT. 3.0) THEN - WHICH = 'Chi' - WRITE (COUT,13000) WHICH - CALL GWRITE (ITP,' ') - WRITE (LPT,13000) WHICH - GO TO 200 - ENDIF - KI = 'SO' - IGOOD = 0 - CALL CADCEN (IGOOD) - IF (KI .EQ. 'FF') THEN - WHICH = 'Omega' - WRITE (COUT,13000) WHICH - CALL GWRITE (ITP,' ') - WRITE (LPT,13000) WHICH - GO TO 200 - ENDIF - GO TO 110 - ENDIF - IF (IGOOD .NE. 0) GO TO 110 -C----------------------------------------------------------------------- -C Sietronics 145D centring -C----------------------------------------------------------------------- - ELSE IF (DFMODL .EQ. '145D') THEN - PWIDTH = 2*WIDTH - CALL MAXPOINT (3,PWIDTH,0.1,RMAXPT) - PHI = RMAXPT - CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) - CWIDTH = 4*WIDTH - CALL MAXPOINT (2,CWIDTH,0.1,RMAXPT) - CHI = RMAXPT - OMEGA = OMEGA - 0.5*TWIDTH - CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) - TWIDTH = WIDTH - CALL MAXPOINT (4,TWIDTH,0.1,RMAXPT) - THETA = RMAXPT C----------------------------------------------------------------------- C All other machines for the moment +C Modified: Mark Koennecke for TRICS +C Do initial search. But use the results of the searches +C only if they improved the countrate. C----------------------------------------------------------------------- - ELSE - RTIM = 1000. - CALL PFIND (RTIM) - THETA = RTHETA - OMEGA = ROMEGA - IF (RTIM .GT. 10000.0) GO TO 200 -C IF (RTIM .GT. 1.0) RTIM = 1.0 - CHI = RCHI + 1.25 - CALL CFIND (RTIM) - THETA = RTHETA + 1.25 - OMEGA = OMEGA - 0.625 - IF (RTIM .GT. 10000.0) GO TO 200 -C IF (RTIM .GT. 1.0) RTIM = 1.0 - CALL TFIND (RTIM) - IF (RTIM .GT. 10000.0) GO TO 200 - ENDIF + CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) + CALL CCTIME (PRESET,CURCTS) +C----- first two theta + RTIM = PRESET + CALL TFIND(RTIM,MAXCTS) + IF(MAXCTS .LT. CURCTS) THEN + THETA = RTHETA + OMEGA = ROMEGA + ELSE + CURCTS = MAXCTS + ENDIF + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF +C----- now phi + RTIM = PRESET + CALL PFIND(RTIM,MAXCTS) + IF(MAXCTS .LT. CURCTS) THEN + PHI = RPHI + ELSE + CURCTS = MAXCTS + ENDIF + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF +C------ finally phi + RTIM = PRESET + CALL CFIND(RTIM,MAXCTS) + IF(MAXCTS .LT. CURCTS) THEN + CHI = RCHI + ELSE + CURCTS = MAXCTS + ENDIF + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF +C------- end of pre centering WRITE (COUT,11000) THETA,OMEGA,CHI,PHI CALL GWRITE (ITP,' ') WRITE (LPT,11000) THETA,OMEGA,CHI,PHI diff --git a/difrac/tfind.f b/difrac/tfind.f index c6f771e9..bf27a702 100644 --- a/difrac/tfind.f +++ b/difrac/tfind.f @@ -1,8 +1,9 @@ C----------------------------------------------------------------------- C Find the Coarse setting for 2-Theta C----------------------------------------------------------------------- - SUBROUTINE TFIND (TIM) + SUBROUTINE TFIND (TIM, MAXCOUNT) INCLUDE 'COMDIF' + REAL MAXCOUNT, MCOUNT DIMENSION TCOUNT(NSIZE) EQUIVALENCE (ACOUNT(9*NSIZE+1),TCOUNT(1)) STEPM = 0.01 @@ -10,6 +11,7 @@ C----------------------------------------------------------------------- TSTEP = 0.25 NATT = 0 NPTS = 10 + NRUN = 0 100 THEOFF = THETA OMEOFF = OMEGA CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) @@ -17,6 +19,11 @@ C----------------------------------------------------------------------- MCOUNT = 0 DO 110 I = 1,NPTS CALL CCTIME (TIM,TCOUNT(I)) + CALL KORQ (IFLAG1) + IF (IFLAG1 .NE. 1) THEN + KI = 'O4' + RETURN + ENDIF IF (TCOUNT(I) .GT. MCOUNT) THEN MCOUNT = TCOUNT(I) ICOUNT = I @@ -25,10 +32,20 @@ C----------------------------------------------------------------------- OMEGA = OMEGA - SENSE*TSTEP*0.5 CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL) 110 CONTINUE + MAXCOUNT = MCOUNT IF (ICOUNT .EQ. 1) THEN +C +C try, the other direction. But only once as checked by NRUN +C otherwise we end in an endless loop. +C + IF (NRUN .GT. 0) THEN + MAXCOUNT = 0. + RETURN + ENDIF SENSE = -SENSE THETA = THEOFF + 9.0*SENSE*TSTEP OMEGA = OMEOFF - 9.0*SENSE*TSTEP/2 + NRUN = NRUN + 1 GO TO 100 ENDIF IF (ICOUNT .EQ. 10) THEN @@ -36,14 +53,6 @@ C----------------------------------------------------------------------- OMEGA = OMEOFF + 3.0*SENSE*TSTEP/2 GO TO 100 ENDIF - THETA = THEOFF + (ICOUNT - 2.25)*SENSE*TSTEP - OMEGA = OMEOFF - 0.5*(ICOUNT - 2.25)*SENSE*TSTEP - TIM = 500.0*TIM/TCOUNT(ICOUNT) - IF (TIM .LT. 10000.0) THEN - IF (TIM .LT. 1000.) TIM = 1000. - TSTEP = TSTEP/4.0 - IF (TSTEP .GT. STEPM) GO TO 100 - ENDIF THETA = THEOFF + ICOUNT*SENSE*TSTEP OMEGA = OMEOFF - ICOUNT*SENSE*TSTEP/2 RETURN diff --git a/difrac/yesno.f b/difrac/yesno.f index cc15933e..068f6550 100644 --- a/difrac/yesno.f +++ b/difrac/yesno.f @@ -18,14 +18,15 @@ C----------------------------------------------------------------------- COMMON /IOUASS/ IOUNIT(12) CHARACTER*132 COUT(20) COMMON /IOUASC/ COUT - CHARACTER DEFOLT*1,ANS*1 + CHARACTER DEFOLT*1,ANS*1,LINE*80 ITR = IOUNIT(5) ITP = IOUNIT(6) C----------------------------------------------------------------------- C This code gets round IBM VM/CMS limitations C----------------------------------------------------------------------- 100 CALL GWRITE (ITP,'$') - CALL GETLIN (ANS) + CALL GETLIN (LINE) + ANS=LINE(1:1) IF (ANS .EQ. '?') STOP IF (ANS .EQ. 'y') ANS = 'Y' IF (ANS .EQ. 'n') ANS = 'N' diff --git a/doc/user/diftrics.htm b/doc/user/diftrics.htm new file mode 100644 index 00000000..3e07d975 --- /dev/null +++ b/doc/user/diftrics.htm @@ -0,0 +1,2606 @@ + + +DIFRAC Manual, TRIS Version + + + + +

DIFRAC Manual for TRICS

+

+

+
+           A   Fortran   77   Control  Routine   for   4   Circle
+                            Diffractometers
+
+                                  by
+
+                E. J. Gabe,  P. S. White and G. D. Enright
+
+                Steacie Institute for Molecular Structure
+                   National Research Council of Canada
+                        Ottawa,  Ontario,  Canada
+
+                                  and
+
+                        Department of Chemistry
+                     University of North Carolina
+                 Chapel Hill,  North Carolina,  U.S.A
+
+
+                   Adapted for TRICS at SINQ, PSI by
+
+                           Mark Koennecke
+                   Laboratory for Neutron Scattering
+                         Paul Scherrer Institute
+                         CH-5232 Villigen-PSI
+                            Switzerland
+
+
+

+ +

Index

+

+

+

+ +

Introduction

+

+

+     DIFRAC  performs  all the fundamental operations  associated
+with  an  X  ray  diffractometer  for  crystal  orientation   and
+intensity measurement.
+
+     The basic aims behind DIFRAC are :
+
+  1. to provide a comprehensive set of crystallographic functions
+which can   be used with any diffractometer controlled by a PC;
+  2. to provide a user interface which is easy to learn;
+  3. to   make   the   program  easily  portable  for   different
+     instruments.
+
+     These  aims,  particularly the last, have to a large  extent
+dictated the structure of the program which is highly modular and
+uses  many  of the portability concepts developed for the  NRCVAX
+structure system.
+
+     The  first  aim  has  been  realized  via  a  large  set  of
+subroutines   providing  functions  which  are  common   to   all
+diffractometers.  These are written in F77 and constitute by  far
+the  largest part of the code.  The program runs on  a  PC  under
+MS  DOS  using Microsoft compilers. All calculations are  carried
+out  in a standard right handed Euler axial system following  the
+definitions  used  in  Busing W.R. and Levy  H.A.,  Acta  Cryst.,
+(1967), 22, 457.  The facilities available provide the user  with
+a comprehensive set of basic functions for examining crystals, as
+well  as  more  powerful functions which make  extensive  use  of
+symmetry for orientation and intensity measurement.
+
+     The  second  aim  was originally achieved with  a  2  letter
+mnemonic  command structure and a simple windows type  of  screen
+presentation.   A  later  version  will  use  a  fully   windowed
+interface.
+
+     The  third  aim  is achieved by isolating any  modifications
+required  to  drive  different instruments  to  a  small  set  of
+subroutines  in F77, C or assembler, which actually  address  the
+interface.   In this way changes to drive different  instruments,
+e.g.  to  drive a Kappa geometry machine, need only  be  made  in
+these routines, while the bulk of the code remains constant.
+
+     The  program uses a single binary file to hold all  relevant
+crystal information and intensity data.  This is a direct  access
+file  usually called IDATA.DA.  If this file does not exist  when
+the  program  is  started it is created and  default  values  are
+assigned  to  all  parameters. If the file does  exist  when  the
+program  is  started, existing values from  the  file  are  used.
+During data collection each reflection is written to the file  as
+soon as it is measured so that in the case of a crash no data  is
+lost. If the need arises, the file is automatically lengthened to
+accomodate  more  data.  A routine is available for  reading  and
+translating  the binary IDATA.DA file into ASCII, or  it  can  be
+read directly by the NRCVAX package.
+
+     The emphasis has always been on giving the user a reasonably
+comprehensive,  but simple method to make the instrument  perform
+the  sorts  of  operations which facilitate initial  examination,
+alignment   and  intensity  measurement  for  randomly   oriented
+crystals.   Commands like CR, IM, LP allow the easy  manipulation
+of  a  reflection which is already in the detector.  Others  like
+AL,  IR,  IE, IP align or measure reflections from  a  list.   An
+important difference between this routine and some other  control
+routines  is  that  the  list is transparent  to  the  user.  The
+commands  set  up the list as well as performing  the  operation.
+There are no list manipulation commands as such, though the  list
+can  be  editted from within a command.  This makes  for  a  more
+comfortable and direct feel to running the program.
+     
+     A second distinction between DIFRAC and other such routines,
+is  the  extensive use of symmetry information.  The routine  can
+interpret  space  group  symbols, and use the  symmetry  matrices
+generated  to  measure  or  align  equivalent  reflections.   The
+routine  also  uses  symmetry to decide on  the  unique  part  of
+reciprocal  space  to  measure, which  means  that  no  redundant
+reflections  need be measured.  If further data  is  needed,  the
+routine   will   automatically  continue  to   measure   symmetry
+equivalent data sets until the whole sphere, within the q limits,
+is collected or until stopped by the user.
+
+     A further difference is the continuous display of reflection
+profiles.   This  is an invaluable help in deciding  whether  the
+crystal  is  suitable  for  analysis,  and  for  monitoring   the
+measurement process.  It is not usually realized how useful  this
+can  be  during intensity measurement, both as a security blanket
+and  as  a diagnostic.  It always allows a user 'to get a  better
+feel'  for the crystal under investigation and quite often  shows
+crystal or misalignment problems that the user would otherwise be
+unaware  of,  but  which with corrective action, will  ultimately
+improve the quality of the data.
+     
+     Adaptions for TRICS
+     
+     The DIFRAC system has been included into the SICS instrument
+control  software. This manual has been derived from the original
+DIFRAC  manual  by removing all redundant commands.   The  DIFRAC
+subsystem  in SICS is accessed by prepending each DIFRAC  command
+with the string dif. Please note, that SICS cannot be interrupted
+when  it  is waiting for command input for DIFRAC. Also at  least
+two  characters  of input are required in the SICS  command  line
+client in order to handle a platform dependency bug in Java.
+
+
+

+ +

Commands

+

+

+     The  following  is a concise list of the 2  letter  commands
+available  with a one line description of each.   This  is  meant
+only as a quick reference to the commands and a reference to  the
+manual page with the full description is given.  The program  has
+been  developed  over  many  years  and  the  whole  routine  has
+gradually  been  made more automatic.  As a result  some  of  the
+earlier commands are probably redundant.
+
+     The  commands  are  in  alphabetical order  in  groups  with
+roughly  related function.  A list in the rough order of  use  to
+setup  and measure a crystal is given after the alphabetic  list.
+If  no  command  or an invalid command is given  at  the  command
+prompt, various help menus are suggested.
+
+               Group A: Terminal Data Input Commands
+
+
+BD  all Basic Data (includes CZ DH FR LA OM OR PS RR SD SE TM TP)
+CZ   Correct angle Zero values    ...    ...    ...    ...    ...
+FR   First Reflection to be measured     ...    ...    ...    ...
+LA   LAmbda for the wavelength in use, usually a1      ...    ...
+OM   Orientation Matrix    ...    ...    ...    ...    ...    ...
+PS   PSi rotation data     ...    ...    ...    ...    ...    ...
+RO   Re Orientation reflections: frequency and h, k, ls       ...
+RR   Reference Reflections: frequency and h, k, ls     ...    ...
+SD   Scan  Data: measurement type, width, speed, profile  control
+SE   Systematic Extinctions       ...    ...    ...    ...    ...
+SG   Space Group symbol           ...    ...    ...    ...    ...
+TM   2q Min and max values        ...    ...    ...    ...    ...
+TP   Time and Precision parameters for intensity measurement  ...
+
+
+               Group B:  Crystal Alignment Commands
+
+AL  ALign reflections and their symmetry equivalents for MM   ...
+AR  Align Resumption after interruption  ...    ...    ...    ...
+A8  Align the 8 alternate settings of reflection for angle zeroes
+CH  CHoose reflections from the PK list for use with M2 or M3 ...
+CR  Centre the Reflection which is already in the detector    ...
+LC  2q Least squares Cell with symmetry constrained cell      ...
+MM  Matrix from Many reflections by least squares on AL data  ...
+M2  Matrix from 2 indexed reflections and a unit cell  ...    ...
+M3  Matrix from 3 indexed reflections    ...    ...    ...    ...
+OC  Orient a Crystal, i.e. index the peaks from PK     ...    ...
+PK  PeaK search in 2q, c, f for use with OC     ...    ...    ...
+RC  Reduce a unit Cell     ...    ...    ...    ...    ...    ...
+RP  Rotate f 360, centre and save any peaks found      ...    ...
+RS  ReSet the cell and matrix with the results from RC ...    ...
+
+
+               Group C:  Intensity Data Collection
+
+GO  Start of intensity data collection   ...    ...    ...    ...
+K   Kill operation at the end of the current reflection       ...
+Q   Quit after the next set of reference reflections   ...    ...
+LR  Last Reflection written to IDATA.DA  ...    ...    ...    ...
+
+
+               Group D:  Angle Setting and Intensity Measurement
+
+GS  Grid Search measurement in 2q, w or c              ...    ...
+IE  Intensity measurement for Equivalent reflections   ...    ...
+IM  Intensity Measurement of the reflection in the detector   ...
+IP  Intensity  measurement  in y steps for  empirical  absorption
+IR  Intensity measurement for specified Reflections    ...    ...
+LP  Line Profile plot on the printer     ...    ...    ...    ...
+SA  Set All angles to specified values   ...    ...    ...    ...
+SC  Set c to the specified value         ...    ...    ...    ...
+SO  Set w to the specified value         ...    ...    ...    ...
+SP  Set f to the specified value         ...    ...    ...    ...
+SR  Set Reflection: h,k,l,psi.    ...    ...    ...    ...    ...
+ST  Set 2q to the specified value        ...    ...    ...    ...
+TC  Timed Counts          ...     ...    ...    ...    ...    ...
+ZE  ZEro the instrument Angles    ...    ...    ...    ...    ...
+
+
+               Group E:  Photograph Setup Commands
+
+PL  Photograph in the Laue mode   ...    ...    ...    ...    ...
+PO  Photograph in the Oscillation mode (same as OS)    ...    ...
+PR  Photograph in the Rotation mode      ...    ...    ...    ...
+
+
+               Group F:  General System Commands
+
+AH  Angles to H,k,l (same as IX)  ...    ...    ...    ...    ...
+AI  Ascii Intensity data file conversion        ...    ...    ...
+AP  Ascii Profile data file conversion   ...    ...    ...    ...
+BC  Big c search for y rotation          ...    ...    ...    ...
+BI  Big Intensity search in the IDATA.DA file   ...    ...    ...
+HA  H,k,l to Angles (same as RA)  ...    ...    ...    ...    ...
+IN  INitialize integer parts of angles   ...    ...    ...    ...
+NR  set the NRc progam flag       ...    ...    ...    ...    ...
+P9 rotate f by 90ø          ...    ...    ...    ...    ...    F3
+PA  Print Angle settings          ...    ...    ...    ...    ...
+PD  Print Data of all forms       ...    ...    ...    ...    ...
+RB  Read the Basic data from the IDATA.DA file  ...    ...    ...
+SW  SWitch register flags setting        ...    ...    ...    ...
+UM  (UMpty) Count unique reflections within 2q limits  ...    ...
+VM  set the circles to the View Microscope position    ...    ...
+WB  Write the Basic data to the IDATA.DA file   ...    ...    ...
+
+

+

Suggested Sequence of Command Use

+

+

+     This  section  contains  a  list  of  operations  with   the
+applicable  commands  to setup, measure intensities  and  get  an
+accurate  cell  for an unknown crystal.  It is meant  only  as  a
+guide  to  first time users and should not be taken as  hard  and
+fast.
+
+                    Crystal Setup
+
+  1.  Mount the crystal and optically centre it on the instrument
+      with VM.
+  2.   Use PD to see what values have been assigned to the  basic 
+       parameters.
+       Change  the wavelength if necessary with LA and  2q  limits
+       with TM.
+ 3.  Find and centre 10 to 15 peaks with PK.
+ 4.  Index  the peaks with OC,  which will automatically progress
+     to RC and RS     if necessary.
+ 5.  Find  reflections with somewhat higher angles with  IR,  and
+     centre them with AL using Friedel equivalents.
+ 6.  Calculate a better matrix with MM.
+ 7.  Save the orientation matrix with WB.
+
+
+                    Data collection setup
+
+ 8.  Ensure that the scan data and time parameters are reasonable
+     and reset them if necessary with SD and TP.
+ 9.  Find medium strong reflections which are well distributed in
+     reciprocal   space  with  IR, to be  used  as  reference  or
+     standard reflections.  Enter them  with RR.
+10.  Adjust the scan data with SD after seeing the profiles  from
+     step 9 and set the detector slits.
+11.  Find  re  orientation reflections with IR.  Enter  them,  or
+     ensure that  re orientation is not done, with RO.
+12.  Enter the Laue group symbol with SG.  Use the lower symmetry
+     group if there is an ambiguity, e.g. 4/m and not 4/m m m.
+13.  Try  to pin down the Laue group and possibly the space group
+     as well with IE.  Enter the corrected group with SG.
+14.  Make adjustments to any of the basic parameters (PS, SD, TM,
+     TP etc) if necessary.
+15.  Issue  the  GO  command and answer the  questions  to  start
+     data collection.
+16.  Stop  the measurement with K or Q when sufficient data  have
+     been collected.
+
+
+                            Accurate cell setup
+
+17.  Search the unique data on the IDATA file with BI for the  25
+     strongest  reflections with 2q greater than a minimum.
+18.  Narrow  the  detector slits and enter about  50  reflections
+     (including symmetry  and Friedel equivalents) for AL,  which
+     will then centre them.
+19.  Maybe  use  A8 to get instrument zeroes and enter them  with
+     CZ. This procedure could also be used before step 6.
+20.  Get an accurate cell and esds with MM on AL results.
+21.  Possibly use LC on the 2q data alone.
+
+

+ +

Program File Usage

+

+

+     Normally the program uses 4 files which are called IDATA.DA,
+ORIENT.DA,  goniom.ini and LPT1.  IDATA.DA is the most  important
+and  ORIENT.DA  is  used only as a scratch  file  during  crystal
+orientation.   goniom.ini is the instrument initialization  file.
+LPT1  will  contain all output which is directed to  an  attached
+printer, if there is no printer present.
+
+     The  IDATA.DA  file  is  a binary direct  access  file  with
+records of 85 4 byte variables.  The contents of these records is
+as follows :
+
+ Records                        Contents
+  1  to  3   All the basic data for the machine and crystal. This
+is the data
+           which is written by WB and read by RB.
+ 4 to  8   Symmetry information generated by the SG command.
+   9           Information   for  an  automatic   restart   after
+data collection has been
+           interrupted.
+10         Space group symbol.
+11 to 15   Not used at present.
+16 to 19   List of h,k,ls for use with AL.
+20 to  N   Intensity data stored 10 reflections per record.
+
+     If the IDATA file does not exist when the program is started
+it  is created with a length of 700 records which will hold  6800
+reflections.   This should be adequate for most data collections,
+but the file will be extended by 100 records at a time as needed.
+As the file always exists before it is used there is no data loss
+in  the  event of a crash.  However, as the same file  is  always
+used  for  data collection it is necessary to copy or  rename  it
+before  another  collection  is started,  or  the  data  will  be
+overwritten.
+
+     When  the file is created the program assigns default values
+to all essential parameters in records 1, 2 and 3.  Defaults are
+
+Cell dimensions      10.0, 10.0, 10.0, 90.0, 90.0, 90.0
+Wavelength           0.70932 (MoKa1)
+2q min max           2.0, 100.0
+h,k,l max            22, 22, 22
+Angle zeroes         0.0, 0.0, 0.0      (2q, w, c)
+Orientation matrix   0.1    0.0    0.0
+                     0.0    0.1    0.0
+                     0.0    0.0    0.1
+                     This corresponds to the cell above with axes
+along the
+                     X, Y, Z instrument axes.
+Scan data            As 1.0,  Bs 0.7,  Cs 1.0
+                     for a scan width of  As + Bs*tan(q) + Cs,
+                      w/2q  scan  with  profile  analysis;  speed
+4.0/minute.
+Background time      0.1 of scan time
+Systematic absences  None
+Reference reflection 4, 0, 0 taken every 100 normal reflections
+Psi rotation         None
+Reorientation data   None
+Reflection sequence  As for +h, +k, +l orthorhombic data  with  l
+varying fastest
+                 and h slowest.
+
+     If  the IDATA file exists when the program is started,  then
+the  values on the file are used until changed.  The form of  the
+intensity  data  in  records 20 upwards is  shown  under  the  GO
+command.
+     
+     The  file ORIENT.DA is also a binary direct access file with
+records  of  85 4 byte variables.  This file holds the  data  and
+results  of all orientation operations, and need never  be  kept,
+though it is retained on exit from the program.
+
+     The  file goniom.ini contains data to initialize the program
+when  it is started.  The file is in plain ASCII form and heavily
+commented, so that it maybe modified for local use.  Most of  the
+values  in  the  file are for use with CAD-4  machines,  but  the
+DFMODL  flag and the VM microscope veiwing values are for general
+use.
+     The  program  creates 4 other files at the  request  of  the
+user.
+
+  1. Another binary direct access file with records of 32 4  byte
+     variables which is used to store the reflection profiles  if
+     wanted.   This file can become very lengthy, if all profiles
+     are  saved, even though the data is compressed,  and  it  is
+     normally not necessary to save this data as profile analysis
+     is  done on line as the data is being recorded.  The file is
+     produced  by setting switch 9 with the SW command.   It  has
+     the default name PROFL7.DAT.
+
+  2. The  profile data on PROFL7.DAT can be transformed to  ASCII
+     and  written  to  a  file with the default name  PROFL7.ASC,
+     using the AP command.
+
+  3. The  intensity data on IDATA.DA can be tranformed into ASCII
+     and written to a file with the default name IDATA.ASC, using
+     the AI command.
+
+  4. The  IP  command collects intensity data from psi  scans  of
+     360ø in 10ø steps, and writes it to the file CURVES.DAT, for
+     use with empirical absorption calculations.
+
+

+ +

Terminal Data Input Commands

+

+

+BD  all Basic Data (includes CZ FR LA OM PS RO RR SD SE TM TP)
+
+     This  command takes the user through all the terminal  input
+commands  necessary  to establish a minimum valid  set  of  basic
+data.  However,  all  parameters are  assigned  sensible  default
+values  if  a  new IDATA.DA file is created when the  program  is
+started,  or  current values are read from the existing  IDATA.DA
+file,  therefore it is not usually necessary to use this command,
+but rather alter specific parameters with individual commands.
+
+
+CZ  Correct angle Zero values
+
+     Zero corrections, from AL or A8, may be typed.  For the most
+accurate  work  it  is  advisable to derive corrections  for  the
+particular crystal, as they will vary with the optical  centering
+of the crystal.
+
+
+FR  First Reflection to be measured
+
+     The  h,k,l values of the first reflection to be measured can
+be typed in, followed by the set and segment numbers (see GO) for
+the  reflection and the number of the first record of  the  IDATA
+file  which  will  be  used. The GO command generates  the  first
+reflection  automatically at the start  of  data  collection  and
+after  an  interruption if an automatic restart is possible.   If
+measurement  conditions  have been  changed,  then  an  automatic
+restart  is  not  possible and the user  must  supply  the  first
+reflection  information  in  the  GO  command,  thus  it  is  not
+necessary to use the FR command.
+
+Example:
+ Command fr
+ First Reflection Data
+ Type h,k,l for the reflection 2,0,0
+ Type the Reflection and Segment numbers 1,1
+ Type the Data record number 20
+
+
+LA  LAmbda for the wavelength in use, usually Ka1
+
+     It  is  preferable  to  use the Ka1  wavelength  if  profile
+analysis  is being used.  If the mean Ka wavelength is  preferred
+it   is   advisable   to  set  the  dispersion   parameter   |la1
+la2|/mean(la)  (in  SD)  to  0 to prevent  the  profile  analysis
+routine  from  starting its background search too far  above  the
+peak on the high angle side and hence reaching wrong conclusions.
+
+Example:
+ Command la
+ Type the wavelength (0.70932)
+
+
+
+OM  Orientation Matrix
+
+    Prerequisites:   LA, TM
+
+     The  orientation matrix may be typed in, but  it  is  almost
+always derived by OC, M2, M3 or MM.
+
+
+PS  PSi rotation data
+
+     A  y  step,  minimum  y and maximum y are  typed  in.   This
+command  is given either to collect data for empirical absorption
+corrections,  or  in  order  to  investigate  possible   multiple
+reflections.   All  subsequent  intensity  measurements  will  be
+affected by this command, including those in GO, therefore it  is
+advisable  to  set the y step back to 0ø once the requirement  is
+complete  and  before  the GO command is  given.   For  empirical
+absorption  purposes this command has largely been superseded  by
+the  IP  command.   It is very useful for investigating  multiple
+reflection effects.
+
+Example:
+ Command ps
+ Psi Data: Dpsi,Psimin,Psimax 2,0,10
+
+
+RO  Re Orientation reflections: frequency, tolerance and h,k,ls
+
+     It is possible to set up a list of reflections which will be
+used  as  for AL, to derive a new orientation matrix periodically
+during  data  collection.  This new matrix  is  accepted  if  the
+average angular deviation between reflection vectors for the  old
+and new matrices is greater than a specified tolerance.
+
+     Input  consists of the frequency of re orientation, in terms
+of  the number of intervening reflections, as for RR, the angular
+tolerance, and a list of h,k,l values.  Each reflection typed  in
+and  its  Freidel  equivalent will be aligned and  the  user  can
+select  also  to use symmetry equivalents, as for AL.   This  can
+quickly generate a lengthy list and re orientation would then  be
+quite  a  lengthy procedure.  Because of this it is best  not  to
+enter more than about 12 well chosen reflections in total.
+
+     Reorientation can be disabled by giving the frequency as 0.
+Example:
+ Command  ro
+ Perform re orientation during data collection (N) ? y
+ Type the re orientation frequency (500)
+ Type the re orientation angular tolerance (0.1) 0.2
+ The following  13 reflections are in the AL/RO list
+  1.   0   1   2     2.   0   1   2     3.   1   2   3     4.   1
+2   3
+  5.   3   2   1     6.   1   2   3     7.   1   2   3     8.   1
+ 2   3
+  9.   1   2   3    10.   2   3   4    11.   2   3   4    12.   2
+ 3   4
+ 13.   2   3   4
+ The following options are available :
+  U. Use the existing AL/RO list;
+  A. Add reflections to the existing AL/RO list;
+  D. Delete reflections from the existing AL/RO list;
+  N. New AL/RO list.
+  L. List the reflections in the existing AL/RO list;
+  E. Exit
+ Which option do you want (U) ? n
+ Friedel equivalents are always used.
+ Do you want symmetry equivalents as well (Y) ? n
+ Type h,k,l for up to 100 reflections
+ h,k,l (End) 1,2,3
+ h,k,l (End) 4,3,2
+ h,k,l (End) 3,4,2
+ h,k,l (End) 4,5,1
+ h,k,l (End)
+ The following   4 reflections are in the AL/RO list
+  1.   1   2   3     2.   4   3   2     3.   3   4   2     4.   4
+5   1
+ The following options are available :
+  U. Use the existing AL/RO list;
+  A. Add reflections to the existing AL/RO list;
+  D. Delete reflections from the existing AL/RO list;
+  N. New AL/RO list.
+  L. List the reflections in the existing AL/RO list;
+  E. Exit
+ Which option do you want (U) ?
+
+
+RR  Reference Reflections:  frequency and h,k,ls
+
+     The  specified reference reflections (up to 6) are  measured
+after  every N reflections for intensity control purposes.  These
+reflections  should  not be too intense,  to  avoid  the  use  of
+attenuators, and should be well distributed in reciprical  space.
+No  attempt  is made to monitor these reflections  for  fall  off
+because it is felt that significant change probably requires user
+intervention.  Changes are just as likely to be caused by crystal
+translation,  which  cannot  be corrected  automatically,  as  by
+rotation.
+
+Example:
+ Command rr
+ Measure reference reflections during data collection (Y) ?
+ Type the measurement frequency (100)
+ Type up to 6 sets of h,k,l values.
+ h,k,l > 2
+ h,k,l > ,2
+ h,k,l > ,,2
+ h,k,l >
+
+SD  Scan Data: type, width, scan speed, profile control
+
+     Eight measurement types are available:
+  0. Constant speed w/2q b/P/b scan;
+  1. Constant speed w b/P/b scan;
+  2. w/2q b/P/b scan with precision control;
+  3. w b/P/b scan with precision control;
+  4. Peak top with 2q backgrounds;
+  5. Peak top with w backgrounds;
+  6. Peak top with 2q backgrounds and precision control;
+  7. Peak top with w backgrounds and precision control.
+
+     Constant  speed scans (types 0 and 1) are normal scans  plus
+extra  background  points, where the duration of  the  background
+measurements  is  always specified (in TP) as a fraction  of  the
+scan or peak time.  If profile analysis is to be done (types 0 to
+3)  this  fraction should be small, 0.1, meaning 0.1 of the  scan
+time is spent on background at each end of the scan. If it is not
+to be done, the fraction should be larger, say 0.25.
+
+     Precision control for types 2 and 3 is carried out using the
+algorithm  described  in Grant,D.F., Acta  Cryst.,  (1973),  A29,
+217).  Precision measurements require the input of  3  parameters
+(in TP) which are
+    (a)  a maximum time to be spent on a single reflection,
+    (b)  a "desired" precision, and
+    (c)  a "minimum acceptable" precision.
+The routine performs an initial scan and then decides whether the
+"desired" precision has already been reached.  If it has, it goes
+on  to  the next reflection.  If not, a decision is made  whether
+that precision can be reached within the maximum time and if  so,
+further  scans  are  done  to achieve  this.  If  this  "desired"
+precision  cannot  be achieved, the routine  decides  whether  at
+least  the  "minimum  acceptable" precision  can  be  reached  by
+measuring   for  the  full  maximum  time.  If  it  can   further
+measurements are taken, if not, no more measurements are taken.
+
+     While this controlled precision mode sounds attractive,  for
+many  organic crystals it can lead either to spending long  times
+measuring  weaker  reflections or having  many  weak  reflections
+poorly measured because the routine decides it cannot attain  the
+minimum  precision in the maximum time.  A better way to  improve
+precision  is  to  use  the  simpler scheme  of  measuring  every
+reflection  at  the same speed (types 0 or 1) and use  additional
+time to measure symmetry equivalents.  This minimizes both random
+(obscuration   and   collision)   and   systematic   (absorption,
+extinction, multiple reflection) errors.
+
+     Peak  top  measurement (types 4 and 5) is done by  measuring
+for  a  fixed  time  at the calculated peak top  position  and  a
+fraction of this time at each background position.
+
+     Peak top measurements with precision control (types 6 and 7)
+work  in  a  similar  manner to the scan methods  with  precision
+control.  Again 3 values are needed from TP,
+    (a)  maximum number of counts wanted,
+    (b)  sample count time in seconds,
+    (c)  maximum allowed time per reflection.
+The peak top is measured for the sample time and from that a time
+is  derived  which is either that required to reach  the  maximum
+count,  or  the maximum time allowed.  Counting is  repeated,  if
+necessary, to reach either objective.
+
+
+     Peak   top   measurements  are  rarely  used   because   the
+instability  of  the crystal mount makes it difficult  to  ensure
+that  reflections are exactly in the centre of the detector  over
+long  periods of time. Peak top measurements are bad practice  at
+TRICS  because  of the insecurity in determining  the  UB  matrix
+caused by the huge size of the peaks.
+
+    Scan widths are specified as 3 parameters in the equation
+            Width = As + Bs*tanq + Cs,         where
+      As  is the angular width from the beginning of the scan  to
+the a1 position,
+                                             360   |la1   la2|
+      Bs  is the dispersion from a1 to a2 as       .           --
+, and
+                                             2P      mean(la)
+      Cs is the angular width from the a2 position to the end  of
+the scan.
+
+Typical  values are 0.7, 0.7, 0.7 for MoKa and 1.0, 0.3, 1.0  for
+CuKa.
+
+     The  scan speed for types 0 to 3 is given in ø/min. and this
+speed is used for all measurements.
+
+     Profile control consists of
+  1. a flag indicating whether profile analysis is to be done for
+     types 0 to 3, where 0 means do it and 1 means don't, and
+  2. if  it  is  to  be  done, the fraction of As  below  the  a1
+     position, and of Cs above the a2, at which to start  profile
+     analysis.   This merely saves time by not trying to  analyse
+     areas of the peak which will obviously not be flat.
+
+     The  type  of  profile analysis used is  a  slope  detection
+algorithm  (Grant, D.F. and Gabe, E.J., J. Appl.  Cryst.  (1978),
+11, 114), which looks for sensibly flat parts of the profile as a
+statistical window is moved from the peak towards the ends of the
+profile.   Profile analysis can be performed as part of the  data
+collection process and it is suggested that this be used  as  the
+routine  mode of operation. Profile analysis improves the quality
+of intensity data in two ways.
+
+  1. The  precision  of background measurements  is  improved  by
+     including a greater fraction of the peak in the background.
+  2. The  precision of the net intensity is improved by  reducing
+     the amount of background under the narrowed peak.
+
+     Reflection  profiles are routinely displayed on the  screen,
+whether  or not profile analysis is requested, together with  the
+theoretical  a1  position.   When  analysis  is  requested,   the
+intensity weighted maximum position is shown and also the  points
+at which the routine decides to separate peak from background.
+
+     When  profile  analysis  is  requested,  the  routine  takes
+background  measurements at each end of  the  scan  for  a  small
+fraction of the scan time, usually 0.1, in order to decide if the
+peak is significant and therefore analysable.  If it is, analysis
+is  done and profile points outside the high and low scan  limits
+obtained  are  added  to  the  backgrounds  and  a  new   overall
+fractional background time established.  This means both improved
+background measurements and a reduced amount of background  under
+the  peak  because of reduced peak width.  Thus  either  a  given
+overall  precision can be achieved in a shorter time or  improved
+precision in a fixed time.
+
+     For  CAD  4 machines a flag can be set which will cause  the
+  ,  ,  reflection to be used if there is obscuration at high  2q
+and c values for the normal +,+,+ reflection.
+
+Example:
+ Command sd
+ Scan data : Scan type, As,Bs,Cs, Profile flag.
+
+ Scan type: 0 2Theta,             1 Omega,
+            2 2Theta precision,   3 Omega precision,
+            4 2Theta peak top,    5 Omega peak top,
+            6 2Theta econ. pktop, 7 Omega econ. pk top;
+ Type the scan type (0)
+ Reflection width in degs is  As + Bs*tan(theta) + Cs
+ Type the new As, Bs, Cs ( 0.500 0.000 0.500) .7,.3,.7
+ Profile flag   0/1  for DO/DONT DO profile analysis.
+ Type the flag (0)
+ Scan Step and Preset (4)
+ Try  , ,  refln if high angle scan problems (Y) ?
+ Fraction of A & C to step off for profile analysis (0.5)
+
+
+SE  Systematic Extinctions
+
+     This   command  originally  allowed  the  user  to   specify
+extinction conditions, but it has largely been superseded because
+the  SG command now detects absences automatically.  However,  it
+can  still be useful to setup non space group conditions  if  the
+need arises.  This is done by telling the routine which class  of
+reflections  the  condition applies to and  then  specifying  the
+coefficients A to E of the conditional equation
+                      Ah + Bk + Cl = Dn + E
+for  the reflection to be considered present.  Reflection classes
+are
+    1 00l    2 0k0    3 h00    4 0kl    5 h0l    6 hk0    7 hkl
+
+     Suppose  for  example in a superstructure  only  reflections
+with h = 3n are to be measured, then the condition would be
+
+         Class  A  B  C  D  E
+           7    1  0  0  3  0
+
+
+SG  Space Group symbol
+
+     Several  of the options of DIFRAC need symmetry information,
+e.g. IE, GO, AL.  The SG command interprets the standard form  of
+a  space group symbol to calculate symmetry matrices in order  to
+be  able to generate equivalent reflections.  The symbol is typed
+with blanks separating distinct operators, e.g. P 21/c  or  P  21
+21 21  or  P 63/m c m.
+
+     Apart  from  generating  equivalent  indices,  the  symmetry
+information  allows  subsequent  routines  to  detect  systematic
+absences  and Friedel reflections.  It also allows the segment(s)
+of  reciprocal  space which form the unique set to  be  generated
+(see  the  description  of  DH  sets  under  GO)  and  if  wanted
+equivalent  unique  sets.  For data collection  all  the  routine
+really  needs is the Laue group symbol, but it cannot then detect
+translational systematic absences. Currently there is a limit  of
+24 symmetry operations. Beware of high symmetry space groups!
+
+
+Example:
+ Command sg
+ Type the space group symbol (P  1) f d d 2
+ Space Group F D D 2
+   The  Space  Group  is ACentric F Centered  Orthorhombic   Laue
+Symmetry mmm
+  Multiplicity of a General Site is  16
+  The location of the origin is arbitrary in z
+
+ Space group Equivalent Reflections are:
+        h     k     l          h     k     l
+        h     k     l          h     k     l
+ Friedel Reflections are the  , ,  of these.
+
+
+TM  2q Minimum and maximum values
+
+     Because  of the use of DH matrices, which minimize the  time
+needed  to collect a unique set, it is not normally necessary  to
+collect data in 2q shells.  Thus it is usual to input one pair of
+values,  say  2ø to 50ø, for MoKa, to control the range  of  data
+collection.  If at the end of this, it is felt that it  would  be
+useful  to  collect more data, further shells can  be  collected.
+The defaults indicated are the current values.
+
+Example:
+ Command tm
+ Type 2Thetamin and 2Thetamax ( 2.00, 80.00)
+
+
+TP  Time and Precision parameters for intensity measurement
+
+Prerequisite:   SD
+
+     The  value for the background fraction is requested for  all
+measurement types except peak top with precision (types 6  &  7).
+This  fraction  is  the  ratio of the  time  for  one  background
+measurement to the time for the peak measurement.
+
+     If the scan type is w/2q or w (types 0 and 1) only the value
+for  the background fraction is requested.  Suggested values  are
+0.1 with profile analysis, 0.25 with no profile analysis.
+
+     If  controlled precision measurement is being used (types  2
+and 3), 3 further parameters are requested as explained under SD.
+Care  should  be taken to give reasonable values  so  that  large
+amounts  of  time  are  not spent measuring  for  little  return.
+Suggested  values  are  240  secs  maximum  time,  0.01   desired
+precision   i.e.  1%,  and  0.10,  i.e.  10%  minimum  acceptable
+precision.
+
+     If  peak top measurements are selected (types 4 and  5)  one
+further  value is needed for the peak counting time.  A  suitable
+value is 5 secs.
+
+     If  peak top measurements with precision are selected (types
+6  and  7)  3 values are needed as explained under SD.   Sensible
+values  are  10000 maximum count, 1.0 second sample time  and  10
+seconds maximum time.
+
+Example:
+ Command tp
+ Time and Precision Parameters
+ Type the Background fraction (0.1)
+
+

+

Crystal Alignment Commands

+

+

+AL  ALign reflections and symmetry equivalents for MM
+
+Prerequisites:   LA, Valid matrix
+
+     Values of h,k,l are typed and equivalent reflections can  be
+generated if wished. These and their Friedel equivalents will  be
+centred  (see  CR) and the results stored on file for  subsequent
+use with MM.
+
+     This  command  is meant primarily to provide  the  data  for
+accurate  cell  parameters at the end of a data  collection  run,
+using suitable reflections found with the BI command.  Up to  200
+equivalent    reflections,   counting   Friedel   and    symmetry
+equivalents,  may  be stored in the h,k,l  lists.   It  is  often
+useful  to  align  the  +  and    Friedel  equivalents  only,  to
+establish   an   improved  orientation  matrix  prior   to   data
+collection.  In this case choose not to use symmetry equivalents.
+It  is  also possible to use 4 geometrically equivalent  settings
+for  each  reflection in order to eliminate the  2q  and  c  zero
+errors.  If AL is interrupted with K, the process stops when  the
+current reflection centreing is finished.  It can be resumed with
+AR.
+
+Example:
+ Command al
+             Alignment   of   Symmetry  and  Friedel   Equivalent
+Reflections
+
+ The following   5 reflections are in the AL/RO list
+  1.  10   0   0     2.   0  10   0     3.   0  16   0     4.  16
+0   0
+  5.   0   0  16
+ The following options are available :
+  U. Use the existing AL/RO list;
+  A. Add reflections to the existing AL/RO list;
+  D. Delete reflections from the existing AL/RO list;
+  N. New AL/RO list.
+  L. List the reflections in the existing AL/RO list;
+  E. Exit
+ Which option do you want (U) ? n
+ Friedel equivalents are always used.
+ Do you want symmetry equivalents as well (Y) ?
+ Align 4 equivalent settings for each reflection (N) ?
+ Type the space group symbol (P 4/M)
+ Type h,k,l for up to 100 reflections
+ h,k,l (End) 1,2,3
+         1   2   3        2   1   3        1   2   3        2   1
+3
+ h,k,l (End) 3,2,1
+         3   2   1        2   3   1        3   2   1        2   3
+1
+ h,k,l (End)
+ The following   8 reflections are in the AL/RO list
+  1.   1   2   3     2.   2   1   3     3.   1   2   3     4.   2
+1   3
+  5.   3   2   1     6.   2   3   1     7.   3   2   1     8.   2
+3   1
+ The following options are available :
+  U. Use the existing AL/RO list;
+  A. Add reflections to the existing AL/RO list;
+  D. Delete reflections from the existing AL/RO list;
+  N. New AL/RO list.
+  L. List the reflections in the existing AL/RO list;
+  E. Exit
+ Which option do you want (U) ?
+
+     At  this point the results of the reflection alignment  will
+be output to the printer.
+
+Starting Values   1   2   3    15.251    0.000   53.30    63.435
+Final    Values                15.263  359.983   53.256   63.435
+Starting Values   1   2   3    15.251    0.000  306.699  243.435
+Final    Values                15.240  359.979  306.719  243.435
+         ................................................
+         ................................................
+Starting Values   2   3   1    15.251    0.000  344.499  303.690
+Final    Values                15.236    0.019  344.534  303.690
+
+
+AR  Align Resumption after interruption
+
+Prerequisite:   AL
+
+     As  the  AL  command  can be rather time  consuming,  it  is
+sometimes necessary to interrupt it and resume later.  AR  allows
+this  to be done and the alignment process resumes exactly  where
+it was interrupted with K.
+
+
+A8   Align  the 8 equivalent settings of 1 reflection  for  angle
+zeroes
+
+     On  a 4 circle instrument any reflection can in principle be
+set at the 8 positions
+
+      1.  +2q   w      c      f       2.  +2q   w      c  180+f
+      3.  +2q   w  180 c  180+f       4.  +2q   w  180+c      f
+      5.   2q   w      c      f       6.   2q   w     -c  180+f
+      7.   2q   w  180 c  180+f       8.   2q   w  180+c      f
+
+     Once  the 8 settings have been centred, instrumental  zeroes
+for  2q,  w and c are calculated, as well as crystal and detector
+height  adjustments.  It  is best to  use  results  from  several
+reflections and take the average values.
+
+     In  practice  the  best  c value to choose  is  near  n*45ø.
+However, on kappa geometry goniometers only  reflections  with  c
+in  the range 80ø to 100ø. are accessible and these can be  found
+with  the BC command.  On CAD 4 machines the instrument alignment
+corrections  DET,  HOR, VER and MON (see the CAD  4  manual)  are
+calculated and printed.
+
+Example:
+ Command a8
+ 8 Reflection Centring (Y) ?
+   (The next 3 lines are for non CAD 4 machines only)
+ Type the  2T,Om,Ch step size in 1/100th ( 4, 2,10)
+ Type the count time per step in seconds (1.0)
+ Type the max count cutoff fraction (0.5)
+ Type h,k,l for reflections to be used (End)
+ Next h,k,l (End) 2 0 0
+ Next h,k,l (End)
+ Is everything OK (Y) ?
+
+   The  following  type of output appears on the screen  and  the
+printer
+
+Starting  values     1    1   12     24.582    357.229     97.466
+359.819
+     Final   values                  24.597    357.095     97.412
+359.819    564
+Starting  values     1    1   12    335.418    357.229     97.466
+359.819
+     Final   values                 335.409    357.105     97.360
+359.819    575
+Starting  values     1    1   12     24.582      2.771     82.534
+179.819
+     Final   values                  24.595      2.688     82.421
+179.819    537
+Starting  values     1    1   12    335.418      2.771     82.534
+179.819
+     Final   values                 335.386      2.690     82.357
+179.819    502
+Starting  values     1    1   12     24.582    352.525    272.747
+90.179
+     Final   values                  24.571    352.420    272.647
+90.179    521
+Starting  values     1    1   12    335.418    352.525    272.747
+90.179
+     Final   values                 335.370    352.429    272.573
+90.179    548
+Starting  values     1    1   12     24.582      7.475    267.253
+269.821
+     Final   values                  24.578      7.336    267.085
+269.821    733
+Starting  values     1    1   12    335.418      7.475    267.253
+269.821
+     Final   values                 335.373      7.360    267.167
+269.821    721
+Zero Values of TT,OM,CH     .015    .109    .122
+Offsets: Det   .029mm, Hor   .021mm, Ver   .059mm, Mon   .016deg.
+True 2Theta     Omega     Chi       Phi
+     24.600     2.768    97.480      .000
+
+CH  CHoose reflections from the PK list for use with M2 or M3
+
+     Reflections may be selected from the list produced by PK, if
+their  indices  are known, for use with M2 or  M3  to  derive  an
+orientation matrix.
+
+Example:
+ Command ch
+ Choose reflections from OC for M2 or M3 (Y) ?
+ Sequence number in OC and indices
+ Reflection  1  1 0 0  3
+ Reflection  2  2 0 4  0
+ Reflection  3  4 5 1  1
+
+
+CR  Centre the Reflection which is already in the detector
+
+     The reflection which is presently in the detector is centred
+in  the  aperture.  It does not have to be an indexed  reflection
+and so CR can be used at any time.
+
+     The  centring  algorithm for Euler instruments searches  for
+half  height on both sides of the peak as the circles are stepped
+consecutively, retaining the counts for each step.  Once the half
+heights  on  both sides are found, the centre of the distribution
+of  counts is found as the "best" position.  Circles are adjusted
+in  the  order w, 2q, c, w, 2q.  For precise work it is advisable
+to  restrict  the  detector aperture with narrow  horizontal  and
+vertical   slits.  For  initial  setup  normal   apertures   from
+collimators are usually sufficient. The step size for each circle
+can be set, with defaults of 4/100ø, 2/100ø and 10/100ø for 2q, w
+and  c,  f  is held constant. Recommended setting for  TRICS  are
+4,4,40 for the steps. The fraction to use as "half height" can be
+input, as can the count time/step.  Defaults are 0.5 and 1 sec.
+
+     If  the  peak  was  sensibly in the centre of  the  detector
+aperture at the start of the centreing process, then usually only
+a   few  steps  are  needed  in  each  direction  to  find   both
+half  heights and hence the centre.  If the peak is displaced  so
+that  it  lies  within 50 steps above or below  the  centre,  the
+routine  detects this and finds the centre from one side  of  the
+stepping process.  If the peak is at one of the extreme  ends  of
+the +/ 50 step process, the routine adjusts the assumed centre to
+the  appropriate end and repeats the process.  If no  significant
+peak is found within +/ 50 steps, an error message is printed.
+
+     For kappa instruments centring is achieved with a continuous
+2q  scan  followed  by  scans with 45ø slits.   Again  there  are
+safeguards  to  ensure  that badly displaced  peaks  are  brought
+nearer to their "best" position, with a series of step scans  and
+then the normal centring process is repeated.
+
+     These  algorithms are used for all centring  operations  (AL
+and A8).
+
+Example:
+ Command cr
+           Centre the reflection already in the detector
+ Is the reflection already set (Y) ?
+ Type h,k,l for use in M2/M3  1 2 3
+
+Starting Values    1    2    3   15.251    0.00   53.301   63.435
+Final    Values                  15.243   0.008   53.256   63.435
+
+
+LC  2q Least squares with symmetry Constrained cell
+
+     The  unit  cell derived from the matrix produced  by  MM  is
+necessarily triclinic, though hopefully it should agree with  any
+known  symmetry, within the standard deviations.  LC is a command
+to  use  only  the  2q values from the AL list  and  a  specified
+crystal symmetry to produce the optimal unit cell consistent with
+the  data  and  the  imposed symmetry.  (Note  the  non  standard
+space group setting used below is accepted).
+
+Example:-
+ Command lc
+
+          Constrained Cell Dimension Least Squares
+
+ Type the space group symbol (P 4/m) P 2/m 1 1
+
+Wavelength        .709320;          38 reflections.
+                     Cell             Errors
+       a            9.566021         .0002590
+       b            9.930408         .0033505
+       c            6.582347         .0003861
+       Alpha      100.260            .0148
+       Beta        90.000            .0000
+       Gamma       90.000            .0000
+
+
+MM    Matrix from Many reflections by least squares on AL data
+
+     With  a  minimum of 4 reflections, preferably more, a matrix
+can  be  calculated  with least squares,  and  a  unit  cell  and
+standard  deviations derived.  The input data  is  usually  taken
+from  the  list produced by AL, which can be edited and/or  added
+to,  before  use. The data can also be typed in, though  this  is
+very  tedious. Zero corrections are derived for w and  c.   These
+should  be  close to zero if the values used in CZ are  accurate.
+If they are  not then zeroes should be checked with A8, corrected
+with CZ and MM run again.
+
+Example:
+ Command mm
+       Least Squares Orientation Matrix (Y) ?
+ Reflection data can be on file or from the terminal.
+ Wavelength (0.70932)
+ Read the data from the terminal (N) ?
+ Reflections may be deleted or restored to the list by typing :
+ h,k,l,1 for Delete  or  h,k,l,0 for Restore. CR = End.
+ >
+ Do you wish to insert reflections (N) ?
+
+Omega(0)is   .008   from  19 reflections.
+Chi(0)   is  .014   from   0 +/  pairs.
+Select a number for the cell geometry to be used
+Triclinic     1     Monoclinic   2
+Orthorhombic  3     Tetragonal   4
+Hexagonal     5     Rhombohedral 6    Cubic  7
+Type your selection (2)
+
+The following output appears on the printer
+
+       Orientation   Matrix from   19 Reflections
+      0.00050366    0.06722744    0.13259950
+      0.10452530    0.00104539    0.00204850
+      0.00185812    0.07713195    0.07905444
+
+                      Observed                         Calculated
+Angular
+   h    k    l  2Theta Omega   Chi    Phi     2Theta Omega    Chi
+Ph    Deviation
+   0    3    0   12.50   .00  48.92 180.89     12.50   .00 311.08
+180.89    0.012
+   4    0    0   17.06   .00   1.02  89.72     17.06   .00 358.98
+89.72    0.034
+
+........................................................
+
+........................................................
+   1    2    2  14.44   .00  62.44  36.85     14.44   .00   97.56
+36.85    0.027
+   1    2    6   38.02   .00  43.35   7.76     38.02   .00 316.65
+7.76    0.036
+
+                         Real Cell
+      a         b        c      alpha     beta    gamma
+   9.56544   9.93189  6.58240  100.263   89.999   89.999
+    .00038    .00129   .00024     .007     .003     .007
+
+                      Reciprocal Cell
+      a*        b*       c*     alpha*    beta*   gamma*
+   .104543   .102323  .154390   79.737   90.002   90.001
+   .000004   .000013  .000004     .007     .003     .007
+
+
+M2  Matrix from 2 indexed reflections and a unit cell
+
+     If  the unit cell is known, then the crystal orientation and
+hence the matrix can be calculated from the angular settings of 2
+indexed  reflections.  This can be useful if details of the  unit
+cell  and some reflections are known from PK or any other source.
+The reflection data can be typed in as h,k,l, w, c, f or selected
+from the PK list with CH.
+
+Example:
+ Command m2
+ Orientation Matrix from Cell + 2 Reflections (Y)
+ Type the wavelength ( .70932)
+ Type a,b,c,alpha,beta,gamma 9.5654 9.9319 6.5824 100.26 90 90
+ Are angles to be typed (Y) ? n
+ The two reflections being used are
+    0   3   0   .000   48.923  180.892
+    4   0   0   .000    1.019   89.725
+ Do you wish to edit the reflection indices (Y) ? n
+ Select a number for the cell geometry to be used
+ Triclinic     1    Monoclinic   2
+ Orthorhombic  3    Tetragonal   4
+ Hexagonal     5    Rhombohedral 6    Cubic  7
+ Type your selection (2) 2
+
+The following output appears on the printer
+
+      Orientation Matrix from M2
+   0.00050312  0.06722458    0.13259660
+   0.10452580  0.00104658    0.00204272
+   0.00185683  0.07713310    0.07905647
+
+
+M3    Matrix from 3 indexed reflections
+
+     As for M2, a matrix can be calculated from the known indices
+and setting angles for 3 reflections.  The reflection data can be
+typed in as h,k,l, 2q, w, c, f or selected from the PK list  with
+CH.
+
+Example:
+ Command m3
+ Orientation Matrix from 3 Reflections (Y) ?
+ Type the Wavelength (0.70932)
+ Are the angles to be typed (N) ?
+ The three reflections being used are
+   0   3   0  12.501   0.000   48.923  180.892
+   4   0   0  17.057   0.000    1.019   89.725
+   1   1   5  31.594   0.001   38.164    8.890
+
+The following output appears on the printer
+
+       RIGHT handed Orientation Matrix from M3
+    0.00050082  0.06722900     0.13259690
+    0.10451990  0.00104665     0.00204341
+    0.00185934  0.07713817     0.07906044
+
+a*  .10454    b*  .10233  c* .15439  Alf*  79.741   Bet*   90.001
+Gam*  90.002
+a 9.56593   b 9.93121  c 6.58228  Alf  100.259  Bet   90.000  Gam
+89.998
+
+OC  Orient a Crystal i.e. index the peaks from PK
+
+     This  command uses a modified version of Jacobsen's indexing
+routine (Ames Lab. Report, IS 3469,1974) to find a cell which  is
+consistent with all the reciprocal lattice vectors found  by  PK.
+The  algorithm  searches for the triple of minimum  non  coplanar
+vectors which will give essentially integer h,k,l values  to  all
+the  input  vectors. The algorithm is extremely robust  and  will
+always  produce  a  cell and orientation matrix  with  reasonable
+data.   In  case  of difficulty the list from PK may  be  edited,
+usually  to  remove  weak  reflections  which  maybe  arise  from
+satellite  crystals, or other known peaks can be  added.   It  is
+also  possible to read in sets of 2q, w, c, f from a file  called
+REFL.DAT.
+
+     As  with  all other indexing algorithms, the routine  cannot
+overcome deficiencies in the data.  For example, if the data only
+contains  reflections with h = 2n, then the  cell  produced  will
+have a dimension a/2.
+
+     The  cell produced is of course not necessarily the  reduced
+cell,  though  it  often  is, and the routine  can  automatically
+invoke  the  reduction algorithm (RC) and then reset the  crystal
+(RS)  if necessary.  Once this is done, the routine automatically
+invokes  the  MM least squares procedure to produce an  optimized
+orientation  matrix and unit cell from the PK list  with  reduced
+cell indexing.
+
+Example:
+ Command oc
+ Index Reflections and derive an Orientation Matrix
+ 1) Index reflections in the list from PK
+ 2) List and edit the reflections
+ 3) Cancel
+
+ Enter option (1) 2
+ There are   39 peaks in the list
+ (L) List the reflections;
+ (D) Delete a reflection;
+ (R) Reinsert a reflection;
+ (A) Add a reflection;
+ (F) Read reflections from a file;
+ (E) Exit.
+ Command (L,D,R,A,F,E) f
+ Type the reflection file name (REFL.DAT)
+ Subtract theta from the omega value (N) ?
+  44 reflections have been read from REFL.DAT
+ Command (L,D,R,A,F,E) e
+ Do you want to index the reflections (Y) ?
+ Error Limit = 0.10
+
+ Cell Dimensions:
+ a   6.916,  b   6.920,  c   6.901
+ alpha 119.98,  beta 119.63,  gamma  60.10.   Volume =   234.37
+
+
+   h   k   l       h   k   l       h   k   l       h   k   l
+   1   1   0       1   1   0       0   1   2       0   1   2
+   2   2   1       2   2   1       1   1   1       1   1   1
+   1   2   0       1   2   0       1   0   2       2   0   0
+   1   1   1       1   1   1       2   0   1       2   0   1
+   1   1   1       1   1   1       0   0   2       2   2   0
+   2   2   0       0   3   1       2   1   1       2   1   1
+   1   1   2       3   1   0       3   1   0       1   2   1
+   2   0   3       2   0   3       3   0   0       3   2   0
+   3   2   0       2   1   2       2   1   2       3   1   3
+   1   2   2       2   2   0       1   2   3       0   1   4
+   4   4   2       4   4   2       2   4   0       2   2   2
+
+ Orientation Matrix:
+  0.044395  0.123749  0.155932
+  0.167463  0.074546  0.002795
+  0.033644  0.102249  0.083725
+
+      Cell Reduction Step
+
+Type the Allowable Tolerance on True Cell Angles (0.1deg)
+Lattice Type (P) ?
+
+Input  Cell:    6.916      6.920      6.901    119.977    119.632
+60.102
+            Lattice Type P
+
+ The Shortest Non coplanar Translations
+                6.901      6.913      6.916     90.309    119.632
+119.875
+ The Old to New Cell Matrix
+             0.0   0.0   1.0
+             0.0   1.0   1.0
+             1.0   0.0   0.0
+
+               Possible 2 fold Axes:
+              Rows                    Products         Kind
+       Direct      Reciprocal       Dot    Vector    of Axis
+     1   1   0     1   1   1         2     0.145         2
+     1   0   1     1   1   1         2     0.180         2
+     0   1   1     0   1   1         2     0.223         4
+     0   1   1     1   1   1         2     0.231         4
+     0   1   0     1   2   0         2     0.309         2
+     2   1   1     1   0   0         2     0.319         4
+     1   0   0     2   1   1         2     0.345         2
+     1   1   1     0   1   1         2     0.360         2
+     0   0   1     1   0   2         2     0.444         2
+     2   1   3     0   0   1         3     0.117         3
+     2   1   1     1   1   0         3     0.155         3
+     2   1   1     1   0   1         3     0.086         3
+     2   3   1     0   1   0         3     0.060         3
+
+  # 1          Pseudo        Cubic F    Max Delta     0.444
+  a      1.0  1.0  1.0    9.8055  Alpha     90.025  a*      0.000
+ 0.500   0.500
+  b      1.0  1.0  1.0    9.8044  Beta      89.770  b*      0.500
+ 0.500   0.000
+  c      1.0  1.0  1.0    9.7516  Gamma     90.222  c*      0.500
+0.000   0.500
+  # 2          Pseudo    Hexagonal R    Max Delta     0.345
+  a      0.0  1.0  0.0    6.9197  Alpha     90.249  a*      0.667
+ 1.000   1.000
+  b      0.0  1.0  1.0    6.9126  Beta      90.088  b*      0.333
+0.000   1.000
+  c      3.0  1.0  1.0   16.9989  Gamma    120.148  c*      0.333
+0.000   0.000
+  # 3          Pseudo   Tetragonal I    Max Delta     0.319
+       ..........................................................
+       ..........................................................
+  # 7      Metrically    Triclinic P    Max Delta     0.000
+  a      0.0  0.0  1.0    6.9007  Alpha     90.309  a*      0.000
+ 1.000   1.000
+  b      0.0  1.0  1.0    6.9126  Beta     119.632  b*      0.000
+ 1.000   0.000
+  c      1.0  0.0  0.0    6.9157  Gamma    119.875  c*      1.000
+0.000   0.000
+
+     These  transformations are also output to  the  printer  for
+checking before answering the following question,
+
+ Which transformation do you wish to use (1) ? 2
+
+     The data is then submitted to least squares with output sent
+to the printer as described under MM.  The question
+
+ Do you want to replace the old matrix with this new matrix (N) ?
+y
+
+allows the user to :
+
+a. retain the existing matrix, in which case no further action is
+taken, or
+b.  accept the new matrix, in which case the following appears on
+the terminal
+
+ Space group choices are as follows :
+ 1. The safest space group based on cell reduction R  3
+ 2. The safest space group based on cell lengths   P  1
+ 3. Any other space group.
+ Which do you want (1)
+
+PK  PeaK search in 2q, c, f  for use with OC
+
+     This  is  the normal and simplest way to orient  an  unknown
+crystal.  Ranges of 2q and c are given, together with step sizes,
+and  the diffractometer then rotates f through 180ø at each  step
+as  it  searches through the c and 2q ranges, until the specified
+number of peaks have been found and centred, or the search  range
+is  exhausted.  The reason for searching only 180ø  in  f  is  an
+attempt  to  maximize the c range for crystals  with  large  unit
+cells,  when  many reflections may be found quickly in  a  narrow
+range.  No reflections will be missed, but if the c range extends
+equally  in both directions about zero with 360ø scans, both  the
++h,+k,+l and  h, k, l equivalents would be found.
+
+     This  command,  with all the accompanying centring,  can  be
+quite  lengthy and it is therefore best not to ask for  too  many
+peaks.  The PK command goes directly into an OC procedure and  10
+  15 peaks are usually sufficient for unambiguous operation.  The
+command  can  be  interrupted with K and, if  necessary,  resumed
+again with PK, indicating that it is not a new search.
+
+At TRICS it is recommended to use at least 15 degrees as step for
+chi as peaks can be 10-15 degrees wide in chi at TRICS.
+
+Example:
+ Command pk
+
+  Routine to Search for Reflection Positions
+
+ Is this a new search (Y) ?
+ 2 theta search: min, max, step (10,30,4) 15,31,4
+ Chi search (allowed range  90 to +90)
+ min, max, step ( 50,50,10)
+ How many peaks do you want to find (20) ?
+ Is everything OK (Y) ?
+
+   The  following  output  of  coarse positions  appears  on  the
+terminal and printer
+
+            2Theta      Omega        Chi        Phi       INT
+       1     15.00        .00      320.00      73.00      779.
+       2     15.00        .00         .00      85.00      310.
+           ...........................................
+           ...........................................
+      18     31.00        .00       40.00      35.00      165
+      19     31.00        .00       40.00       5.00       42
+
+  19 new peaks were found before the end of the search
+
+     The  routine  then  centres these peaks accurately  and  the
+following  output appears on the printer only.  The fifth  number
+on the Final Values line is the intensity for a 1 second count at
+the  peak  position   These values including  the  intensity  are
+stored for submission to MM or LC.
+
+Peak   1 Coarse Setting     14.999      .002   320.001    73.000
+         Approximate        14.818      .092   320.549    72.920
+          Final Values       14.816      .085   320.571    72.920
+7829
+
+............................................................
+
+............................................................
+Peak  19 Coarse Setting     30.999      .001    40.001     5.000
+         Approximate        30.750      .126    40.683     3.860
+          Final Values       30.730      .164    40.735   356.140
+353
+
+
+RC  Reduce a unit Cell
+
+     Cells from LC, M3, MM, OM or OC, can be reduced [Le Page Y.,
+J. Appl.Cryst. (1982), 12, 255] using an algorithm to find 2 fold
+axes.   It  does this by imposing artificial 2 fold axes  on  the
+reciprocal lattice, in all non redundant directions with  indices
+less  than  3.   If  the new lattice points  generated  by  these
+imposed 2 fold axes coincide, within a tolerance, with points  on
+the  original lattice, then the direction is at least a  possible
+metric  2 fold axis.  The results of this process, i.e. a set  of
+possible 2 fold axes, are analysed, both in terms of the original
+symmetry and in terms of possible distributions of 2 fold axes in
+all  allowable symmetries. Any additional symmetry is  noted  and
+the necessary transforms printed.
+
+     This  is  an extremely robust algorithm and has never  (yet)
+been  known  to  fail.   If  the  input  cell  is  in  some   way
+non  primitive the routine cannot, of course, account  for  this,
+e.g.  an  axis was given at half its true length.  If the routine
+detects several possible unit cells with increasing symmetry, the
+user  is  allowed  to  choose one to reset the  cell  and  matrix
+correspondingly and re index the reflections in the list.
+
+Example:
+ Command rc
+ Type the Allowable Tolerance on True Cell Angles (0.1deg)
+ Lattice Type (P) ?
+
+     The  screen  and printer output are identical  to  the  cell
+reduction stage of the OC command
+
+
+RP  Rotate f 360, centre and save any peaks found
+
+     This  command, which is really the basis of the  PK  search,
+rotates f 360ø in 1.8ø steps and then detects the peaks found, if
+any.   It  then  does a coarse centring of each, as  the  initial
+value of f can be very imprecise, followed by a fine centreing as
+in CR.  This command has been largely superseded by PK.
+
+
+RS   ReSet  the cell and matrix with the results from RC (similar
+to TO)
+
+Prerequisite:   RC
+
+     The  cell and matrix can be reset manually using the results
+from  RC, but a simpler and safer way to do this is to rerun  OC,
+automatically run RC and choose the correct transformation.
+
+Example:
+ Command rs
+ Reindex 3 Reflections (Y) ?
+ Reflection  1. Type OLD indices then NEW indices 0 0  1 1 0 0
+   0   0   1   6.28   .00   30.80  179.12     New indices  1    0
+0
+ Reflection  2. Type OLD indices then NEW indices 1 0 0 0 1 0
+   1   0   0   4.25   .00  358.98   89.72     New indices  0    1
+0
+ Reflection  3. Type OLD indices then NEW indices 0  1 0 0 0 1
+   0   1   0   4.16   .00  311.08  180.89     New indices  0    0
+1
+ Type the Wavelength ( .70932)
+
+The new matrix and cell are output to the printer.
+
+

+

Intensity Data Collection Commands

+

+

+GO  Start of intensity data collection
+
+    Pre requisites:  CZ LA RO PS RR SD (SG) SW TM TP
+                     Orientation matrix from MM(AL) M2 M3 or OC
+
+     This  command  starts,  or resumes,  data  collection  using
+parameters given under the pre requisite commands to control  the
+measurement  conditions. If the space group has  not  been  given
+under  SG,  it is asked for. The user is queried about  measuring
+any   translation  element absences from screws and  glides,  and
+lattice  mode absences, if any.  It is probably good practice  to
+measure the former for later checking, but not the latter.
+
+     If  data  collection is being resumed after an interruption,
+the  routine  checks  to  see whether  an  automatic  restart  is
+possible,  i.e. no parameters have been changed.  If so  it  then
+asks whether the user wishes to restart automatically.
+
+                         DH Matrices
+
+     The   sequence   in  which  reflections  are  generated   is
+controlled  by  a set of so called DH matrices.   These  are  3x3
+matrices  which  describe  segments  of  reciprocal  space  which
+comprise the unique data set.  They are described in Le Page Y. &
+Gabe E.J., J. Appl. Cryst. (1979), 12, 464.
+
+     The basic idea is that the segment or segments of reciprocal
+space  which  form the unique set are described by  3x3  matrices
+which  specify  the segment edges, plus a vector to  specify  the
+segment origin.  Thus, the matrix 1,0,0 / 0,1,0 / 0,0,1 describes
+the  segment with edges a*, b* and c*.  These matrix  and  vector
+pairs  can  be transformed by the symmetry matrices  to  generate
+equivalent  segments for further data sets.   There  are  several
+advantages to this approach.
+
+     Firstly, reflections can be generated within any segment  by
+simple  unit  increments  on a three dimensional  grid  and  then
+transformed  to  the  true  indices  with  the  DH  matrix.   The
+monoclinic system provides a good illustration.  Two matrices and
+origin vectors are needed to describe the complete unique set
+
+        1, 0, 0 / 0, 1, 0 / 0, 0, 1      0, 0, 0  (for +h,+k,+l)
+        1, 0, 0 / 0, 1, 0 / 0, 0, 1      1, 0, 1  (for +h,+k, l)
+
+On  the  unit grid, the triple 1,2,3 is transformed by the  first
+pair as but with the second pair it is transformed as
+
+A  second example in the cubic Laue group m3m where there is only
+one matrix/origin pair
+
+            1, 0, 0 / 1, 1, 0 / 1, 1, 1      0, 0, 0
+
+shows that in this case the same triple 1,2,3 transforms as
+
+     Thus   the  same  indexing  scheme  can  be  used  for   all
+space groups.
+
+     A   second  advantage  is  that  the  order  in  which   the
+reflections  are generated can be changed easily by swapping  the
+rows of the DH matrix without changing the basic index generating
+scheme.  The matrix
+
+                   1, 0, 0 / 0, 1, 0 / 0, 0, 1
+
+implies  that the segment of reciprocal space bounded  by  the  3
+reciprocal  axes a*, b* and c* forms the segment of  data  to  be
+collected  and  the order of data collection is h slowest  and  l
+fastest.  It may happen, because there is a short reciprocal axis
+for example, that it is more economical in time to increment that
+axis  fastest, in which case the matrix may be typed in the order
+required,  e.g. if b* is shortest and c* longest, the appropriate
+DH matrix is
+
+                   0, 0, 1 / 1, 0, 0 / 0, 1, 0
+
+which  would  generate reflections, within the 2q limit,  in  the
+order  0,0,0 to 0,kmax,0, then 1,kmax,0 to 1,0,0, then  2,0,0  to
+2,kmax,0 etc, until all the h,k,0 rflections have been collected.
+The  process then starts again at the 0,0,1 reflection, and  then
+0,0,2 etc until all +h,+k,+l reflections have been collected.
+
+     A  third  advantage is that the unique portion of reciprocal
+space  to  be  measured  is  specified  exactly,  i.e.  with   no
+repetition  of reflections.  The monoclinic example  above  shows
+that  the  reflections  hk0 and 0kl are generated  in  the  first
+segment,  but  the reflections  hk0 and 0kl are  avoided  in  the
+second by specifying the origin as  1,0,1.
+ 
+
+The  origin vectors and DH matrices which will measure the unique
+set for all
+Laue groups are as follows.
+
+         Laue     Origin                DH Matrix
+
+          1      0  0  0      1  0  0    0  1  0    0  0  1
+                 1  0  1      1  0  0    0  1  0    0  0  1
+                 1  1  0      1  0  0    0  1  0    0  0  1
+                 0  1  1      1  0  0    0  1  0    0  0  1
+
+        2/m      0  0  0      1  0  0    0  1  0    0  0  1
+                 1  0  1      1  0  0    0  1  0    0  0  1
+
+        mmm      0  0  0      1  0  0    0  1  0    0  0  1
+
+        4/m      0  0  0      1  0  0    1  1  0    0  0  1
+                 1  2  0      0  1  0    1  1  0    0  0  1
+
+       4/mmm     0  0  0      1  0  0    1  1  0    0  0  1
+
+        R 3      0  0  0      1  0  0    1  0  1    1  1  1
+                 1  1  0      1  0  1    0  0  1    1  1  1
+                 0  1  2      1  0  0    1  0  1    1  1  1
+                 1  0  2      1  0  1    0  0  1    1  1  1
+
+       R 3m      0  0  0      1  0  0    1  0  1    1  1  1
+                 1  1  0      1  0  1    0  0  1    1  1  1
+
+         3       0  0  0      1  0  0    1  1  0    0  0  1
+                 1  2  0      1  1  0    0  1  0    0  0  1
+                 0  1  1      0  1  0    1  1  0    0  0  1
+
+        31m      0  0  0      1  0  0    1  1  0    0  0  1
+                 0  1  1      0  1  0    1  1  0    0  0  1
+
+        3m1      0  0  0      1  0  0    1  1  0    0  0  1
+                 1  1  1      0  0  1    1  0  0    0  0  1
+
+        6/m      0  0  0      1  0  0    1  1  0    0  0  1
+                 1  2  0      0  1  0    1  1  0    0  0  1
+
+       6/mmm     0  0  0      1  0  0    1  1  0    0  0  1
+
+        m3       0  0  0      1  0  0    1  1  0    1  1  1
+                 1  2  0      0  1  0    1  1  0    1  1  1
+
+        m3m      0  0  0      1  0  0    1  1  0    1  1  1
+
+
+     Having  measured  a unique set the routine  will  go  on  to
+measure  equivalent sets if allowed to.  These sets are generated
+in  the  order set 1, then the Friedel related set  1,  then  the
+first  equivalent set 2, then set  2, etc until the whole  sphere
+is measured.
+
+     This  is  all  transparent to the user with the  SG  and  GO
+commands, and measurement can safely be interrupted and restarted
+automatically.
+
+     Data  collection always starts with the collection of a  set
+of  reference reflections, which are printed to hard copy,  along
+with  details of when they were taken.  Reflections are generated
+and  measured  according to the sequence  controlled  by  the  DH
+matrices.   Reference reflections are also taken and  printed  at
+the  start  and  end of each segment.  Unique sets  of  data  are
+numbered sequentially 1, 2, 3 etc. with Friedel sets numbered  1,
+  2,   3  etc.  Thus in the monoclinic case with two DH  matrices
+(segments) the numbering scheme would be
+
+      1. Set 1, segments 1 and 2;    2. Set  1, segments 1 and 2;
+      3. Set 2, segments 1 and 2;    4. Set  2, segments 1 and 2.
+
+     This  would  then have measured the whole of the  reciprocal
+sphere,  if  allowed  to proceed that far.  The  process  can  be
+interrupted at any point with K or Q.  During data collection all
+reflection profiles are displayed on the screen, with the results
+of profile analysis if selected, plus a short printout of results
+on the screen.
+
+                    Data Collection Output
+
+     Reflection  results  can  be  printed  to  hard  copy  using
+switches  4  and 5 (see the SW command).  Switch 4  is  used  for
+normal  reflections and switch 5 for reference reflections.   The
+default is to print both.
+
+  Printout during data collection is as follows :
+
+At the start of each set of measurements a printer message gives
+
+        h k l   Reflection   Set   Segment   Record,   where
+
+    h k l       is the next normal reflection to be measured,
+    Reflection  is the sequence number of the reflection,
+    Set         is the number of the present set,
+    Segment     is the number of the present segment,
+    Record      is the record number on the .ID file.
+
+
+For non reference reflection measurements (Printer SW4 = 0)
+
+   On terminal (and printer)   h k l   Inet   s(Inet)
+      if   Inet < 2*s(Inet)    h k l   Inet   s(Inet) **
+
+For reference reflection measurements (Printer SW5 = 0)
+
+   Terminal output is
+        h k l  Peak  s(Peak)  N,    where
+      N is the reference reflection number.
+
+     Profile analysis is never done on the reference reflections,
+though the profile is displayed, and all values are based on  the
+background time fraction given in TP.  Reference reflections  are
+taken at the start and end of each segment and at intervals of  N
+reflections, as specified in RR.
+For normal scan modes printer output is:
+
+     N  h k l  2q  Scan time  Natt  b1  Peak  b2  Inet,  where
+   N           is the reference reflection number,
+   Scan time   is the time for the scan in seconds,
+   Natt        is the attenuator index (normally 0),
+     b1,Peak,b2   low  angle  background,  peak  and  high  angle
+background for the
+               parameters given in TP and SD
+    Inet        is the net count, including any attenuator factor
+which puts all
+                measurements of the same reflection on a constant
+scale to
+               facilitate comparison.
+
+For controlled precision modes printer output is:
+
+      N   h  k  l   2q  Nscans  Natt  b1  Peak  b2  Inet s(Inet),
+where
+   Nscans      is the number of scans done,
+    Inet         is  the  net  count, including  attenuation  and
+normalized
+               to 1 scan.
+
+     There  are  also  other messages which will appear  only  if
+there  are  angle  setting or scan collisions, or  problems  with
+timing.   The routine should be able to detect these and continue
+its normal sequence.
+
+
+               Profile Analysis During Data Collection
+
+     Profile analysis, if requested, is only done for peaks  with
+Inet  > 2*s(Inet), based on minimum background measurements  from
+TP  (usually 0.1 of the scan time). Profiles are taken  at  0.01ø
+steps  of the scan and the analysis is done on a smoothed profile
+to  minimize random statistical fluctuations.  If the  number  of
+the  intensity weighted maximum smoothed profile point (MaxI)  is
+more  than  a  movement tolerance away from  the  number  of  the
+calculated  a1  point  (MaxA)  and  Inet  >  5*s(Inet)  then  the
+following appears on the printer
+
+                 h  k  l   MaxI   MaxA   b1    Peak    b2
+
+no  profile analysis is done and the measurement is repeated once
+more.   If the same thing happens a second time, results with  no
+profile analysis are used.
+This can occur for two reasons,
+
+ 1.  the reflection is weak and random statistics are the cause,
+ 2.  the crystal has moved and most measurements show this error.
+In this case
+     the crystal should be reoriented.
+
+    The  movement  tolerance value is based  on  the  scan  width
+parameters and is
+
+            TOL = 100*(As + Cs)/8         where
+
+        100 is the number of profile points/deg. of scan,
+        As  is the angular scan width before a1, and
+        Cs  is the angular scan width after a2.
+
+     Thus  if  As = Cs = 1, the tolerance is 0.25ø or 25  profile
+points.  This can be augmented by 20, 10 or 5 points with the  SW
+command using switches 6, 7 and 8, to give a maximum of 35  extra
+points, i.e. 0.35ø of scan.
+
+     The  profile display is useful for monitoring the  stability
+of the crystal, both for mechanical movement and deterioration.
+
+     Profiles may be saved in compressed form on the binary  file
+PROFL7.DAT  by setting switch 9.  This file will tend  to  become
+rather  large and normally this option is not selected.   Records
+in  the PROFL7.DAT file are 128 bytes long (32 4 byte variables).
+Variables  are  4  bytes except for profile points  which  are  2
+bytes.
+
+For each reflection the records are as follows
+
+Record  1  h,k,l, Npts, Ilow, Ihigh, Frac, Ib1, Icount,  Ib2,  44
+profile pts,
+ where
+   Npts     is  the  number  of profile points  (+  1000*Nstd  if
+reference reflection),
+   Ilow    is the profile point number at low angle cutoff (1  if
+no analysis)
+   Ihigh   is the profile point number at high angle cutoff (Npts
+if no analysis)
+   Frac    is the ratio 1 bkgd time/peak time (usually 0.1 if  no
+analysis)
+  Ib1     is the low angle background for time Frac
+  Icount  is the total count for all points
+  Ib2     is the high angle background for time Frac
+  Ipts    are 44 profile points, as Value   32000.
+
+Records 2 to Nrecs   64 profile points,  where
+  Nrecs   is (Npts + 20 + 63)/64
+
+PROFL7.DAT can be transformed into an ASCII file with the command
+AP.  The file produced has the default name of PROFL7.ASC and the
+following format for each reflection
+   h,k,l, Npts, Ilow, Ihigh, Frac, Ib1, Icount, Ib2
+  ( 3I4,         3I5,        F8.5,  I6,   I7,    I6)
+   (Npts + 9)/10 lines of up to 10 profile points (10I6).
+
+
+               Intensity Data on the IDATA.DA file
+
+     Intensity data is written to the file IDATA.DA, starting  at
+record 20 in the following format.
+
+  10 reflections per record as
+       10 values of 1000*(h + 500) + k + 500
+        "   "    "  1000*(l + 500) + Ia (attenuator #)
+         "    "     "   Low angle background  (after any  profile
+analysis)
+         "    "     "   Peak count            (after any  profile
+analysis)
+         "    "     "   High angle background (after any  profile
+analysis)
+        "   "    "  10*speed + background time fraction
+        "   "    "  Reflection sequence #
+        "   "    "  y (999 if reference reflection)
+
+     The intensity data on the direct access IDATA.DA file can be
+also  converted, with the command AI, into a formatted ASCII file
+suitable for transmission to, or processing by, other systems.
+
+  The contents and format of the ASCII file are :
+       h,k,l, Ia, Ib1, Ipeak, Ib2, Time, Nref, Ipsi
+     (   3I4, I2,  I6,    I7,  I6, F9.5,   I6,   I5),    where
+   Ia    is the attenuator index  (0 to 5),
+   Ib1   is the low angle background,
+   Ipeak is the total peak count,
+   Ib2   is the high angle background,
+   Time  is (time for 1 background) / (Time for peak), i.e.
+             FRAC for normal scans, or
+              10*number of scans + FRAC for controlled  precision
+modes,
+   Nref  is the reflection sequence number,
+   Ipsi  is the y value, usually 0, 999 for standards.
+
+Example:
+ Command go
+ Start Data Collection (Y) ?
+ Type the space group symbol P 41
+ Do you wish to change the order of data collection (N) ?
+ Start at Reflection 1, Segment 1, Set 1, Record 20 (Y) ?
+ Measure the Translation element absences (Y) ?
+ Is everything OK (Y) ?
+
+
+K   Kill operation at the end of the current reflection
+
+     During lengthy operations it is essential to have some means
+of  interrupting the procedure.  This is achieved by  making  the
+routine  recognize unsolicited keyboard input at critical  points
+during execution.  If the K key is struck during AL, GO or IE for
+example, the program sequence will be interrupted at the  end  of
+the  operation on the current reflection and control returned  to
+the keyboard monitor.
+
+
+Q   Quit after the next set of reference reflections
+
+     As  for K, but the return to the keyboard  monitor is  after
+the next set of reference reflections during the GO command.
+
+     For  both  K  and  Q,  information is  saved  to  allow  the
+interrupted operations (GO or AL) to be resumed automatically  if
+no changes are made to the control parameters for the operation.
+
+
+LR   Last Reflection written to IDATA.DA
+
+     Each time a record of 10 reflections is written to IDATA.DA,
+the current reflection, set and segment numbers and record number
+are written to record 10.  This information can be recovered with
+LR.
+     
+               Restarting Data Collection after a Crash
+
+     Occasionally,  due  to  a machine or  power  failure  it  is
+necessary to restart data collection completely from scratch.  At
+such  times the information for a restart has not been saved  and
+it  is  necessary  to recover it from the printout  and  IDATA.DA
+file.
+
+     The important things to know about restarting are :
+
+       h,k,l of the first refln to be collected,
+       the set and segment numbers of that reflection,
+        the record number in the IDATA.DA file where the new data
+is to start,
+        the  number of the first reflection, though this  is  not
+essential.
+
+     It  is  safest  to  always  have  the  reference  reflection
+printing  turned  on  (SW5=1),  as  it  shows  the  next   h,k,l,
+reflection number, set number, segment number, and record  number
+before  each set of reference measurements.  The set and  segment
+numbers are also printed at the start of each segment.
+
+     To restart the collection there are three choices.
+
+   a. Restart at the last set of standards, which is simple but a
+bit wasteful.
+
+  b. Use  PD/1  to  search  for the last valid  intensity  record
+     written.  As explained above, data is written 10 reflections
+     per  record, therefore assuming reference measurements  were
+     taken  after  every 100 reflections at the most  10  records
+     will  need to be printed to find how far the data collection
+     had progressed beyond the last set of reference reflections.
+     The  h,k,l  sequence can be followed down the records  until
+     there  is  a discontinuity between 2 records.  This  happens
+     because the same file is used for all data collections,  and
+     data  from  previous collections are probably on  the  file.
+     This  means that data up to record n on the file is for  the
+     present  crystal, but the data in record n+1 is from another
+     crystal.   The  last  reflection in record  n  is  the  last
+     reflection saved together with its reflection number.  Using
+     this  information and the set and segment numbers  from  the
+     last reference reflection print, the restart is at
+
+        Next h,k,l, reflection-number+1, set and segment numbers,
+record n+1
+
+  c. Use the LR command to find the required information which is
+     written  each  time a record of intensity data  is  written,
+     i.e. every 10 reflections.
+
+

+

Angle Setting and Intensity Measurement Commands

+

+

+GS  Grid Search measurement in 2q/w/c
+
+     The  intensity  of  a  single  reflection  or  a  region  of
+reciprocal  space can be measured in small steps  on  an  angular
+grid  and output to the printer as a field of numbers.  This  can
+be  very  useful  in trying to deal with poor or split  crystals,
+before data collection is started.
+
+Example:
+ Command gs
+ Sample an Angular Grid (Y) ?
+ Type the grid specs.
+ A response of  is interpreted as no variation of that axis.
+ Type start, end & step for 2THETA 16.2,18.0,.2
+ Type start, end & step for  OMEGA  .5,.4,.1
+ Type start, end & step for    CHI
+ Counting time per step (1 sec)
+
+  2THETA ACROSS page, from  16.200  in 10 steps,  to 18.000
+   OMEGA   DOWN page, from 359.500  in 10 steps,  to  0.400
+
+    17     5     7    12    22    14    18     9     8    10
+    15    11    11    16    25    25    21    13    15    15
+    13    11    10    23    20    22    43    20    13    13
+    11    13    16    26    44   165  1179   327    44    20
+    16    15    17    53   153  1309  1809   985   111    56
+    13    17    31  1881   405  1945  1140   249    58    36
+    11    23    57  1005  1837  1048   257    73    32    23
+     3    10    15    65   584   209    49    34    12    11
+    14     8    11    13    34    28    29    21    11    12
+    10    10    13    11    20    17    14    16    16    12
+
+
+IE  Intensity measurement for Equivalent reflections
+
+Prerequisites: LA PS SD (SG) TM TP and a valid  Matrix
+
+     Similar  to  IR, but as the reflections are  typed  in,  all
+equivalent h,k,l values other than Friedel equivalents, are added
+to  the  list  and  subsequently each one is measured  using  the
+current  measurement  parameters.  This command  is  particularly
+useful for checking Laue group symmetry before data collection is
+started,  and  also to examine the reflection  profile  shape  in
+different directions.
+
+Example:
+ Command ie
+ Intensity Measurements for Equivalent Reflections (Y) ?
+ Type the space group symbol (P  1) p 41
+ Type h,k,l for up to 50 reflections. CR = End.
+ Next h,k,l (End) 1,2,3
+       1    2   3        2   1   3        1   2   3        2    1 3
+ Next h,k,l (End)
+
+  Output is as for IR below.
+
+
+IM   Intensity  Measurement of the reflection  which  is  in  the
+detector
+
+Prerequisites: SD TP
+
+     Occasionally during initial set up it is useful  to  measure
+the  reflection which is set, without knowing its indices.   This
+command  does  this  using  the current  measurement  conditions,
+except  that  no  y rotation is possible.  Values  of  h,k,l  are
+requested, but are only used as a label.  Again, output is as for
+IR below.
+
+
+IP  Intensity measurement in Psi steps for empirical absorption
+
+Prerequisites: LA SD TM TP and a valid  Matrix
+
+     This  is  a  command with the specific purpose of writing  a
+file  (CURVES.DAT)  of  intensity  measurements  for  a  set   of
+reflections, each of which is measured 37 times in 10ø steps of y
+from 0ø to 360ø.  The same restrictions on y apply as for A8 with
+Kappa  geometry goniometers, i.e. only reflections with c in  the
+range  80ø to 100ø may be used, and these can be found  with  BC.
+For Euler geometry goniometers, there are mechanical restrictions
+as c approaches 0ø, but they are much less severe.
+
+The contents and format of the CURVES.DAT file is
+
+Lines   1 to  3   Orientation matrix   (3(1X,3F10.6/))
+Lines    4 to 40   37 lines of data for 1st reflection in  10ø  y
+steps
+                  h,k,l, 2q, w, c, f, y, Inet  (3I4,5F8.2,I8)
+Lines  41 to 77   Same for 2nd reflection etc.
+
+Example:
+ Command ip
+ Collect Psi scan data
+ Do you want to write data to CURVES.DAT (Y) ?
+ Type h,k,l for up to 50 reflections. CR = End.
+ Next h,k,l (End) 1,2,3
+ Next h,k,l (End)
+
+
+IR  Intensity measurement for specifed Reflections
+
+Prerequisites: LA PS SD (SG) TM TP and a valid Matrix
+
+     Reflections  from a list of up to 100 sets of  h,k,l  values
+can  be measured according to the current measurement parameters.
+If  a  range  of  y  values  has been  specified  with  PS,  each
+reflection is measured as many times as possible over that range.
+Reflections  which  are  considered  to  be  systematic  absences
+according  to the space group specified in SG can be measured  or
+not,  at the user's discretion.  If no space group has been given
+it is asked for.
+
+     Output is h,k,l, 2q, Frac, Natt, B1, Peak, B2, y, Inet
+
+where   Frac    is (Time for 1 background / Time for peak),
+        B1, B2  are the backgrounds after profile analysis,
+        Inet    is the net count after profile analysis.
+
+Example:
+ Command ir
+ Intensity Measurements for Individual Reflections
+  Type h,k,l and +/  2Theta sense (+) for up to 50 reflections CR
+= End
+ Next h,k,l (End)  1  1 12
+ Next h,k,l (End)
+
+   1   1  12  24.58   .345 0   51   2891   51    .00   2740
+
+
+LP  Line Profile plot on the printer
+
+     This command performs a step scan of a specified reflection,
+for  a specified number of steps of given size, for a given angle
+and  produces a normalized plot on the printer.  This should  not
+be  confused with the normal terminal profile display which  uses
+the current measurement conditions.
+
+Example:
+ Command lp
+ Plot a Line Profile on the Printer (Y) ?
+ Scan type: Theta/2Theta or Omega, 0 or 1
+ Type the no. of pts before & after the peak, 500 max. 10,10
+ Type the step size in deg. and the count time/step in secs .1,1
+
+
+SA  Set All angles to specified values
+
+     This  command provides a means of setting the instrument  to
+specified   angles  which  are  not  necessarily  those   for   a
+reflection.
+
+
+SC  Set c to the specified value
+
+SO  Set w to the specified value
+
+
+SP  Set f to the specified value
+
+
+SR  Set Reflection: h,k,l,
+
+Prerequisites: LA SD (SG) TM TP and a valid Matrix
+
+     The  reflection  specified is set at the y  value  requested
+(default 0ø), provided it is within the current limits set by  TM
+and  is  not  a systematic absence according to the  space  group
+specified in SG.  Fractional values of h,k,l are allowed.
+
+
+ST  Set 2q to the specified value
+
+TC  Timed Counts
+
+     This is the command for taking either
+  a. a single stationary timed count with a given attenuator; or
+  b. a  series of such counts to check the stability of the x ray
+     generator and counting system.
+
+     The  command  asks for the option to be used  and  then  the
+count time in seconds and an attenuator index (default 0).
+
+     If the second option is chosen an initial count of 100 times
+the  input  time is taken in order to establish a  reliable  mean
+count,  then counts are taken repeatedly for the input  time  and
+printed,  10  per line, as the deviation from the  mean  together
+with one of the following
+           blank    if  the  deviation  is  within  1  s  of  the
+mean count, or
+           A     if between 1 and 2 s,
+           B     if between 2 and 3 s and
+           C     if more than 3 s.
+At  the  end of 50 such lines (500 counts), a summary is  printed
+showing  the observed and theoretical distribution of deviations.
+This process will continue until stopped by the K command.
+
+Example:
+ Command tc
+ Timed Count at a Point (Y) ?
+ Type the Count Time in seconds 1
+ Do you wish to repeat the counting for a stability test (Y) ? n
+ Time    1.000, Count 115909.
+ Do you want to repeat the procedure (N) ?
+
+     When  repeated  counting  is done,  output  similar  to  the
+following will appear on the printer.
+
+     A  count  is  taken for 50.00 secs to establish a reasonable
+mean.   Counts  are  then repeated 500 times  and  a  statistical
+summary printed.
+
+Time  0.50, Mean Count 12429.  Sigma(Mean)   111.5
+The  deviations from the Mean Count are printed followed by A,  B
+or C, if the
+deviation is more than 1, 2 or 3 Sigma(Mean).
+
+   101     4    27   113A   75    79    15    40    43   110
+       ................................................
+       ................................................
+  125A    86   154A   63   222A   20    75   109    30    73
+
+     Distribution of Counts   Observed     Theoretical
+        .GT.  0.674*Sigma       49.2%         50.0%
+        .GT.  1.000*Sigma       30.0%         31.7%
+        .GT.  2.000*Sigma        5.0%          4.6%
+        .GT.  3.000*Sigma        0.4%          0.3%
+
+
+ZE  ZEro the instrument angles
+
+     This  command sets all angles to 0ø or initiates a  seek  of
+zero  marking  switches.  The order and timing of  axis  movement
+depends on the particular goniometer.
+
+

+

Photograph Setup Commands

+

+

+     The  mechanical  setup  required to  take  photographs  will
+depend  on  the particular diffractometer in use.  The photograph
+commands  merely provide a means of turning the  crystal  to  the
+required orientation.
+
+
+PL  Photograph in the Laue mode
+
+Prerequisite:   Valid Matrix
+
+     A specified direction h,k,l is set along the direct beam and
+the  shutter  opened for a specified time with no circles  moving
+during exposure. It is not very useful to attempt to take a  Laue
+photo on machines with a monochromator.
+
+Example:
+ Command pl
+ Set for a Laue Pattern along a given row (Y) ?
+ Type the indices of the row 1,2,3
+ The setting is NOT feasible
+ Command pl
+ Set for a Laue Pattern along a given row (Y) ?
+ Type the indices of the row 3,2,1
+  Setting  angles  for  row  3   2    1   0.000   15.501   90.000
+123.690
+ Set it (Y) ?
+
+
+PO  Photograph in the Oscillation mode
+
+     A  specified real cell direction is set vertically and w  is
+rotated through a given, usually small, range a specified  number
+of times.
+
+Example:
+ Command po
+ Oscillation Picture (Y) ?
+ Type the omega scan limits  5,5
+ Type the time to perform 1 scan in minutes 1
+ Type the number of repeats (1) 4
+
+
+PR  Photograph in the Rotation mode
+
+     A  specified  real  cell direction is set vertically  and  w
+rotated through a given, usually large, range once only.
+
+Example:
+ Command pr
+ Set a Direct Lattice Row upwards along the Omega Rotation Axis
+ Confirm (Y)
+ Type the indices of the row  0  1  0
+ The Periodicity for a Primitive Lattice is   9.932 Angstroms
+ Type the Crystal to Film Distance in mm 200
+ Separation in mm between the + and   nth levels
+
+       1      28.6
+       2      57.7
+       3      87.7
+       4     119.2
+       5     152.9
+       6     189.7
+       7     230.9
+       8     278.5
+       9     335.6
+   Setting angles    .000     .000   149.178    1.430
+
+

+

General System Commands

+

+

+AH   Angles to H, k, l
+
+     The h, k, l values associated with a set of Euler angles are
+calculated and printed as fractional values.
+
+Example:
+ Command ah
+ Calculate Reciprocal Coordinates
+ Type the reflection angles (End)  12,0,50,45
+     Reciprocal Coordinates (h,k,l)     1.340     1.340     2.258
+ Type the reflection angles (End)
+
+
+AI  Ascii Intensity data file conversion
+
+     Intensity  data on the binary file IDATA.DA is converted  to
+ASCII  and  written  to  a  file,  which  has  the  default  name
+IDATA.ASC, in the format described under GO.
+
+
+AP  Ascii Profile data file conversion
+
+     The  profile data on the binary file PROFL7.DAT is converted
+to  ASCII  and  written  to a file, which has  the  default  name
+PROFL7.ASC, in the format described under GO.
+
+
+BC  Big c search for y rotation
+
+    Prerequisites :    SG TM Valid matrix
+
+     When  measuring intensities with y rotation,  the  range  of
+permissible  y values increases with c, until at c  =  +/  90ø  a
+complete  360ø y rotation is always possible.  On Euler  geometry
+machines  the  restriction on the y range comes about  because  w
+moves  from  the bisecting position by a maximum of +/  |90  cb|,
+where cb is the c value at the bisecting position.  If cb is near
+0ø the w excursion will approach 90ø and collisions will occur as
+the  c  ring approaches the tube mounting.  For reflections where
+cb  approaches 90ø the w excursion is a minimum and  usually  the
+full  360ø  rotation is attainable.  On kappa  geometry  machines
+similar restrictions apply, but a more severe restriction  occurs
+because  of the small range of c attainable above c = 90ø.   This
+range  is  2a 90ø and as a is usually around 50ø only reflections
+with  cb  in the range 80ø to 90ø can have full 360ø y  rotation.
+The  BC  command will find all reflections with 2q  less  than  a
+specified  maximum  and cb between a specified  minimum,  usually
+80ø, and 90ø.
+
+Example:
+ Search for reflections with High Chi Values
+
+ Type the minimum acceptable chi value (80)
+ Type 2theta(max) (100.0) 30
+ h,k,l for 2theta 30.000, chi 90    8.525    2.635    1.466
+ Reflections with chi greater than 80.000
+        h   k   l    2theta   omega    chi     phi
+        3   1   1     7.294    .000  82.829  355.234
+        3   1   0     6.988    .000  81.821  197.964
+        5   1   1    11.270    .000  82.603   82.854
+        6   2   2    14.617    .000  82.829  355.234
+        6   2   1    14.186    .000  88.445  264.275
+        6   2   0    14.001    .000  81.821  197.964
+        8   2   1    18.199    .000  85.679  124.069
+        8   2   0    18.040    .000  81.139  161.016
+        7   3   2    17.703    .000  81.733  308.986
+        7   3   1    17.339    .000  82.627  263.346
+        8   2   2    18.554    .000  84.587  51.404
+
+
+BI  Big Intensity search in the IDATA.DA file
+
+     When a data collection is complete, it is normal to use  the
+more  intense  higher angle reflections to collect accurate  data
+for  cell  determination  with AL and MM  or  LC.   This  command
+searches  the intensity data file for the 25 biggest  intensities
+in  the  range of IDATA.DA records given, with 2q values  greater
+than a minimum.  It is only necessary to search the IDATA records
+containing  the  unique set, as AL will expand the  unique  h,k,l
+values.
+
+Example:
+ Command bi
+ Search for the 25 biggest Inet/Sigma(Inet) (Y) ?
+ Type 2thetamin 25
+ Intensity data is in records 20 to  154
+ Type the first and last record numbers (All) 20 100
+ Do you want to search more records (N) ?
+
+The following output appears on the printer
+
+         h   k   l    2Theta      Inet    I/SigI
+         5   1   2     25.60     72050    268.41
+         5   4   2     31.37     58198    241.21
+            .................................
+            .................................
+         2   1   5     33.96     25302    159.05
+
+HA  H, k, l to Angles
+
+     The  Euler  angles  for specified h,k,l  and  y  values  are
+calculated  and printed, in the order 2q, w, c, f, y.  Fractional
+indices are allowed.
+
+Example:
+ Command ha
+ Type h, k, l, Psi  (End) 1,2,3
+   1   2   3  15.251   0.000  53.301  63.435   0.000
+ Type h, k, l, Psi  (End)
+
+
+IN  INitialize integer parts of angles.
+
+     This command is meant for initializing the integer parts  of
+the  current  angle  values, for instruments  that  do  not  have
+absolute  encoding  systems.  It will not be applicable  to  most
+systems.
+
+
+NR  set the NRc program flag
+
+     As  explained on page 12, there is a flag called  NRC  which
+can be set to take care of the definition of the c zero position.
+If  c = 0 occurs when the f circle mechanism is at the bottom  of
+the c circle NRC should be set to 1, otherwise  1.
+
+
+P9  rotate f by 90ø
+
+     This  command is meant to help with optical centring  during
+the initial crystal setup.  Usually, the f circle must be rotated
+several  times  during this process and this command  helps  with
+this  by  rotating f so that successive 90ø rotations bring  both
+goniometer  head  translations into  a  position  normal  to  the
+viewing direction so that they may be adjusted.
+
+
+PA  Print Angle settings
+
+     The  present Euler angles at which the circles are  set  are
+printed on the terminal in the order 2q, w, c, f.
+
+     The  h,k,l values printed are the last values used  and  may
+not correspond to the angles printed.
+
+Example:
+ Command pa
+ Current values are   1   2    3    15.251  0.000  53.301 0.000
+
+
+PD  Print Data of all forms
+
+     All  forms  of  data, basic and intensity, may  be  printed,
+either  on  the terminal or to hard copy.  If intensity  data  is
+being  printed,  it  is advisable to print  only  selected  small
+quantities of data, or printing time can become very lengthy.
+
+Example:
+ Command pd
+           Print Data on Terminal or LPT
+ Options are :    0   Print Basic Data on Terminal
+                  1   Print Basic Data on LPT
+                  2   Print Intensity Data on Terminal
+                  3   Print Intensity Data on LPT
+ Type your choice (0) 0
+
+ Space group P 2/M        Wavelength    0.70932
+            Orientation   Matrix                            Theta
+Matrix
+  0.09999949  0.00000003  0.00387554       0.00503130  0.00196553
+0.00155299
+  0.00000000  0.06250248  0.00000001       0.00000000  0.00038998
+0.00000000
+  0.00000000  0.00000000  0.05542216
+  Cell       10.0245   15.9994   18.0433         90.000    94.000
+90.000
+ D2theta  0.000   Domega  0.000   Dchi  0.000
+ No attenuators.
+ No Psi rotation
+  1 Reference reflections every 100 reflections
+   4   0   0
+ No Re orientation during data collection.
+   16  Alignment/Re  orientation Reflections  (including  Friedel
+equivalents)
+   1   2   3      2   1   3      1   2   3      2   1   3
+   3   2   1      2   3   1      3   2   1      2   3   1
+
+ Type  when ready to proceed.
+
+   2Theta  Limits:  Min  4.000;  Max  50.000.  Hmax 12, Kmax  20,
+Lmax 22.
+ There are NO Explicit Absence Conditions
+ Omega/2Theta Scan.     Profile analysis.
+ Bisecting Geometry.   Scan speed    4.000deg/min
+ Scan Parameters:    1.000 +  0.700*tan(theta) +  1.000
+  Time/Precision Params:   Bkfrac 0.100; Tmax   10.0, PA    1.00,
+PM   1.00
+ Segment Data (DH Matrices)   2 segment(s)
+   0   0   0   1   0   0   0   1   0   0   0   1
+   1   0   1   1   0   0   0   1   0   0   0   1
+  Next  reflection:    0   0   0, #    1, set  1, segment  1,  at
+record   20
+
+     For intensity data each line contains the following :
+
+N h k l  2q  Frac  Natt  Blow  Peak  Bhigh  y  Inet Inet/s(Inet)
+
+most of which is self explanatory but,
+       N      is blank or the reference reflection number.
+       Frac   is 10*scan speed + time ratio for normal scans, or
+               10*number  of  scans  + time ratio  for  precision
+scans.
+              Time ratio is the background time/peak time.
+              Background time is the time for 1 background, and
+              peak time is the scan time, after profile analysis.
+      Natt    The attenuator number (0 to 5)
+      Blow    Low angle background
+      Peak    Integrated peak count
+      Bhigh   High angle background.
+               If there is profile analysis, both backgrounds and
+the peak count
+              are adjusted to reflect the cut off points, and the
+time ratio is
+              that for the adjusted values.
+       y        The  value for the measurement, usually 0ø.   999
+for standards.
+      Inet    Net intensity, with profile analysis, if used.
+
+Example:
+ Command pd
+           Print Data on Terminal or LPT
+ Options are :    0  Print Basic Data on Terminal
+                  1  Print Basic Data on LPT
+                  2  Print Intensity Data on Terminal
+                  3  Print Intensity Data on LPT
+ Type your choice (0) 2
+
+     Attenuator(0)    1.00
+     Attenuator(1)   18.14
+
+ Type 2thetamin, 2thetamax and min(I/sigI) (All Reflns)
+ Type the first and last record numbers (All) 31
+
+     12    7    0    61.639  40.250 0  123.   451.   123.    .000
+447   21.05
+     11    7    0    57.435  40.525 0  204.  1627.   204.    .000
+1621   40.19
+     10    7    0    53.416  40.250 0  124.   480.   124.    .000
+476   21.73
+      9    7    0    49.591  40.250 0  135.   524.   135.    .000
+520   22.72
+      8    7    0    45.975  40.250 0  155.   668.   155.    .000
+664   25.69
+   1    10    0    0    43.527   40.264  0   402.  39627.    402.
+35607  145.70
+   2     0    0    5    31.778   40.218  0   256.  35154.    256.
+32594  148.84
+   3     0   10    0    42.556   40.243  0   396.  41735.    396.
+37775  152.28
+      7    7    0    42.590  40.446 0  248.  1564.   248.    .000
+1557   39.37
+      8    8    0    49.045  40.667 0  472. 10935.   472.    .000
+10923  104.46
+
+ Do you want to print more records (N) ?
+
+
+RB  Read the Basic data from the IDATA.DA file
+
+     All  the  current control parameters for all commands,  plus
+all  derived  quantities  such as the orientation  matrix,  h,k,l
+limits  etc  are written in the first 3 records of  the  IDATA.DA
+file.   The  RB command reads these values, which are written  by
+the  WB command or whenever a data collection is started with the
+GO command.  (See the description of the IDATA file)
+
+UM  (UMpty) Count the unique reflections within the 2q limits
+    (Umpty   a large but indefinite number O.E.D.)
+
+     An  accurate count of the unique reflections within  the  2q
+limits  for the unique DH segments derived with SG is calculated.
+From this users can estimate (allowing for reference reflections,
+scan  time, slewing time and any re orienation), how long it will
+take to collect a unique set.
+
+Example:
+ Command um
+ Count the number of reflections in each segment (Y)
+ DH Segment  1 contains  1718 reflections
+ DH Segment  2 contains  1416 reflections
+
+
+VM  set the circles to the View Microscope position
+
+     The  Euler angles for the most convenient microscope viewing
+position  are stored in the goniom.ini file and used  by  the  VM
+command  to set the instrument to this position ready for optical
+centring of a crystal, in conjunction with the P9 command.
+
+
+WB  Write the Basic data to the IDATA.DA file
+
+     Write  all the current parameters to the first 3 records  of
+the IDATA file.  It is a good idea to use this command whenever a
+valid  orientation  matrix  is established,  as  this  will  save
+trouble on subsequent restarts   planned or not!
+
+
+

+ + \ No newline at end of file diff --git a/doc/user/tricsingle.htm b/doc/user/tricsingle.htm index cacaede3..15fa387b 100644 --- a/doc/user/tricsingle.htm +++ b/doc/user/tricsingle.htm @@ -14,14 +14,20 @@ to be solved are:

  • Measure a couple of reflections.
  • Furthermore there are some specialities. -There are two ways to achieve all this: The older way uses some built in SICS functionality plus some external prograsm inherited from the ILL. This is called the ILL operation. Then a complete four circle packaage called DIFRAC from P. White and Eric Gabe was integrated into SICS. Thsi is The Difrac way of operation. +There are two ways to achieve all this: +The older way uses some built in SICS functionality plus some external +programs inherited from the ILL. This is called the ILL operation. +Then a complete +four circle package called DIFRAC from P. White and Eric Gabe was +integrated into SICS. +This is The Difrac way of operation.

    DIFRAC

    The DIFRAC commands are accessed by prepending the difrac commands with dif. For example: "dif td" calls the difrac td command. For more information on DIFRAC commands see the separate -DIFRAC manual. +DIFRAC manual.

    ILL operation

    diff --git a/drive.c b/drive.c index 9241a898..7a336df6 100644 --- a/drive.c +++ b/drive.c @@ -51,7 +51,7 @@ #include "splitter.h" #include "status.h" #include "devexec.h" - +#include "motor.h" /*---------------------------------------------------------------------------*/ int Drive(SConnection *pCon, SicsInterp *pInter, char *name, float fNew) @@ -128,7 +128,7 @@ /* wait for finish */ iRet = Wait4Success(GetExecutor()); - fPos = pInt->GetValue(pDum,pCon); + fPos = pInt->GetValue(pDum,pCon); if(iRet == DEVINT) { if(SCGetInterrupt(pCon) == eAbortOperation) @@ -250,6 +250,27 @@ pObjectDescriptor pDes = NULL; pIDrivable pInt = NULL; Dummy *pDum = NULL; + pMotor pMot = NULL; + float fPos; + int iRet; + + /* + treat motors separatetly in order to correct for zero points + Sighh......... + */ + pMot = FindMotor(pSics,name); + if(pMot != NULL) + { + iRet = MotorGetSoftPosition(pMot,pCon,&fPos); + if(iRet) + { + return fPos; + } + else + { + return -999.; + } + } pObject = FindCommand(pSics,name); if(pObject) @@ -341,11 +362,12 @@ SCWrite(pCon,pBueffel,eError); ClearExecutor(GetExecutor()); SetStatus(eOld); - return 1; + return 0; } else if(iRet == DEVINT) - { - SCWrite(pCon,"Driving Interrupted",eError); + { + sprintf(pBueffel,"Driving Interrupted!",argv[0]); + SCWrite(pCon,pBueffel,eError); ClearExecutor(GetExecutor()); SetStatus(eOld); return 0; diff --git a/fowrite.c b/fowrite.c index 5a2a79de..ca7e242d 100644 --- a/fowrite.c +++ b/fowrite.c @@ -429,6 +429,13 @@ sprintf(pBueffel,"%d",iInt); NXDupdate(pDict,"timebin",pBueffel); lData = GetHistogramPointer(self->pHist,pCon); + if(!lData) + { + SCWrite(pCon,"ERROR: failed to find Histogram Memory Data",eError); + NXclose(&pFile); + NXDclose(pDict,NULL); + return; + } setFMDataPointer(lData,iTime); if(self->iUpper) { @@ -615,7 +622,6 @@ /* close everything */ - free(lData); NXclose(&pFile); NXDclose(pDict,NULL); diff --git a/histmem.c b/histmem.c index 50cf2c26..d33d1976 100644 --- a/histmem.c +++ b/histmem.c @@ -62,7 +62,6 @@ /* #define LOADDEBUG 1 - */ /*------------------------------------------------------------------------*/ static int HistHalt(void *pData) @@ -997,6 +996,12 @@ return NULL; } + if(self->iLocalData == NULL) + { + self->iLocalUpdate = 1; + self->tLocal = 0; + } + /* get the full histogram if an update is needed */ if( (self->iLocalUpdate) && (time(NULL) > self->tLocal) ) { diff --git a/nread.c b/nread.c index be098145..14a1bb65 100644 --- a/nread.c +++ b/nread.c @@ -367,7 +367,8 @@ extern VerifyChannel(mkChannel *self); /* defined in network.c */ pTel = CreateTelnet(pRes); if(!pTel) { - SICSLogWrite("Failure to allocate new Telnet Task Object",eInternal); + SICSLogWrite("Failure to allocate new Telnet Task Object", + eInternal); SCDeleteConnection(pRes); return 0; } diff --git a/nxsans.c b/nxsans.c index 36d2a847..e9a9b837 100644 --- a/nxsans.c +++ b/nxsans.c @@ -284,6 +284,9 @@ lVal = GetHistMonitor(self,0,pCon); iVal = (int32)lVal; NXDputalias(Nfil,pDict,"m1counts",&iVal); + lVal = GetHistMonitor(self,4,pCon); + iVal = (int32)lVal; + NXDputalias(Nfil,pDict,"pbcounts",&iVal); /* the collimator */ pCom = FindCommand(pSics,"sps2"); diff --git a/scan.c b/scan.c index 08392b3e..d158b13a 100644 --- a/scan.c +++ b/scan.c @@ -134,6 +134,8 @@ extern void SNXFormatTime(char *pBuffer, int iLen); pIDrivable pDriv = NULL; float fVal; pMotor pMot = NULL; + pVarEntry pScanVar = NULL; + void *pVoid = NULL; assert(self->pSics); assert(self->pCon); @@ -286,9 +288,31 @@ extern void SNXFormatTime(char *pBuffer, int iLen); fprintf(self->fd,"%s %s\n",pBuffer,self->pFile); continue; } +/*------------ scanzero */ + pPtr = strstr(pBuffer,"!!SCANZERO!!"); + if(pPtr) + { + *pPtr = '\0'; + /* write zero point of first scan variable if motor */ + DynarGet(self->pScanVar,0,&pVoid); + pScanVar = (pVarEntry)pVoid; + if(pScanVar) + { + pMot = NULL; + pMot = FindMotor(self->pSics,pScanVar->Name); + if(pMot != NULL) + { + MotorGetPar(pMot,"softzero",&fVal); + fprintf(self->fd,"%s zero = %8.3f\n",pScanVar->Name, fVal); + } + } + } /* --------- plain text */ fprintf(self->fd,"%s",pBuffer); } /* end while */ + + + /* remember position for seeking to it for writing data */ self->lPos = ftell(self->fd); fclose(fd); diff --git a/sicsstatus.tcl b/sicsstatus.tcl index 9817bf51..e2c80ff4 100644 --- a/sicsstatus.tcl +++ b/sicsstatus.tcl @@ -6,7 +6,7 @@ flightpath setAccess 1 delay 2500.000000 delay setAccess 1 hm CountMode timer -hm preset 100.000000 +hm preset 2.000000 hm genbin 120.000000 35.000000 512 hm init datafile focus-1001848.hdf @@ -117,10 +117,10 @@ twotheta AccessCode 2.000000 lastscancommand sscan ch 180 190 10 2 lastscancommand setAccess 2 banana CountMode timer -banana preset 100.000000 +banana preset 2.000000 sample_mur 0.000000 sample_mur setAccess 2 -email UNKNOWN +email Uwe.Nurps@nurps.nurpstown.de email setAccess 2 fax UNKNOWN fax setAccess 2 @@ -129,7 +129,7 @@ phone setAccess 2 adress UNKNOWN adress setAccess 2 # Counter counter -counter SetPreset 1.000000 +counter SetPreset 120.000000 counter SetMode Timer # Motor som som SoftZero 0.000000 @@ -244,9 +244,9 @@ d1r sign 1.000000 d1r InterruptMode 0.000000 d1r AccessCode 2.000000 # Motor tasse -tasse SoftZero 0.000000 -tasse SoftLowerLim -130.000000 -tasse SoftUpperLim 130.000000 +tasse SoftZero 10.000000 +tasse SoftLowerLim -140.000000 +tasse SoftUpperLim 120.000000 tasse Fixed -1.000000 tasse sign 1.000000 tasse InterruptMode 0.000000 @@ -332,9 +332,9 @@ a5 sign 1.000000 a5 InterruptMode 0.000000 a5 AccessCode 2.000000 # Motor a4 -a4 SoftZero 0.000000 -a4 SoftLowerLim -130.000000 -a4 SoftUpperLim 130.000000 +a4 SoftZero 10.000000 +a4 SoftLowerLim -140.000000 +a4 SoftUpperLim 120.000000 a4 Fixed -1.000000 a4 sign 1.000000 a4 InterruptMode 0.000000 @@ -363,11 +363,11 @@ a1 Fixed -1.000000 a1 sign 1.000000 a1 InterruptMode 0.000000 a1 AccessCode 2.000000 -user Daniel_the_Clementine +user Joseph Stalin user setAccess 2 -sample DanielOxid +sample Fischdosen sample setAccess 2 -title TopsiTupsiTapsi +title Nasse Fische in Dosen title setAccess 2 -starttime UNKNOWN +starttime 2000-03-31 11:40:31 starttime setAccess 2 diff --git a/tcl/count.tcl b/tcl/count.tcl index 594f4c84..ad7cbacf 100644 --- a/tcl/count.tcl +++ b/tcl/count.tcl @@ -10,6 +10,7 @@ proc SplitReply { text } { } #-------------------------------------------------------------------------- proc count { {mode NULL } { preset NULL } } { + starttime [sicstime] #----- deal with mode set mode2 [string toupper $mode] set mode3 [string trim $mode2] @@ -32,14 +33,21 @@ proc count { {mode NULL } { preset NULL } } { $bb $aa] #------- count banana InitVal 0 + wait 1 banana count - Success + set ret [catch {Success} msg] #------- StoreData -# ClientPut [StoreData] +# StoreData + if { $ret != 0 } { + error [format "Counting ended with error"] + } } #---------------- Repeat ----------------------------------------------- proc repeat { num {mode NULL} {preset NULL} } { for { set i 0 } { $i < $num } { incr i } { - count $mode $preset + set ret [catch {count $mode $preset} msg] + if {$ret != 0} { + error "Counting ended with error" + } } } diff --git a/tcl/scancom.tcl b/tcl/scancom.tcl index f22df8bc..6b3a9bf9 100644 --- a/tcl/scancom.tcl +++ b/tcl/scancom.tcl @@ -318,6 +318,7 @@ if {$ret != 0} { Publish sscan User Publish sftime Spy Publish scaninfo Spy + Publish wwwsics Spy } #************************************************************************* @@ -359,10 +360,50 @@ proc scaninfo {} { append result "," [lindex $l1 1] return [format "scaninfo = %s" $result] } - +#---------------------------------------------------------------------- +# wwwsics is a procedure which formats the most important status +# information for the WWW-status. +proc wwwsics {} { +#----- get all the data we need + set user [GetNum [user]] + set sample [GetNum [sample]] + set tit [GetNum [title]] + set ret [catch {lambda} msg] + if {$ret != 0 } { + set lam Undetermined + } else { + set lam [GetNum $msg] + } + set lscan [GetNum [lastscancommand]] + set svar [GetNum [scan getvars]] + set ind [string last -END- $svar] + if { $ind > 2 } { + set svar [string range $svar 0 $ind] + } else { + set svar " " + } + set res [scan info] + set l [split $res ,] + set fil [lindex $l 5] + set run [GetNum [sicsdatanumber]] + set stat [GetNum [status]] +#------- html format the reply + append result "" + append result + append result + append result + append result + append result + append result + append result + append result + append result + append result
    Run Number $run
    Title $tit
    User $user
    Sample $sample
    wavelength $lam
    Status $stat
    Scan Variables $svar
    File $fil
    Last Scan Command $lscan
    + return $result +} #===================== Syntactical sugar around scan =================== # center scan. A convenience scan for the one and only Daniel Clemens -# at TOPSI. Scans around a given ceter point. Requires the scan command +# at TOPSI. Scans around a given center point. Requires the scan command # for TOPSI to work. # # another convenience scan: diff --git a/tcl/wwwpulver.tcl b/tcl/wwwpulver.tcl new file mode 100644 index 00000000..407eee1b --- /dev/null +++ b/tcl/wwwpulver.tcl @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------ +# This implements the wwwsics command which generates a listing of +# important experiment parameters in html format for the SICS WWW Status +# application. This version is for the powder diffractometers DMC and +# HRPT. +# +# Mark Koennecke, March 2000 +#------------------------------------------------------------------------ +proc wwwsics {} { +#----- get all the data we need + set user [GetNum [user]] + set sample [GetNum [sample]] + set tit [GetNum [title]] + set ret [catch {lambda} msg] + if {$ret != 0 } { + set lam Undetermined + } else { + set lam [GetNum $msg] + } + set ret [catch {temperature} msg] + if {$ret != 0 } { + set tem Undetermined + } else { + set tem [GetNum $msg] + } + set run [GetNum [sicsdatanumber]] + catch {incr run} msg + set stat [GetNum [status]] +#------- html format the reply + append result "" + append result + append result + append result + append result + append result + append result + append result + append result
    Run Number $run
    Title $tit
    User $user
    Sample $sample
    wavelength $lam
    Sample Temperature $tem
    Status $stat
    + return $result +} + +#------------ install command +catch {Publish wwwsics Spy} msg diff --git a/telnet.c b/telnet.c index 4fbc8a47..ba483ff3 100644 --- a/telnet.c +++ b/telnet.c @@ -105,7 +105,14 @@ if(self->pCon->iEnd) { - return 0; + if(self->pCon->inUse > 0) + { + return 1; + } + else + { + return 0; + } } /* pop and execute */ @@ -136,11 +143,13 @@ pLogin = strstr(pPtr,self->pLoginWord); if(!pLogin) { - SCWrite(self->pCon,"------------------- Get Lost -------------------", - eError); + SCWrite(self->pCon, + "------------------- Get Lost -------------------", + eError); if(time(&shit) > self->tStart + LOGINWAIT) { - SCWrite(self->pCon,"I cannot stand your login attempts anymore!", + SCWrite(self->pCon, + "I cannot stand your login attempts anymore!", eError); NetReadRemove(pServ->pReader,self->pCon->pSock); self->pCon->iEnd = 1; @@ -161,7 +170,8 @@ sprintf(pBuffer,"SYSTEM ATTACK by %s / %s",pUser, pPasswd); SICSLogWrite(pBuffer,eInternal); - SCWrite(self->pCon,"I do not know you, I do not let you in",eError); + SCWrite(self->pCon, + "I do not know you, I do not let you in",eError); SendGA(self->pCon); free(pPtr); return 1; @@ -191,7 +201,14 @@ /* check for end */ if(self->pCon->iEnd) { - return 0; + if(self->pCon->inUse > 0) + { + return 1; + } + else + { + return 0; + } } return 1; diff --git a/test.tcl b/test.tcl index 6a5ede69..a3717b11 100644 --- a/test.tcl +++ b/test.tcl @@ -204,8 +204,8 @@ VarMake email Text User VarMake sample_mur Float User MakeDataNumber SicsDataNumber "$shome/sics/danu.dat" -InitSANS $shome/sics/sansdict.dic -#InitDMC +#InitSANS $shome/sics/sansdict.dic +InitDMC MakeScanCommand xxxscan counter topsi.hdd recover.bin MakePeakCenter xxxscan @@ -228,7 +228,8 @@ banana CountMode Timer banana init ClientPut "HM initialized" source $shome/sics/tcl/scancom.tcl -source $shome/sics/countf.tcl +#source $shome/sics/countf.tcl +source $shome/sics/tcl/count.tcl Publish count User Publish repeat user source $shome/sics/tcl/fit.tcl @@ -340,14 +341,14 @@ MakeFocusAverager average hm FocusInstall hm focus.dic $shome/sics/focusmerge.dat #MakeChopper choco docho lnsp20 4000 8 -MakeChopper choco sim +#MakeChopper choco sim #ChopperAdapter fermispeed choco chopper1.nspee 0 20000 #ChopperAdapter diskspeed choco chopper2.nspee 0 20000 #ChopperAdapter phase choco chopper2.nphas 0 90. #ChopperAdapter ratio choco chopper2.ratio 0 6. -ChopperAdapter diskspeed choco speed 0 20000 -ChopperAdapter phase choco phase 0 90. -ChopperAdapter ratio choco ratio 0 6. +#ChopperAdapter diskspeed choco speed 0 20000 +#ChopperAdapter phase choco phase 0 90. +#ChopperAdapter ratio choco ratio 0 6. source chosta.tcl Publish chosta Spy diff --git a/topsi.hdd b/topsi.hdd index 28c45d4d..c8686d07 100644 --- a/topsi.hdd +++ b/topsi.hdd @@ -15,4 +15,5 @@ Zero STL = !!ZERO(STL)!! Zero STU = !!ZERO(STU)!! Zero SGL = !!ZERO(SGL)!! Zero SGU = !!ZERO(SGU)!! +!!SCANZERO!! **************************** DATA ****************************************** diff --git a/ufortify.h b/ufortify.h index f842a1fa..148b570e 100644 --- a/ufortify.h +++ b/ufortify.h @@ -21,9 +21,9 @@ #define FILL_ON_FREE /* free'd memory is cleared */ #define FILL_ON_FREE_VALUE 0xA9 /* Value to de-initialize with */ -/* #define CHECK_ALL_MEMORY_ON_MALLOC #define CHECK_ALL_MEMORY_ON_FREE +/* #define PARANOID_FREE */