Package diffpy :: Package pdffit2 :: Module pdffit :: Class PdfFit
[hide private]
[frames] | no frames]

Class PdfFit

source code

object --+
         |
        PdfFit

Create PdfFit object.

Instance Methods [hide private]
 
_exportAll(self, namespace)
_exportAll(self, namespace) --> Export all 'public' class methods into namespace.
source code
 
add_structure(self, stru)
add_structure(stru) --> Add new structure to PdfFit instance.
source code
 
read_struct(self, struct)
read_struct(struct) --> Read structure from file into memory.
source code
 
read_struct_string(self, struct, name='')
read_struct_string(struct, name = "") --> Read structure from a string into memory.
source code
 
read_data(self, data, stype, qmax, qdamp)
read_data(data, stype, qmax, qdamp) --> Read pdf data from file into memory.
source code
 
read_data_string(self, data, stype, qmax, qdamp, name='')
read_data_string(data, stype, qmax, qdamp, name = "") --> Read pdf data from a string into memory.
source code
 
read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name='list')
read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = None, name = "list") --> Read pdf data into memory from lists.
source code
 
pdfrange(self, iset, rmin, rmax)
pdfrange(iset, rmin, rmax) --> Set the range of the fit.
source code
 
reset(self)
reset() --> Clear all stored fit, structure, and parameter data.
source code
 
alloc(self, stype, qmax, qdamp, rmin, rmax, bin)
alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space for a PDF calculation.
source code
 
calc(self)
calc() --> Calculate the PDF of the imported structure.
source code
 
refine(self, toler=1e-08)
refine(toler = 0.00000001) --> Fit the theory to the imported data.
source code
 
refine_step(self, toler=1e-08)
refine_step(toler = 0.00000001) --> Run a single step of the fit.
source code
 
save_pdf(self, iset, fname)
save_pdf(iset, fname) --> Save calculated or fitted PDF to file.
source code
 
save_pdf_string(self, iset)
save_pdf_string(iset) --> Save calculated or fitted PDF to string.
source code
 
save_dif(self, iset, fname)
save_dif(iset, fname) --> Save data and fitted PDF difference to file.
source code
 
save_dif_string(self, iset)
save_dif_string(iset) --> Save data and fitted PDF difference to string.
source code
 
save_res(self, fname)
save_res(fname) --> Save fit-specific data to file.
source code
 
save_res_string(self)
save_res_string() --> Save fit-specific data to a string.
source code
 
get_structure(self, ip)
get_structure(ip) --> Get a copy of specified phase data.
source code
 
save_struct(self, ip, fname)
save_struct(ip, fname) --> Save structure resulting from fit to file.
source code
 
save_struct_string(self, ip)
save_struct(ip) --> Save structure resulting from fit to string.
source code
 
show_struct(self, ip)
show_struct(ip) --> Print structure resulting from fit.
source code
 
constrain(self, var, par, fcon=None)
constrain(var, par[, fcon]) --> Constrain a variable to a parameter.
source code
 
setpar(self, par, val)
setpar(par, val) --> Set value of constrained parameter.
source code
 
setvar(self, var, val)
setvar(var, val) --> Set the value of a variable.
source code
 
getvar(self, var)
getvar(var) --> Get stored value of a variable.
source code
 
getrw(self)
getrw() --> Get normalized total error of the fit rw.
source code
 
getcrw(self)
getcrw() --> Get cumulative Rw for the current dataset.
source code
 
getR(self)
getR() --> Get r-points used in the fit.
source code
 
getpdf_fit(self)
getpdf_fit() --> Get fitted PDF.
source code
 
getpdf_obs(self)
getpdf_obs() --> Get observed PDF.
source code
 
getpdf_diff(self)
Obtain difference between observed and fitted PDF.
source code
 
get_atoms(self, ip=None)
get_atoms() --> Get element symbols of all atoms in the structure.
source code
 
get_atom_types(self, ip=None)
get_atom_types() --> Ordered unique element symbols in the structure.
source code
 
getpar(self, par)
getpar(par) --> Get value of parameter.
source code
 
fixpar(self, par)
fixpar(par) --> Fix a parameter.
source code
 
freepar(self, par)
freepar(par) --> Free a parameter.
source code
 
setphase(self, ip)
setphase(ip) --> Switch to phase ip.
source code
 
setdata(self, iset)
setdata(iset) --> Set the data set in focus.
source code
 
psel(self, ip)
psel(ip) --> Include phase ip in calculation of total PDF
source code
 
pdesel(self, ip)
pdesel(ip) --> Exclude phase ip from calculation of total PDF.
source code
 
selectAtomType(self, ip, ijchar, symbol, flag)
Configure partial PDF - mark the specified atom type in phase ip as included or excluded as a first or second in pair for distance evaluation.
source code
 
selectAtomIndex(self, ip, ijchar, aidx, flag)
Configure partial PDF - mark the atom of given index in phase ip as included or excluded as a first or second in pair for distance evaluation.
source code
 
selectAll(self, ip, ijchar)
Configure partial PDF - include all atoms of phase ip as first or second element in pair for distance evaluation.
source code
 
selectNone(self, ip, ijchar)
Configure partial PDF - exclude all atoms of phase ip from first or second element of pair distance evaluation.
source code
 
bang(self, i, j, k)
bang(i, j, k) --> Show bond angle defined by atoms i, j, k.
source code
 
bond_angle(self, i, j, k)
bond_angle(i, j, k) --> bond angle defined by atoms i, j, k.
source code
 
blen(self, *args)
blen(i, j) --> Show bond length defined by atoms i and j.
source code
 
bond_length_atoms(self, i, j)
bond_length_atoms(i, j) --> shortest distance between atoms i, j.
source code
 
bond_length_types(self, a1, a2, lb, ub)
bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances.
source code
 
show_scat(self, stype)
show_scat(stype) --> Print scattering length for all atoms in the current phase.
source code
 
get_scat_string(self, stype)
get_scat_string(stype) --> Get string with scattering factors of all atoms in the current phase.
source code
 
get_scat(self, stype, element)
get_scat(stype, element) --> Get active scattering factor for given element.
source code
 
set_scat(self, stype, element, value)
set_scat(stype, element, value) --> Set custom scattering factor for given element.
source code
 
reset_scat(self, element)
reset_scat(stype, element) --> Reset scattering factors for given element to their standard values.
source code
 
num_atoms(self)
num_atoms() --> Get number of atoms in current phase.
source code
 
num_phases(self)
num_phases() --> Number of phases loaded in PdfFit instance.
source code
 
num_datasets(self)
num_datasets() --> Number of datasets loaded in PdfFit instance.
source code
 
phase_fractions(self)
phase_fractions() --> relative phase fractions for current dataset.
source code
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__getRef(self, var_string)
Return the actual reference to the variable in the var_string.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
intro()
Show introductory message.
source code
 
lat(n)
lat(n) --> Get reference to lattice variable n.
source code
 
x(i)
x(i) --> Get reference to x-value of atom i.
source code
 
y(i)
y(i) --> Get reference to y-value of atom i.
source code
 
z(i)
z(i) --> Get reference to z-value of atom i.
source code
 
u11(i)
u11(i) --> Get reference to U(1,1) for atom i.
source code
 
u22(i)
u22(i) --> Get reference to U(2,2) for atom i.
source code
 
u33(i)
u33(i) --> Get reference to U(3,3) for atom i.
source code
 
u12(i)
u12(i) --> Get reference to U(1,2) for atom i.
source code
 
u13(i)
u13(i) --> Get reference to U(1,3) for atom i.
source code
 
u23(i)
u23(i) --> Get reference to U(2,3) for atom i.
source code
 
occ(i)
occ(i) --> Get reference to occupancy of atom i.
source code
 
pscale()
pscale() --> Get reference to pscale.
source code
 
sratio()
sratio() --> Get reference to sigma ratio.
source code
 
delta1()
delta1() --> Get reference to 1/R peak sharpening factor.
source code
 
delta2()
delta2() --> Reference to (1/R^2) sharpening factor.
source code
 
dscale()
dscale() --> Get reference to dscale.
source code
 
qdamp()
qdamp() --> Get reference to qdamp.
source code
 
qbroad()
qbroad() --> Get reference to qbroad.
source code
 
spdiameter()
spdiameter() --> Get reference to spdiameter (phase property).
source code
 
stepcut()
stepcut() --> Get reference to stepcut (phase property).
source code
 
rcut()
rcut() --> Get reference to rcut.
source code
Class Variables [hide private]
  selalias = {'ALL': -1}
  FCON = {'FCOMP': 2, 'FSQR': 3, 'IDENT': 1, 'USER': 0}
  Sctp = {'N': 1, 'X': 0}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_exportAll(self, namespace)

source code 
_exportAll(self, namespace) --> Export all 'public' class methods
    into namespace.

This function allows for a module-level PdfFit object which doesn't have
to be referenced when calling a method. This function makes old (python)
scripts compatible with this class. At the top of the script, create a
pdffit object, and then call this method. Usually, namespace = locals().

add_structure(self, stru)

source code 
add_structure(stru) --> Add new structure to PdfFit instance.

stru -- instance of Structure class from diffpy.Structure.

No return value.
Raises pdffit2.structureError when stru contains unknown
atom species.

read_struct(self, struct)

source code 
read_struct(struct) --> Read structure from file into memory.

struct  -- name of file from which to read structure

Raises:
    pdffit2.calculationError when a lattice cannot be created from the
    given structure
    pdffit2.structureError when a structure file is malformed
    IOError when the file cannot be read from the disk

read_struct_string(self, struct, name='')

source code 
read_struct_string(struct, name = "") --> Read structure from
a string into memory.

struct  -- string containing the contents of the structure file
name    -- tag with which to label structure

Raises:
    pdffit2.calculationError when a lattice cannot be created from the
    given structure
    pdffit2.structureError when a structure file is malformed

read_data(self, data, stype, qmax, qdamp)

source code 
read_data(data, stype, qmax, qdamp) --> Read pdf data from file into
memory.

data    -- name of file from which to read data
stype   -- 'X' (xray) or 'N' (neutron)
qmax    -- Q-value cutoff used in PDF calculation.
           Use qmax=0 to neglect termination ripples.
qdamp   -- instrumental Q-resolution factor

Raises: IOError when the file cannot be read from disk

read_data_string(self, data, stype, qmax, qdamp, name='')

source code 
read_data_string(data, stype, qmax, qdamp, name = "") --> Read
pdf data from a string into memory.

data    -- string containing the contents of the data file
stype   -- 'X' (xray) or 'N' (neutron)
qmax    -- Q-value cutoff used in PDF calculation.
           Use qmax=0 to neglect termination ripples.
qdamp   -- instrumental Q-resolution factor
name    -- tag with which to label data

read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name='list')

source code 
read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data =
None, name = "list") --> Read pdf data into memory from lists.

All lists must be of the same length.
stype       -- 'X' (xray) or 'N' (neutron)
qmax        -- Q-value cutoff used in PDF calculation.
               Use qmax=0 to neglect termination ripples.
qdamp       -- instrumental Q-resolution factor
r_data      -- list of r-values
Gr_data     -- list of G(r) values
dGr_data    -- list of G(r) uncertainty values
name        -- tag with which to label data

Raises: ValueError when the data lists are of different length

pdfrange(self, iset, rmin, rmax)

source code 
pdfrange(iset, rmin, rmax) --> Set the range of the fit.

iset    -- data set to consider
rmin    -- minimum r-value of fit
rmax    -- maximum r-value of fit

Raises: ValueError for bad input values

alloc(self, stype, qmax, qdamp, rmin, rmax, bin)

source code 
alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space
for a PDF calculation.

The structure from which to calculate the PDF must first be imported
with the read_struct() or read_struct_string() method.
stype   -- 'X' (xray) or 'N' (neutron)
qmax    -- Q-value cutoff used in PDF calculation.
           Use qmax=0 to neglect termination ripples.
qdamp   -- instrumental Q-resolution factor
rmin    -- minimum r-value of calculation
rmax    -- maximum r-value of calculation
bin     -- number of data points in calculation

Raises:
    ValueError for bad input values
    pdffit.unassignedError when no structure has been loaded

calc(self)

source code 
calc() --> Calculate the PDF of the imported structure.

Space for the calculation must first be allocated with the alloc()
method.

Raises:
    pdffit2.calculationError when allocated space cannot
    accomodate calculation
    pdffit.unassignedError when space for calculation has not been
    allocated

refine(self, toler=1e-08)

source code 
refine(toler = 0.00000001) --> Fit the theory to the imported data.

toler   --  tolerance of the fit

Raises:
    pdffit2.calculationError when the model pdf cannot be calculated
    pdffit2.constraintError when refinement fails due to bad
    constraint
    pdffit2.unassigedError when a constraint used but never initialized
    using setpar()

refine_step(self, toler=1e-08)

source code 
refine_step(toler = 0.00000001) --> Run a single step of the fit.

toler   --  tolerance of the fit

Raises:
    pdffit2.calculationError when the model pdf cannot be calculated
    pdffit2.constraintError when refinement fails due to bad
    constraint
    pdffit2.unassigedError when a constraint used but never initialized
    using setpar()

Returns: 1 (0) if refinement is (is not) finished

save_pdf(self, iset, fname)

source code 
save_pdf(iset, fname) --> Save calculated or fitted PDF to file.

iset    -- data set to save

Raises:
    IOError if file cannot be saved
    pdffit2.unassignedError if the data set is undefined

save_pdf_string(self, iset)

source code 
save_pdf_string(iset) --> Save calculated or fitted PDF to string.

iset    -- data set to save

Raises:
    pdffit2.unassignedError if the data set is undefined

Returns: string containing contents of save file

save_dif(self, iset, fname)

source code 
save_dif(iset, fname) --> Save data and fitted PDF difference to
file.

iset    -- data set to save

Raises:
    IOError if file cannot be saved
    pdffit2.unassignedError if the data set is undefined

save_dif_string(self, iset)

source code 
save_dif_string(iset) --> Save data and fitted PDF difference to
string.

iset    -- data set to save

Raises:
    pdffit2.unassignedError if the data set is undefined

Returns: string containing contents of save file

save_res(self, fname)

source code 
save_res(fname) --> Save fit-specific data to file.

Raises:
    IOError if file cannot be saved
    pdffit2.unassignedError if there is no refinement data to save

save_res_string(self)

source code 
save_res_string() --> Save fit-specific data to a string.

Raises:
    pdffit2.unassignedError if there is no refinement data to save

Returns: string containing contents of save file

get_structure(self, ip)

source code 
get_structure(ip) --> Get a copy of specified phase data.

ip -- index of existing PdfFit phase starting from 1

Return Structure object from diffpy.Structure.
Raise pdffit2.unassignedError if phase ip is undefined.

save_struct(self, ip, fname)

source code 
save_struct(ip, fname) --> Save structure resulting from fit
to file.

ip    -- phase to save

Raises:
    IOError if file cannot be saved
    pdffit2.unassignedError if the data set is undefined

save_struct_string(self, ip)

source code 
save_struct(ip) --> Save structure resulting from fit to string.

ip    -- phase to save

Raises:
    pdffit2.unassignedError if phase ip is undefined.

Returns: string containing contents of save file

show_struct(self, ip)

source code 
show_struct(ip) --> Print structure resulting from fit.

ip    -- phase to display

Raises: pdffit2.unassignedError if the phase is undefined

constrain(self, var, par, fcon=None)

source code 
constrain(var, par[, fcon]) --> Constrain a variable to a parameter.

A variable can be constrained to a number or equation string.
var     -- variable to constrain, such as x(1)
par     -- parameter which to constrain the variable. This can be
           an integer or an equation string containing a reference
           to another parameter. Equation strings use standard c++
           syntax. The value of a constrained parameter is accessed
           as @p in an equation string, where p is the parameter.
           e.g.
           >>>  constrain(x(1), 1)
           >>>  constrain(x(2), "0.5+@1")
fcon    -- 'USER', 'IDENT', 'FCOMP', or 'FSQR'
           this is an optional parameter, and I don't know how it is
           used!

Raises:
    pdffit2.constraintError if a constraint is bad
    pdffit2.unassignedError if variable does not yet exist
    ValueError if variable index does not exist (e.g. lat(7))

setpar(self, par, val)

source code 
setpar(par, val) --> Set value of constrained parameter.

val     --  Either a numerical value or a reference to a variable

Raises:
    pdffit2.unassignedError when variable is yet to be assigned

setvar(self, var, val)

source code 
setvar(var, val) --> Set the value of a variable.

Raises:
    pdffit2.unassignedError if variable does not yet exist
    ValueError if variable index does not exist (e.g. lat(7))

getvar(self, var)

source code 
getvar(var) --> Get stored value of a variable.

Raises:
    pdffit2.unassignedError if variable does not yet exist
    ValueError if variable index does not exist (e.g. lat(7))

getrw(self)

source code 
getrw() --> Get normalized total error of the fit rw.

getrw calculates total fit error summed for all datasets in the fit.

Return float.

getcrw(self)

source code 
getcrw() --> Get cumulative Rw for the current dataset.

Cumulative Rw is a list of Rw partial sums cost values evaluated against
observed PDF data in the error sums evaluated against
the r-points in the fit.

Raises: pdffit2.unassignedError if no data exists

Returns: List of crw points, equidistant in r or empty list
if the refine function has not been called yet.

getR(self)

source code 
getR() --> Get r-points used in the fit.

This function should only be called after data has been loaded or
calculated. Before a refinement, the list of r-points will reflect the
data. Afterwords, they will reflect the fit range.

Raises: pdffit2.unassignedError if no data exists

Returns: List of equidistance r-points used in fit.

getpdf_fit(self)

source code 
getpdf_fit() --> Get fitted PDF.

This function should only be called after a refinement or refinement
step has been done.

Raises: pdffit2.unassignedError if no data exists

Returns: List of fitted points, equidistant in r.

getpdf_obs(self)

source code 
getpdf_obs() --> Get observed PDF.

This function should only be called after data has been loaded or
calculated. Before a refinement, the list of r-points will reflect the
data. Afterwords, they will reflect the fit range.

Raises: pdffit2.unassignedError if no data exists

Returns: List of data points, equidistant in r.

getpdf_diff(self)

source code 
Obtain difference between observed and fitted PDF.

This function should only be called after data has been loaded or
calculated. Before a refinement, the list of r-points will reflect the
data. Afterwords, they will reflect the fit range.

Raises: pdffit2.unassignedError if no data exists

Returns: List of data points, equidistant in r.

get_atoms(self, ip=None)

source code 
get_atoms() --> Get element symbols of all atoms in the structure.

ip -- index of phase to get the elements from (starting from 1)
      when ip is not given, use current phase

This function should only be called after a structure has been loaded.

Raises: pdffit2.unassignedError if no structure exists

Returns: List of atom names in structure.

get_atom_types(self, ip=None)

source code 
get_atom_types() --> Ordered unique element symbols in the structure.

ip -- index of phase to get the elements from (starting from 1)
      when ip is not given, use current phase

This function should only be called after a structure has been loaded.

Raises:
    pdffit2.unassignedError if no structure exists

Returns: List of unique atom symbols as they occur in structure.

getpar(self, par)

source code 
getpar(par) --> Get value of parameter.

Raises: ValueError if parameter does not exists

fixpar(self, par)

source code 
fixpar(par) --> Fix a parameter.

Fixed parameters are not fitted in a refinement. Passed parameter
can be 'ALL', in which case all parameters are fixed.

Raises: pdffit.unassignedError when parameter has not been assigned

freepar(self, par)

source code 
freepar(par) --> Free a parameter.

Freed parameters are fitted in a refinement. Passed parameter
can be 'ALL', in which case all parameters are freed.

Raises: pdffit.unassignedError when parameter has not been assigned

setphase(self, ip)

source code 
setphase(ip) --> Switch to phase ip.

ip  -- index of the phase starting at 1.

All parameters assigned after this method is called refer only to the
current phase.

Raises: pdffit.unassignedError when phase does not exist

setdata(self, iset)

source code 
setdata(iset) --> Set the data set in focus.

iset -- integer index of data set starting at 1.

Raises: pdffit.unassignedError when data set does not exist

psel(self, ip)

source code 
psel(ip) --> Include phase ip in calculation of total PDF

psel('ALL')     selects all phases for PDF calculation.

Raises: pdffit2.unassignedError if selected phase does not exist

pdesel(self, ip)

source code 
pdesel(ip) --> Exclude phase ip from calculation of total PDF.

pdesel('ALL')   excludes all phases from PDF calculation.

Raises: pdffit2.unassignedError if selected phase does not exist

selectAtomType(self, ip, ijchar, symbol, flag)

source code 
Configure partial PDF - mark the specified atom type in phase ip
as included or excluded as a first or second in pair for distance
evaluation.

ip      -- phase index starting at 1
ijchar  -- 'i' or 'j' for first or second in pair
symbol  -- element symbol
flag    -- bool flag, True for selection, False for exclusion

Raises:
    pdffit2.unassignedError if selected phase does not exist
    ValueError for invalid value of ijchar

selectAtomIndex(self, ip, ijchar, aidx, flag)

source code 
Configure partial PDF - mark the atom of given index in phase ip
as included or excluded as a first or second in pair for distance
evaluation.

ip      -- phase index starting at 1
ijchar  -- 'i' or 'j' for first or second in pair
aidx    -- integer index of atom starting at 1
flag    -- bool flag, True for selection, False for exclusion

Raises:
    pdffit2.unassignedError if selected phase does not exist
    ValueError if atom index or ijchar are invalid

selectAll(self, ip, ijchar)

source code 
Configure partial PDF - include all atoms of phase ip as first or
second element in pair for distance evaluation.

ip      -- phase index starting at 1
ijchar  -- 'i' or 'j' for first or second in pair

Raises:
    pdffit2.unassignedError if selected phase does not exist
    ValueError if ijchar is invalid

selectNone(self, ip, ijchar)

source code 
Configure partial PDF - exclude all atoms of phase ip from first
or second element of pair distance evaluation.

ip      -- phase index starting at 1
ijchar  -- 'i' or 'j' for first or second in pair

Raises:
    pdffit2.unassignedError if selected phase does not exist
    ValueError if ijchar is invalid

bang(self, i, j, k)

source code 
bang(i, j, k) --> Show bond angle defined by atoms i, j, k.

No return value.  Use bond_angle() to get the result.

Raises: ValueError if selected atom(s) does not exist
        pdffit.unassignedError when no structure has been loaded

bond_angle(self, i, j, k)

source code 
bond_angle(i, j, k) --> bond angle defined by atoms i, j, k.
Angle is calculated using the shortest ji and jk lengths with
respect to periodic boundary conditions.

i, j, k  -- atom indices starting at 1

Return a tuple of (angle, angle_error), both values are in degrees.

Raises: ValueError if selected atom(s) does not exist
        pdffit.unassignedError when no structure has been loaded

blen(self, *args)

source code 
blen(i, j) --> Show bond length defined by atoms i and j.

i      -- index of the first atom starting at 1
j      -- index of the second atom starting at 1

No return value.  Use bond_length_atoms() to retrieve result.

Second form:

blen(a1, a2, lb, ub) --> Show sorted lengths of all a1-a2 bonds.

a1     -- symbol of the first element in pair or "ALL"
a2     -- symbol of the second element in pair or "ALL"
lb     -- lower bond length boundary
ub     -- upper bond length boundary

No return value.  Use bond_length_types() to retrieve results.

Raises: ValueError if selected atom(s) does not exist
        pdffit.unassignedError when no structure has been loaded

bond_length_atoms(self, i, j)

source code 
bond_length_atoms(i, j) --> shortest distance between atoms i, j.
Periodic boundary conditions are applied to find the shortest bond.

i   -- index of the first atom starting at 1
j   -- index of the second atom starting at 1

Return a tuple of (distance, distance_error).

Raises: ValueError if selected atom(s) does not exist
        pdffit.unassignedError when no structure has been loaded.

bond_length_types(self, a1, a2, lb, ub)

source code 
bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances.

a1     -- symbol of the first element in pair or "ALL"
a2     -- symbol of the second element in pair or "ALL"
lb     -- lower bond length boundary
ub     -- upper bond length boundary

Return a dictionary of distance data containing

dij  : list of bond lenghts within given bounds
ddij : list of bond legnth standard deviations
ij0  : pairs of atom indices starting from 0
ij1  : pairs of atom indices starting from 1

Raises: ValueError if selected atom(s) does not exist
        pdffit.unassignedError when no structure has been loaded.

show_scat(self, stype)

source code 
show_scat(stype) --> Print scattering length for all atoms in
the current phase.

stype -- 'X' (xray) or 'N' (neutron).

Raises: pdffit2.unassignedError if no phase exists

get_scat_string(self, stype)

source code 
get_scat_string(stype) --> Get string with scattering factors
of all atoms in the current phase.

stype -- 'X' (xray) or 'N' (neutron).

Raises:
    pdffit2.unassignedError if no phase exists

Returns: string with all scattering factors.

get_scat(self, stype, element)

source code 
get_scat(stype, element) --> Get active scattering factor for
given element.  If scattering factor has been changed using
set_scat the result may depend on the active phase.  When no
phase has been loaded, return the standard value.

stype   -- 'X' (xray) or 'N' (neutron).
element -- case-insensitive element symbol such as "Na" or "CL"

Return float.

Raises:
    ValueError if element is not known.

set_scat(self, stype, element, value)

source code 
set_scat(stype, element, value) --> Set custom scattering factor
for given element.  The new scattering factor applies only for the
current phase, in other phases it keeps its default value.

stype   -- 'X' (xray) or 'N' (neutron).
element -- case-insensitive element symbol such as "Na" or "CL"
value   -- new value of scattering factor

No return value.

Raises:
    pdffit2.unassignedError if no phase exists.
    ValueError if element is not known.

See also reset_scat, get_scat.

reset_scat(self, element)

source code 
reset_scat(stype, element) --> Reset scattering factors for
given element to their standard values.  The reset_scat applies
only for the current phase.

element -- case-insensitive element symbol such as "Na" or "CL"
Raises:
    pdffit2.unassignedError if no phase exists
    ValueError if element is not known.

num_atoms(self)

source code 
num_atoms() --> Get number of atoms in current phase.

Raises: pdffit2.unassignedError if no atoms exist

num_phases(self)

source code 
num_phases() --> Number of phases loaded in PdfFit instance.

Use setphase to bring a specific phase in focus.

Return integer.

num_datasets(self)

source code 
num_datasets() --> Number of datasets loaded in PdfFit instance.

Use setdata to bring a specific dataset in focus.

Return integer.

phase_fractions(self)

source code 
phase_fractions() --> relative phase fractions for current dataset.
Convert phase scale factors to relative phase fractions given the
scattering type of current dataset.

Return a dictionary of phase fractions with following keys:

"atom"    -- list of fractions normalized to atom count
"stdatom" -- errors of atom count fractions
"cell"    -- list of fractions normalized to unit cell count
"stdcell" -- errors of unit cell count fractions
"mass"    -- list of relative weight fractions
"stdmass" -- errors of relative weight fractions

Raises: pdffit2.unassignedError if no dataset exists.

lat(n)
Static Method

source code 
lat(n) --> Get reference to lattice variable n.

n can be an integer or a string representing the lattice variable.
1 <==> 'a'
2 <==> 'b'
3 <==> 'c'
4 <==> 'alpha'
5 <==> 'beta'
6 <==> 'gamma'

u11(i)
Static Method

source code 
u11(i) --> Get reference to U(1,1) for atom i.

U is the anisotropic thermal factor tensor.

u22(i)
Static Method

source code 
u22(i) --> Get reference to U(2,2) for atom i.

U is the anisotropic thermal factor tensor.

u33(i)
Static Method

source code 
u33(i) --> Get reference to U(3,3) for atom i.

U is the anisotropic thermal factor tensor.

u12(i)
Static Method

source code 
u12(i) --> Get reference to U(1,2) for atom i.

U is the anisotropic thermal factor tensor.

u13(i)
Static Method

source code 
u13(i) --> Get reference to U(1,3) for atom i.

U is the anisotropic thermal factor tensor.

u23(i)
Static Method

source code 
u23(i) --> Get reference to U(2,3) for atom i.

U is the anisotropic thermal factor tensor.

pscale()
Static Method

source code 
pscale() --> Get reference to pscale.

pscale is the fraction of the total structure that the current phase
represents.

sratio()
Static Method

source code 
sratio() --> Get reference to sigma ratio.

The sigma ratio determines the reduction in the Debye-Waller factor for
distances below rcut.

delta2()
Static Method

source code 
delta2() --> Reference to (1/R^2) sharpening factor.
The phenomenological correlation constant in the Debye-Waller factor.
The (1/R^2) peak sharpening factor.

dscale()
Static Method

source code 
dscale() --> Get reference to dscale.

The data scale factor.

qdamp()
Static Method

source code 
qdamp() --> Get reference to qdamp.

Qdamp controls PDF damping due to instrument Q-resolution.

qbroad()
Static Method

source code 
qbroad() --> Get reference to qbroad.

Quadratic peak broadening factor.

spdiameter()
Static Method

source code 
spdiameter() --> Get reference to spdiameter (phase property).

Diameter value for the spherical particle PDF correction.
Spherical envelope is not applied when spdiameter equals 0.

stepcut()
Static Method

source code 
stepcut() --> Get reference to stepcut (phase property).

stepcut is cutoff radius for empirical step-function PDF envelope.
stepcut can be used to approximate loss of pair correlations
in amorphous phase.  stepcut cannot be refined.

Step cutoff is not applied when stepcut equals 0.

rcut()
Static Method

source code 
rcut() --> Get reference to rcut.

rcut is the value of r below which peak sharpening, defined by
the sigma ratio (sratio), applies.  rcut cannot be refined.

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__getRef(self, var_string)

source code 
Return the actual reference to the variable in the var_string.

This function must be called before trying to actually reference an
internal variable. See the constrain method for an example.

Raises:
    pdffit2.unassignedError if variable is not yet assigned
    ValueError if variable index does not exist (e.g. lat(7))