LANL Home  |  Phone
 

Importing and Exporting data with SOLVE

IMPORT and EXPORT are utilities to bring formatted data into dorgbn format and to write out formatted data without titles. BTOF and FTOB write out and read formatted data with titles. Also DRGTOXPLOR converts from some dorgbn files to XPLOR-style files.

FFTTOEZD and FFTTOMAPVIEW convert from the binary format for maps to the formatted NEWEZD or binary MAPVIEW (PHASES) formats.

 

IMPORT

The routine IMPORT has several options. You can simply read the data from a formatted file in, assuming it is h,k,l, and columns of data. You can also swap indices (as H->K, K->L, L->K) as you read it in. You can also sort the data and map it to the asymmetric unit of the space group. Ordinarily you will want to sort and map the data, as some of the other routines in the package (notably FILEMERGE) assume that the data has been sorted in a particular order of hkl. When you sort the data, the program asks if any columns are to be interpreted in terms of phases in degrees. Such data has to be correctly adjusted when it is mapped to the asymmetric unit used by SOLVE. If the data has not yet been merged to the asymmetric unit and you are about to scale the data with localscale, then you may not want to sort and map the data now. If you choose not to sort it now, then you must sort and map it with MERGE after running localscale so that filemerge can recognize the data.

When you IMPORT data, it is essential that the input file has the same number of data columns for every hkl in the file. You have two options for the format of the data in the input file.

(1) You can specify that there is exactly ONE line for each HKL record. In this case, the input file can have text in the middle of a data column which will be ignored.

(2) Alternatively, you can specify the exact number of data columns for each HKL record, in which case they can be spread over any number of lines. Data "columns" refer to the assumption that for each HKL in the data file, there are a fixed number of "columns" of associated data.

That is, if your data file looks like:

 -3  -5  9   300.39 1.6 420.3 1.5
        265.9 5.6 991.2
         0.2
 -3  -5 10   225.35 2.5 413.1 3.4
           441.9 3.4 114.2 0.25

then the HKL are (-3, -5, 9) and (-3,-5,10). For the record with HKL=(-3,-5,9) the data columns are 300.39, 1.6, 420.3, etc... In this case you can use option (2), specifying that there are 8 data columns for each HKL. You can not use option (1) for this data file because the data for each hkl are not on a single line.

The commands for IMPORTing data are:

1. Input formatted data file name (the program will then type the first 3 lines of the file as read in, and then again after stripping off any text)

2. Option (1) or option (2)

3. Output dorgbn-style file name

4. Overall title for output file

5. Number of columns of data (not counting h,k,l) in input file

6a...Title for each of these columns of data

7. Overall scale factor to apply to all data

8. lsort: 'y' to sort and map data, 'n' to leave it as is

9. lswap: 'y' to swap indices hkl [only read if lswap='y']:

8a. HNEW: index H will be mapped to HNEW. That is, if you want to map old H->new K, old K->new L, old L ->new K, then you specify HNEW = "K"

10. [only if you have said 'y' to #8, lsort] # of columns of data to interpret as phases in degrees.

11. column #'s to be interpreted as phases in degrees. Note: for equivalent reflections the phase varies depending on the associated translation.

12. dmin, dmax = resolution range to consider. All data outside of this range is ignored. Note: don't set the dmin much lower than you really want it or the routine will be very slow.

 

Sample IMPORT scripts

 

!-------Import script: formatted datafile with 2 data columns on one line-----
IMPORT
infile.dat
1,        !  option 1 = one line per record
output.drg
Output data after infile.dat is converted to dorgbn-style file
2,        !  2 columns of data.
Fobs (title for column 1 of data)
Sigma (title for column 2 of data)
1.0,      ! overall scale factor = 1.0
y          ! Yes sort and map data
n         ! No, do not swap indices
0         ! don't interpret any columns as phases in degrees
3.5 50    ! resolution range to consider
!-----------------------------------------------------------------------------


!-------Import script: formatted datafile with 2 data columns on 2 lines -----
IMPORT
infile.dat
2,        !  option 2 = fixed # of data columns per record
output.drg
Output data after infile.dat is converted to dorgbn-style file
2,        !  2 columns of data.
Fobs (title for column 1 of data)
phase (title for column 2 of data)
1.0,      ! overall scale factor = 1.0
y          ! Yes sort and map data
n         ! No, do not swap indices
1         ! Interpret 1 column as phases in degrees
2         ! column 2 of data is to be interpreted as phases in
degrees
3.5 50    ! resolution range to consider
!----------------------------------------------------------------------------

 

EXPORT

 

Export is a lot easier than IMPORT. All it does is write out a formatted file with h k l and the contents of each column of data. Here is a sample script to run export:

!----------------------Sample script to run EXPORT----------------------------
INFILE  data.drg         !    input file name
OUTFILE data.export      !    output file name
export
!-----------------------------------------------------------------------------

 

Binary TO Format conversion (BTOF)

Format TO Binary conversion (FTOB)

 

These routines convert data in DORGBN-structured binary files to and from formatted files with titles. They are most useful for transferring data files from one computer system to another. A sample script for doing each is shown next:

!------------Script to convert from dorgbn -> formatted file ----------------
INFILE data.drg
OUTFILE data.fmt
BTOF
!----------------------------------------------------------------------------


!---Script to convert from formatted file with titles -> dorgbn file----------
INFILE data.fmt
OUTFILE data.drg
FTOB
!----------------------------------------------------------------------------

 

DORGBN files

 

The files used in this package are binary files with data sorted by hkl. Format of the binary (FORTRAN unformatted) data file:

record 1 INTEGER*4 NCOL - the number of columns of data in the file.

record 2 (LOGICAL*1) TITLE(80) - An overall title

records 3... NCOL more titles, one for each column of data.

record 4 Data records - IH,IK,IL,RES,(F(I),I=1,NCOL)

1. IH,IK,IL - INTEGER*4 The indices of the reflection.

2. RES - The d-spacing in Angstroms.

3. F(I) - Data. These can be structure factors, sigmas, phase information stored as phase, figure-of-merit, etc. When data are missing for one or more columns the value -1.0 is stored in the appropriate columns.

 

DRGTOXPLOR

The routine DRGTOXPLR writes out X-PLOR format file with INDIC, FOBS, SIGMA based on data in a DORGBN-style file. Here is a sample script:

 

!---------------------Script for DRGTOXPLOR ---------------------------------
INFILE  data.drg
OUTFILE  data.xplor
NXPLORF  1               ! column 1 of data.drg is F
NXPLORSIG 2              ! column 2 of data.drg is Sigma of F
DRGTOXPLOR
!----------------------------------------------------------------------------

FFTtoEZD and FFTtoCCP4 and FFTtoMAPVIEW

FFTTOEZD

FFTTOEZD is a routine that converts an asymmetric unit of an FFT in the UCLA FFT format to any region of the map in the newezd format suitable for reading right into "O". This routine is applicable to Fourier maps, but can be used with Patterson maps as long as the output region is contained within the input FFT.

The output map is calculated using the same grid as the input FFT, but the endpoints in x,y, and z can be different. The grid points in x and y must not be more negative than -512 or greater than 512. The program generates the entire unit cell from the input FFT if the endpoints of the output EZD map are not contained within the input FFT. For Patterson maps, the output EZD map MUST be contained within the calculated FFT (i.e, no expansion is allowed).

The output map is scaled so that the rms value of the map is 1.0.

If you are in "O" and want to read in and display "fourier.ezd" all you need to type is:

@fourier.ezd
ezd_draw
<cr>
<cr>

 

Script file for converting from FFT to EZD

 

!-----------Script for conversion from UCLA FFT format to EZD ---------
@solve.setup                 !standard parameters for this dataset
fftfile fourier.fft          ! input FFT file
bossfile fourier.ezd          ! output EZD file
fourier                      ! this is a fourier, not a patterson
ezdgrid -35 37 -23 96 5 23  ! Output grid covers region from -35 to 37
                             ! in x (on the same grid that the fourier was
                             ! calculated with)
ffttoezd
!------------------------------------------------------------------------

Keywords for FFTTOEZD

 

FFTFILE   xx      name of FFT-containing file
EZDMAPFILE   xx      name of output EZD format file 
FILETITLE xxx      optional title for file
PATTERSON       this is a Patterson map
FOURIER         this is a fourier map
EZDGRID   ixstart ixend iystart iyend izstart izend -- these are
                  starting and ending grid units on the PATTGRID
                  or FFTGRID you have specified.

FFTTOCCP4

FFTTOCCP4is a routine that converts an asymmetric unit of an FFT in the UCLA FFT format to CCP4 map format. The region defined by FFTGRID is output

Keywords for FFTTOCCP4

 

FFTFILE   xx      name of FFT-containing file
CCP4MAPFILE   xx      name of output EZD format file 

FFTTOMAPVIEW

FFTTOMAPVIEW is a routine that converts an asymmetric unit of an FFT in the UCLA FFT format to a format compatible with the PHASES package. This is useful for displaying the map using MAPVIEW in the PHASES package.

Note: this routine is only valid on an SGI machine.

The output map is calculated using the same grid as BOSS-style output maps. This grid may be set with the keyword BOSSGRID. The output map range of grid points must be contained, for x and y, between -512 and 512. For Pattersons, this grid must be contained within the FFT grid, set with FFTGRID

Script file for FFTTOMAPVIEW

!---------------Script for conversion of UCLA FFT to MAPVIEW format--------
!  Note:  this only works on an SGI
@solve.setup                 ! standard information for this dataset
fftfile fourier.fft          ! input fft file
mapviewfile fourier.mapview  ! output mapviewfile for PHASES
fourier                      ! this is a fourier, not a patterson
bossgrid -35 37 -23 96 5 23  ! Output grid covers region from -35 to 37
                             ! in x (on the same grid that the fourier was
                             ! calculated with)
ffttomapview
!----------------------------------------------------------------------------

 

Keywords for FFTTOMAPVIEW

FFTFILE   xx      name of FFT-containing file
MAPVIEWFILE xx    name of output MAPVIEW format file
PATTERSON       this is a Patterson map
FOURIER         this is a fourier map
BOSSGRID  ixstart ixend iystart iyend izstart izend -- these are
                  starting and ending grid units on the PATTGRID
                  or FFTGRID you have specified.

Disclaimer

Operated by Los Alamos National Security, LLC for the U.S. Department of Energy's NNSA

Inside | © Copyright 2006 Los Alamos National Security, LLC All rights reserved | Disclaimer/Privacy | Web Contact