c presently works by finding "film output file" which is after 'oscillation starts" c in region before fitting, c Then find "Oscillation starts" in calculate-go cycle, which is before the c rest of the parameters, then find each parameter in turn. "Spots Refined" c or "Partiality refined" signifies the end, so write output. 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,cellb,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,*)' for format of first (BART) DENZO. Version 940623.' 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',carriagecontrol='list') open(unit=9,file='bc.prm',status='new',recl=180, $ carriagecontrol='list') write(9,17) write(6,19) 17 format(' Image Phi0 xerr yerr perr crysx crysy ' $ ' crysz cella cellb ', $ 'cellc beamx beamy rados angos xfx xfy xfxy', $ ' skew yscale') 19 format(' Image Phi0 xerr yerr perr crysx crysy ' $ ' crysz cella cellb ', $ 'cellc beamx') c17 format(' Image Osc.start x-err y-err p-err crysx crysy ' c $ ' crysz cella ', c $ 'cellc beamx beamy rados angos xfx xfy xfxy', c $ ' skew yscale') c19 format(' Image Osc.start x-err y-err p-err crysx crysy ' c $ ' crysz cella cellb cellc ') 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(: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''' ccccc imagefile='''a:'//imagefile i=index(imagefile,'.')-2 base=imagefile(:i+1) number=imagefile(i:i+1) c write(6,*)rflfile,'xx',number 40 read(2,31) line if (line(:14).ne.'Oscillation st') goto 40 c write(6,*) line decode(80,43,line) oscstrt c43 format(22x,f7.2) 43 format(21x,f8.4) cOscillation starts at-0.40000 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 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 c if (line(:12).ne.'Scanner skew') goto 44 if (line(:11).ne.'Scaner skew') goto 44 decode(80,119,line) skew c write(6,*) line,skew c119 format( 16x,f12.5) 119 format( 15x,f12.5) cY scale (relative to X scale) 1.0000 cScaner skewness 0.00000E+00 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 goto 50 c no crossfire, offset in old denzo 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 goto 100 c no crossfire, offset in old denzo 94 read(2,31) line if (line(13:18).ne.'radial') goto 94 if (line(29:33).eq.'shift') then decode(80,95,line) rados else decode(80,955,line) rados endif c write(6,*) line,rados 95 format( 18x,f9.3) 955 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 if (line(30:34).eq.'shift') then decode(80,105,line) angos 105 format( 19x,f9.3) else decode(80,1055,line) angos 1055 format( 19x,f12.3) endif c write(6,*) line,angos cMAR offset, angular-2.00000E-02 cMAR offset, angular -0.112 shift -0.092 error 0.074 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 100 read(2,31) line if (line(:10).ne.'Real space') goto 100 c write(6,*) line decode(80,101,line) cella,cellb,cellc 101 format( 23x,f7.2,5x,f7.2,5x,f7.2) cReal space unit cell, a 217.41 b 217.41 c 378.15 c123456789012345678901234567890123456789012345678901234567890 c0000000001111111111222222222233333333334444444444 102 read(2,31) line c if (line(:13).ne.'spots refined') goto 102 if (line(2:13).ne.'pots refined') goto 102 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 read(2,31) line if (line(:13).eq.'partiality re') then decode(80,41,line) pe 41 format(41x,f7.2) else if (line(:13).eq.'Partiality re') then decode(80,42,line) pe 42 format(39x,f7.2) endif outname='bci'//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)'a:'//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) c write(3,131)cella,cellc c131 format(' unit cell ',f8.3,' a ',f8.3,' 90. 90. 120.') write(3,131)cella,cellb,cellc 131 format(' unit cell ',f8.3,f8.3,f8.3,' 90. 90. 90.') 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) c for hex, tetrag space group: c write(9,141) rflfile(:8),oscstrt,xe,ye,pe,crysx,crysy,crysz, c $ cella,cellc,beamx,beamy,rados,angos,xfx,xfy,xfxy,skew,yscale c for orthorhombic write(9,141) imagefile(:8),oscstrt,xe,ye,pe,crysx,crysy,crysz, $ cella,cellb,cellc,beamx,beamy,rados,angos,xfx,xfy,xfxy, $ skew,yscale write(6,141) imagefile(:8),oscstrt,xe,ye,pe,crysx,crysy,crysz, $ cella,cellb,cellc,beamx c141 format(a10,f7.2, 3f6.2,3f8.3,2f7.2,2f8.3,5f7.3,2f8.5) 141 format(a10,f6.1, 3f5.1,3f7.2,3f7.2,2f7.3,5f6.3,2f8.5) goto 30 200 close (unit=2) close (unit=4) close (unit=9) end 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