c Better concept of the structure of log file: c Each image begins with the line: INPUT XXXX c Each cycle of refinement ends with "SPOTS REFINED" C or, if present, "PARTIALITY REF-" c Non-refined parameters are listed before first cycle and c within calculate go cycle. c If .dat file only has one GO, after calculate, then c there is only one cylce of refinement, some param c such as y-scale and skew are only given before c film output file, so get missed. character*132 line character*40 flname,outname,imagefile,rflfile character*2 number character*10 base real*4 crysx,crysy,crysz,cella,cellc,beamx,beamy,oscstrt WRITE(6,*)'PROGRAM TO EXTRACT FITTED PARAM FROM DENZO OUTPUT' WRITE(6,*)' AND PUT THEM INTO DENZO INPUT FILES. 920627' WRITE(6,*)'EXTRACTED PARAM WRITTEN TO .DA2 FILE FOR EACH IMAGE' WRITE(6,*)' COMBine.COM COPIES THESE WITH TEMPLATE.DA2 TO BCXX.DA2.' WRITE(6,*)'EXTRACTED PARAM ALSO WRITTEN TO SUMMARY TABLE NAMED BC.PRM' WRITE(6,*) write(6,*)' Enter name of denzo log file:' read(5,11) flname 11 format(a40) open(unit=2,file=flname,status='old',recl=132) c write(6,*)' Enter name for output file:' c read(5,11) outname open(unit=4,file='comb.com',status='new') open(unit=9,file='bc.prm',status='new',recl=180) write(9,17) write(6,19) 17 format(' Image Osc.start x-err y-err p-err crysx crysy ' $ ' crysz cella ', $ 'cellb beamx beamy rados angos xfx xfy xfxy', $ ' skew yscale') 19 format(' Image Osc.start x-err y-err p-err crysx crysy ' $ ' crysz cella ') 30 read(2,31,end=200) line 31 format(a132) c if (line(:8).ne.'Raw data') goto 30 c write(6,*) line c imagefile=line(17:) c rflfile=imagefile(:index(imagefile,'.'))//'ou2' c i=index(imagefile,'_')+2 c number=imagefile(i:i+1) if (line(:21).eq.'type good intns') then write(6,*) line write(9,*) line do 33 i=1,3 read(2,31) line write(6,*) line 33 write(9,*) line endif if (line(:8).ne.'Film out') goto 30 imagefile=line(20:) cFilm output file : bc29_001.out rflfile=imagefile(:index(imagefile,'.'))//'ou2' imagefile=imagefile(:index(imagefile,'.'))//'image''' imagefile='''[berry.dat]'//imagefile i=index(imagefile,'_')+2 base=imagefile(:i+1) number=imagefile(i:i+1) write(6,*)rflfile,'xx',number c35 read(2,31) line c if (line(:13).ne.'spots refined') goto 35 c write(6,*) line 40 read(2,31) line if (line(:13).eq.'spots refined') then c write(6,*) line decode(80,351,line)xe,ye 351 format(36x,f7.2,2x,f7.2) c write(6,*)'xe,ye:',xe,ye else if (line(:13).eq.'partiality re') then decode(80,41,line) pe 41 format(41x,f7.2) endif if (line(:14).ne.'Oscillation st') goto 40 write(6,*) line decode(80,43,line) oscstrt 43 format(22x,f7.2) 46 read(2,31) line if (line(:7).ne.'Y scale') goto 46 decode(80,115,line) yscale c write(6,*) line,yscale 115 format( 29x,f9.5) 44 read(2,31) line if (line(:12).ne.'Scanner skew') goto 44 decode(80,119,line) skew c write(6,*) line,skew 119 format( 16x,f12.5) cY scale (relative to X scale) 1.0000 cScaner skewness 0.00000E+00 cCrossfire y 4.10000E-02 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 cCrossfire x-1.90000E-02 cCrossfire xy-4.00000E-03 cCrossfire y 0.014 shift -0.006 error 0.122 cCrossfire x 0.009 shift 0.001 error 0.065 cCrossfire xy 0.003 shift -0.009 error 0.129 82 read(2,31) line if (line(:11).ne.'Crossfire y') goto 82 if (line(22:26).eq.'shift') then decode(80,107,line) xfy else decode(80,108,line) xfy endif c write(6,*) line,xfy 107 format( 11x,f9.3) 108 format( 11x,f12.3) 84 read(2,31) line if (line(:11).ne.'Crossfire x') goto 84 if (line(22:26).eq.'shift') then decode(80,109,line) xfx else decode(80,110,line) xfx endif c write(6,*) line,xfx 109 format( 11x,f9.3) 110 format( 11x,f12.3) 86 read(2,31) line if (line(:12).ne.'Crossfire xy') goto 86 if (line(23:27).eq.'shift') then decode(80,112,line) xfxy else decode(80,113,line) xfxy endif c write(6,*) line,xfxy 112 format( 12x,f9.3) 113 format( 12x,f12.3) 50 read(2,31) line if (line(:5).ne.'CrysZ') goto 50 c write(6,*) line decode(80,51,line) crysz 51 format(22x,f8.3) 60 read(2,31) line if (line(:5).ne.'CrysY') goto 60 c write(6,*) line decode(80,51,line) crysy 70 read(2,31) line if (line(:5).ne.'CrysX') goto 70 c write(6,*) line decode(80,51,line) crysx 80 read(2,31) line if (line(:6).ne.'X beam') goto 80 c write(6,*) line decode(80,81,line) beamx 81 format( 14x,f8.3) 90 read(2,31) line if (line(:6).ne.'Y beam') goto 90 c write(6,*) line decode(80,81,line) beamy 94 read(2,31) line if (line(13:18).ne.'radial') goto 94 if (line(29:33).eq.'shift') then decode(80,102,line) rados else decode(80,1025,line) rados endif c write(6,*) line,rados 102 format( 18x,f9.3) 1025 format( 18x,f12.3) c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 cY beam coord 88.799 shift 0.001 error 0.020 cMAR offset, radial -0.230 shift 0.000 error 0.028 cMAR offset, radial 0.00000E+00 96 read(2,31) line if (line(13:19).ne.'angular') goto 96 decode(80,105,line) angos c write(6,*) line,angos 105 format( 20x,f8.3) 100 read(2,31) line if (line(:10).ne.'Real space') goto 100 c write(6,*) line decode(80,101,line) cella,cellc 101 format( 23x,f7.2,17x,f7.2) outname='bc'//number//'.da2' open(unit=3,file=outname,status='new',carriagecontrol='list') write(3,103) 103 format('INTERACTIVE') write(3,104) 104 format('FORMAT MAR') write(3,106)imagefile 106 format(' raw data file ',a40) write(3,111)rflfile 111 format(' film output file ',a40) write(3,114)oscstrt 114 format(' oscillation start ',f8.2) write(3,116) beamx 116 format(' X BEAM ',F8.2) write(3,117) beamy 117 format(' Y BEAM ',F8.2) write(3,121)crysx,crysy,crysz 121 format(' crystal rotx ',f8.3,' roty ',f8.3,' rotz ',f8.3) write(3,131)cella,cellc 131 format(' unit cell ',f8.3,' a ',f8.3,' 90. 90. 120.') write(3,151) rados,angos 151 format('radial offset',f8.3,' angular offset',f8.3) write(3,161) xfx,xfy,xfxy 161 format('crossfire x',f8.3,' y',f8.3,' xy',f8.3) write(3,171) skew 171 format('skew ',f9.5) write(3,181) yscale 181 format('Y scale',f9.5) close (unit=3) write(4,*)'$copy '//outname(:8)//'+template.da2 '//outname(:8) write(9,141) rflfile(:8),oscstrt,xe,ye,pe,crysx,crysy,crysz, $ cella,cellc,beamx,beamy,rados,angos,xfx,xfy,xfxy,skew,yscale write(6,141) rflfile(:8),oscstrt,xe,ye,pe,crysx,crysy,crysz, $ cella,cellc c ,beamx,beamy,rados,angos,xfx,xfy,xfxy,skew,yscale 141 format(a10,f7.2, 3f6.2,3f8.3,2f7.2,2f8.3,5f7.3,2f8.5) goto 30 200 close (unit=2) close (unit=4) close (unit=9) end c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 ctype good intns ovfl weak overlap backgr ovfl others total outside remeasured cpartials 1128 0 0 2444 0 7 3579 0 3579 cwhole 1057 0 0 5028 0 0 6085 0 6085 ctotal 2185 0 0 7472 0 7 9664 0 9664 cRaw data file : bc26_001.image cSpots refined: 996 Chi**2/#refl: X 2.27 Y 2.56 Pred. decrease: 0.009 * 996 = 9.0 cSpot to weak for refiment when below sigma * 3.0000 cCrystal (mis)orientation angles: cCrysZ (beam) axis -68.489 shift -0.001 error 0.024 cCrysY (vertical) axis -30.990 shift 0.014 error 0.022 cCrysX (spindle) axis 26.003 shift 0.014 error 0.021 cCassette (mis)orientation angles: cCassZ (beam) axis 180.00 cCassY (vertical) axis 0.00000E+00 cCassX (spindle) axis 0.00000E+00 cFilm to crystal distance 350.00 cFilm rotation inside cassette 0.00000E+00 cX beam coord 90.693 shift 0.001 error 0.021 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 cY beam coord 88.799 shift 0.001 error 0.020 cMAR offset, radial -0.230 shift 0.000 error 0.028 cMAR offset, radial 0.00000E+00 cMAR offset, angular 0.00000E+00 cReal space unit cell, a 217.41 b 217.41 c 378.15 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 c