Reflection files format: Difference between revisions

 
Line 202: Line 202:
<pre>
<pre>
! reads cell, column labels, comment, and reflection data from LCF file - Kay Diederichs 7/2019 .  
! reads cell, column labels, comment, and reflection data from LCF file - Kay Diederichs 7/2019 .  
! TODO - determine offset from data in file
! Nota bene - symmetry i.e. space group seemingly not stored in LCF file  
! Nota bene - symmetry i.e. space group seemingly not stored in LCF file  
! reading VAX format is easy with the ifort compiler since it understands VAX REAL format:
! reading VAX format is easy with the ifort compiler since it understands VAX REAL format:
Line 215: Line 214:


! program variables
! program variables
INTEGER :: i,offset
INTEGER :: i
CHARACTER :: string*120
CHARACTER :: string*120


i=COMMAND_ARGUMENT_COUNT()
i=COMMAND_ARGUMENT_COUNT()
IF (i/=2) STOP 'usage: lcf_dump <name.LCF> offset'
IF (i/=1) STOP 'usage: lcf_dump <name.LCF>'
! read command line
! read command line
CALL GET_COMMAND_ARGUMENT(1,string)  ! expects LCF filename on command line
CALL GET_COMMAND_ARGUMENT(1,string)  ! expects LCF filename on command line
Line 226: Line 225:
OPEN(1,FILE=string,ACCESS='STREAM',ACTION='READ',CONVERT='VAXG')
OPEN(1,FILE=string,ACCESS='STREAM',ACTION='READ',CONVERT='VAXG')
WRITE(*,*) 'LCF file: ',TRIM(string)
WRITE(*,*) 'LCF file: ',TRIM(string)
CALL GET_COMMAND_ARGUMENT(2,string)  ! expects OFFSET
READ(string,*) offset
WRITE(*,*) 'offset:',offset


! read header and cell
! read header and cell
Line 255: Line 250:
! read column labels and comment
! read column labels and comment
string=''
string=''
DO i=1,(offset-124)/16
DO i=1,(header(8)+3)/4
   READ(1)string(1+(i-1)*4:i*4),separator
   READ(1)string(1+(i-1)*4:i*4),separator
END DO
END DO
1,328

edits