write_h {crone} | R Documentation |
Write structure factors to a reflections file
Description
This function writes standardised structure factors data into an ASCII file. The files includes cell size, space group character symbol and Miller indices vector. It can include all of some of observed and/or calculated structure factors amplitudes and phases, either for anomalous or non-anomalous data.
Usage
write_h(filename, fdata)
Arguments
filename |
A character string. Prefix of the structure factors file name. The file name has the form "[prefix]_h.dat". |
fdata |
A names list, usually created with functions
|
Value
This function does not return anything, but will create an ASCII file of name *_h.dat which contains structure factors and other type of information.
Examples
# Data from thiocyanate structure
datadir <- system.file("extdata",package="crone")
filename <- file.path(datadir,"thiocyanate_x.dat")
sdata <- read_x(filename)
# Miller indices
hidx <- 1:10
# Observed structure factors with errors
ltmp <- sfobs(hidx,sdata)
Fobs <- ltmp$F
sigFobs <- ltmp$sF
# Phases from calculated structure factors
ftmp <- strufac(hidx,sdata)
phicalc <- ftmp$Fpha
# Create standardised fdata structure
fdata <- standardise_fdata(sdata$a,sdata$SG,hidx,Fobs=Fobs,
sigFobs=sigFobs,Phicalc=phicalc)
# Name of structure factors file (in temporary directory)
wd <- tempdir()
fname <- file.path(wd,"test")
# Write data to file
write_h(fname,fdata)