Exclude data range from XDS ASCII.HKL

From XDSwiki
Revision as of 15:10, 3 July 2019 by Kay (talk | contribs) (Created page with "This is a jiffy (binaries for [ftp://turn5.biologie.uni-konstanz.de/pub/linux_bin/exclude_data_range_from_XDS_ASCII.HKL Linux] and [ftp://turn5.biologie.uni-konstanz.de/pub/ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is a jiffy (binaries for Linux and Mac) that removes reflections of a given frame range. The first and last frame of the range must be input. The program reads XDS_ASCII.HKL and writes XDS_ASCII.HKL.exclude_data_range . If several frame ranges should be removed, the program can be run repeatedly - but of course then the files must be renamed.

! purpose: remove data on bad frames (identified e.g. by xdscc12) from XDS_ASCII.HKL
! Kay Diederichs July 3, 2019
PROGRAM main
      CHARACTER line*512
      INTEGER inunit,outunit,first,last,ier,ih,ik,il
      REAL intensity,sigma,xd,yd,zd
      
      OPEN(NEWUNIT=inunit,FILE='XDS_ASCII.HKL',STATUS='old',ACTION='READ')
      PRINT*,'first and last frame of range that should be excluded?'
      READ*,first,last
      OPEN(NEWUNIT=outunit,FILE='XDS_ASCII.HKL.exclude_data_range',STATUS='unknown',ACTION='WRITE')

! copy only lines that either cannot be read, or where ZD < first or ZD > last
      DO
        READ(inunit,'(a)',end=99)line
        READ(line,*,iostat=ier) ih,ik,il,intensity,sigma,xd,yd,zd
        IF (ier==0 .AND. zd>=first .AND. zd<=last) CYCLE 
        WRITE(outunit,'(a)') TRIM(line)
      END DO
   99 STOP
END PROGRAM main