From d3a2283e469710428202e053a57d90f5c1e1ffb3 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 11:54:40 -0400 Subject: [PATCH 1/7] Remove duplicate code files --- diffpy/__init__.py | 28 - diffpy/pdffit2/__init__.py | 34 - diffpy/pdffit2/ipy_ext.py | 95 - diffpy/pdffit2/output.py | 41 - diffpy/pdffit2/pdffit.py | 1297 ------ diffpy/pdffit2/tests/ExceptionsTest.py | 794 ---- diffpy/pdffit2/tests/TestPdfFit.py | 761 ---- diffpy/pdffit2/tests/TestPhaseFractions.py | 95 - diffpy/pdffit2/tests/TestShapeFactors.py | 274 -- diffpy/pdffit2/tests/__init__.py | 103 - diffpy/pdffit2/tests/debug.py | 36 - diffpy/pdffit2/tests/pdffit2testutils.py | 53 - diffpy/pdffit2/tests/run.py | 38 - diffpy/pdffit2/tests/rundeps.py | 30 - diffpy/pdffit2/tests/testdata/300K.gr | 2062 ---------- diffpy/pdffit2/tests/testdata/Ni.dat | 1001 ----- diffpy/pdffit2/tests/testdata/Ni.stru | 33 - .../pdffit2/tests/testdata/PbScW25TiO3.stru | 345 -- diffpy/pdffit2/tests/testdata/badNi.dat | 1001 ----- diffpy/pdffit2/tests/testdata/badNi.stru | 32 - .../tests/testdata/badNiZeroVolume.stru | 33 - diffpy/pdffit2/tests/testdata/noLattice.stru | 32 - diffpy/pdffit2/version.py | 54 - libpdffit2/Atom.cc | 104 - libpdffit2/Atom.h | 70 - libpdffit2/AtomType.h | 76 - libpdffit2/LocalPeriodicTable.cc | 147 - libpdffit2/LocalPeriodicTable.h | 63 - libpdffit2/MathUtils.h | 94 - libpdffit2/OutputStreams.cc | 24 - libpdffit2/OutputStreams.h | 31 - libpdffit2/PairDistance.h | 42 - libpdffit2/PeriodicTable.cc | 3459 ----------------- libpdffit2/PeriodicTable.h | 75 - libpdffit2/PointsInSphere.cc | 243 -- libpdffit2/PointsInSphere.h | 182 - libpdffit2/ShapeFactors.h | 43 - libpdffit2/StringUtils.cc | 58 - libpdffit2/StringUtils.h | 71 - libpdffit2/exceptions.h | 95 - libpdffit2/fit.cc | 836 ---- libpdffit2/gaussj.cc | 114 - libpdffit2/matrix.h | 239 -- libpdffit2/metric.cc | 341 -- libpdffit2/nrutil.cc | 122 - libpdffit2/nrutil.h | 34 - libpdffit2/output.cc | 350 -- libpdffit2/parser.cc | 402 -- libpdffit2/pdf.cc | 1776 --------- libpdffit2/pdffit.cc | 372 -- libpdffit2/pdffit.h | 611 --- libpdffit2/pdflsmin.cc | 326 -- libpdffit2/scatlen.cc | 114 - libpdffit2/stru.cc | 837 ---- libpdffit2/support_msvc9.h | 13 - libpdffit2/tests/Makefile | 32 - libpdffit2/tests/TestPointsInSphere.cc | 228 -- libpdffit2/tests/alltests.cc | 46 - pdffit2module/PyFileStreambuf.h | 97 - pdffit2module/bindings.cc | 341 -- pdffit2module/bindings.h | 27 - pdffit2module/misc.cc | 2219 ----------- pdffit2module/misc.h | 486 --- pdffit2module/pdffit2module.cc | 150 - pdffit2module/pyexceptions.cc | 30 - pdffit2module/pyexceptions.h | 33 - 66 files changed, 23325 deletions(-) delete mode 100644 diffpy/__init__.py delete mode 100644 diffpy/pdffit2/__init__.py delete mode 100644 diffpy/pdffit2/ipy_ext.py delete mode 100644 diffpy/pdffit2/output.py delete mode 100644 diffpy/pdffit2/pdffit.py delete mode 100644 diffpy/pdffit2/tests/ExceptionsTest.py delete mode 100644 diffpy/pdffit2/tests/TestPdfFit.py delete mode 100644 diffpy/pdffit2/tests/TestPhaseFractions.py delete mode 100644 diffpy/pdffit2/tests/TestShapeFactors.py delete mode 100644 diffpy/pdffit2/tests/__init__.py delete mode 100644 diffpy/pdffit2/tests/debug.py delete mode 100644 diffpy/pdffit2/tests/pdffit2testutils.py delete mode 100644 diffpy/pdffit2/tests/run.py delete mode 100644 diffpy/pdffit2/tests/rundeps.py delete mode 100644 diffpy/pdffit2/tests/testdata/300K.gr delete mode 100644 diffpy/pdffit2/tests/testdata/Ni.dat delete mode 100644 diffpy/pdffit2/tests/testdata/Ni.stru delete mode 100644 diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru delete mode 100644 diffpy/pdffit2/tests/testdata/badNi.dat delete mode 100644 diffpy/pdffit2/tests/testdata/badNi.stru delete mode 100644 diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru delete mode 100644 diffpy/pdffit2/tests/testdata/noLattice.stru delete mode 100644 diffpy/pdffit2/version.py delete mode 100644 libpdffit2/Atom.cc delete mode 100644 libpdffit2/Atom.h delete mode 100644 libpdffit2/AtomType.h delete mode 100644 libpdffit2/LocalPeriodicTable.cc delete mode 100644 libpdffit2/LocalPeriodicTable.h delete mode 100644 libpdffit2/MathUtils.h delete mode 100644 libpdffit2/OutputStreams.cc delete mode 100644 libpdffit2/OutputStreams.h delete mode 100644 libpdffit2/PairDistance.h delete mode 100644 libpdffit2/PeriodicTable.cc delete mode 100644 libpdffit2/PeriodicTable.h delete mode 100644 libpdffit2/PointsInSphere.cc delete mode 100644 libpdffit2/PointsInSphere.h delete mode 100644 libpdffit2/ShapeFactors.h delete mode 100644 libpdffit2/StringUtils.cc delete mode 100644 libpdffit2/StringUtils.h delete mode 100644 libpdffit2/exceptions.h delete mode 100644 libpdffit2/fit.cc delete mode 100644 libpdffit2/gaussj.cc delete mode 100644 libpdffit2/matrix.h delete mode 100644 libpdffit2/metric.cc delete mode 100644 libpdffit2/nrutil.cc delete mode 100644 libpdffit2/nrutil.h delete mode 100644 libpdffit2/output.cc delete mode 100644 libpdffit2/parser.cc delete mode 100644 libpdffit2/pdf.cc delete mode 100644 libpdffit2/pdffit.cc delete mode 100644 libpdffit2/pdffit.h delete mode 100644 libpdffit2/pdflsmin.cc delete mode 100644 libpdffit2/scatlen.cc delete mode 100644 libpdffit2/stru.cc delete mode 100644 libpdffit2/support_msvc9.h delete mode 100644 libpdffit2/tests/Makefile delete mode 100644 libpdffit2/tests/TestPointsInSphere.cc delete mode 100644 libpdffit2/tests/alltests.cc delete mode 100644 pdffit2module/PyFileStreambuf.h delete mode 100644 pdffit2module/bindings.cc delete mode 100644 pdffit2module/bindings.h delete mode 100644 pdffit2module/misc.cc delete mode 100644 pdffit2module/misc.h delete mode 100644 pdffit2module/pdffit2module.cc delete mode 100644 pdffit2module/pyexceptions.cc delete mode 100644 pdffit2module/pyexceptions.h diff --git a/diffpy/__init__.py b/diffpy/__init__.py deleted file mode 100644 index f093b937..00000000 --- a/diffpy/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - - -"""diffpy - tools for structure analysis by diffraction. - -Blank namespace package. -""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - - -# End of file diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py deleted file mode 100644 index 0f33c5c4..00000000 --- a/diffpy/pdffit2/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""PDFfit2 - real space structure refinement program. -Classes: - PdfFit -Routines: - redirect_stdout -""" - - -from diffpy.pdffit2.version import __version__, __date__ -from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.output import redirect_stdout -from diffpy.pdffit2.pdffit2 import is_element - -# silence pyflakes checker -assert __version__ or True -assert __date__ or True -assert all((PdfFit, redirect_stdout, is_element)) - -# End of file diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py deleted file mode 100644 index 4546967e..00000000 --- a/diffpy/pdffit2/ipy_ext.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -"""This module defines functions within IPython session to simulate -the old pdffit2 interactive session. - -Usage: %load_ext diffpy.pdffit2.ipy_ext -""" - - -def load_ipython_extension(ipython): - from diffpy.pdffit2 import PdfFit - - pf = PdfFit() - pdf = EasyPDFPlotting(pf) - print(" Type help(pdffit) or help(topic) for information.\n") - ns = dict(pdffit=PdfFit, pdf=pdf) - pf._exportAll(ns) - ipython.user_ns.update(ns) - return - - -class EasyPDFPlotting(object): - """Convenience functions for accessing and plotting PDFfit2 data.""" - - def __init__(self, pdffit_instance): - self._pdffit = pdffit_instance - return - - @property - def r(self): - "R-grid for PDF simulation." - return self._asarray(self._pdffit.getR(), dtype=float) - - @property - def Gobs(self): - "Observed PDF data." - return self._asarray(self._pdffit.getpdf_obs(), dtype=float) - - @property - def Gcalc(self): - "Calculated PDF data." - return self._asarray(self._pdffit.getpdf_fit()) - - @property - def Gdiff(self): - "Difference between the observed and simulated PDF." - return self.Gobs - self.Gcalc - - def showfit(self, offset=None): - """Plot observed and simulated PDFs and the difference curve. - - offset -- offset for the difference curve. - - No return value. - """ - from math import floor - - from matplotlib.pyplot import gca - - cr = self.r - cGobs = self.Gobs - cGcalc = self.Gcalc - cGdiff = self.Gdiff - if offset is None: - offset = floor(min([min(cGobs), min(cGcalc)]) - max(cGdiff)) - ax = gca() - ax.plot(cr, cGobs, "r.", cr, cGcalc, "b-", cr, cGdiff + offset, "g-") - xl = ax.xaxis.get_label().get_text() - yl = ax.yaxis.get_label().get_text() - if xl == "": - ax.set_xlabel("r (A)") - if yl == "": - ax.set_ylabel("G (A**-2)") - return - - def showRw(self): - "Plot cumulative Rw." - from matplotlib.pyplot import gca - - cRw = self._asarray(self._pdffit.getcrw()) - ax = gca() - ax.plot(self.r, cRw) - ax.set_title("Cumulative Rw = %.4f" % cRw[-1]) - ax.set_xlabel("r") - ax.set_ylabel("Rw") - return - - @staticmethod - def _asarray(x, dtype=None): - import numpy - - return numpy.asarray(x, dtype=dtype) - - -# End of class EasyPDFPlotting diff --git a/diffpy/pdffit2/output.py b/diffpy/pdffit2/output.py deleted file mode 100644 index 6d1247cf..00000000 --- a/diffpy/pdffit2/output.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2007 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Take care of sending engine output to given file-like object. -The output file is stored in local module variable stdout. -""" - - -# create module variable stdout - -from sys import stdout as stdout - -# silence pyflakes checker -assert stdout - - -def redirect_stdout(dst): - """Redirect PDFfit2 standard output to a file-like object dst. - The dst value is stored in module variable stdout. - """ - from diffpy.pdffit2.pdffit2 import redirect_stdout - - redirect_stdout(dst) - global stdout - stdout = dst - return - - -# End of file diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py deleted file mode 100644 index 255e8b0f..00000000 --- a/diffpy/pdffit2/pdffit.py +++ /dev/null @@ -1,1297 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Chris Farros, Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""PdfFit class for fitting pdf data to a model.""" - -from __future__ import print_function - -import itertools -import numbers - -import six - -# Load pdffit2 and output modules to the current namespace. -# Note that "import diffpy.pdffit2.output as output" would -# crash with AttributeError when executed during imports of -# parent packages. -from diffpy.pdffit2 import output, pdffit2 - -# helper routines - - -def _format_value_std(value, stdev): - """Convert value to a string with standard deviation in brackets. - - value -- a number - stdev -- standard deviation. Ignored when small compared to value. - - Return string. - """ - if stdev > abs(value) * 1e-8: - s = "%g (%g)" % (value, stdev) - elif str(stdev) == "nan": - s = "%g (NaN)" % value - else: - s = "%g" % value - return s - - -def _format_bond_length(dij, ddij, ij1, symij): - """Return string with formatted bond length info for a pair of atoms. - - dij -- distance between atoms i and j - ddij -- standard deviation of dij. Ignored when small relative to dij. - ij1 -- tuple of atom indices starting at 1 - symij -- tuple of atom symbols - - Return formatted string. - """ - w_smbidx = 10 - w_equals = 30 - s0 = "%s (#%i)" % (symij[0], ij1[0]) - s1 = "%s (#%i)" % (symij[1], ij1[1]) - leader0 = " " + s0.ljust(w_smbidx) + " - " + s1 + " " - leader1 = leader0.ljust(w_equals) + "= " - s = leader1 + _format_value_std(dij, ddij) + " A" - return s - - -def _convertCallable(var): - """Convert an object to the result of its call when callable. - - var -- string or callable object that returns string - - Return var or var(). - """ - if callable(var): - rv = var() - else: - rv = var - return rv - - -# constants - -__intro_message__ = """ -****************************************************************************** -* P D F F I T Version %(version)s * -* %(date)s * -* -------------------------------------------------------------------------- * -* (c) 1998-2007 Trustees of the Michigan State University. * -* (c) 2008-%(year)s Trustees of the Columbia University * -* in the city of New York. * -* * -* Authors: * -* Thomas Proffen - Email: tproffen@lanl.gov * -* Jacques Bloch - Email: bloch@pa.msu.edu * -* Christopher Farrow - Email: clf2121@columbia.edu * -* Pavol Juhas - Email: pjuhas@bnl.gov * -* Simon Billinge - Email: sb2896@columbia.edu * -****************************************************************************** -""" - - -############################################################################## - - -class PdfFit(object): - """Create PdfFit object.""" - - # constants and enumerators from pdffit.h: - # selection of all atoms - selalias = {"ALL": -1} - # constraint type identifiers - FCON = {"USER": 0, "IDENT": 1, "FCOMP": 2, "FSQR": 3} - # scattering type identifiers - Sctp = {"X": 0, "N": 1} - - def _exportAll(self, namespace): - """_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(). - """ - # string aliases (var = "var") - for a in itertools.chain(self.selalias, self.FCON, self.Sctp): - exec("%s = %r" % (a, a), namespace) - public = [ - a - for a in dir(self) - if "__" not in a and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] - ] - for funcname in public: - namespace[funcname] = getattr(self, funcname) - return - - def intro(): - """Show introductory message.""" - import re - - from diffpy.pdffit2 import __date__, __version__ - - date = __date__[:10] - d = {"version": __version__, "date": date, "year": date[:4] or "2019"} - msg = __intro_message__ % d - - def filler(mx): - return mx.group(0).rstrip(" *").ljust(77) + "*" - - msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) - print(msg_ljust, file=output.stdout) - return - - intro = staticmethod(intro) - - def add_structure(self, stru): - """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. - """ - s = stru.writeStr("pdffit") - self.read_struct_string(s) - return - - def read_struct(self, struct): - """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 - """ - pdffit2.read_struct(self._handle, struct) - self.stru_files.append(struct) - return - - def read_struct_string(self, struct, name=""): - """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 - """ - pdffit2.read_struct_string(self._handle, struct) - self.stru_files.append(name) - return - - def read_data(self, data, stype, qmax, qdamp): - """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 - """ - pdffit2.read_data(self._handle, data, six.b(stype), qmax, qdamp) - self.data_files.append(data) - return - - def 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. - - 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 - """ - pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, qdamp, name) - name = data - self.data_files.append(name) - return - - def 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. - - 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 - """ - pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, r_data, Gr_data, dGr_data, name) - self.data_files.append(name) - return - - def pdfrange(self, iset, rmin, rmax): - """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 - """ - pdffit2.pdfrange(self._handle, iset, rmin, rmax) - return - - def reset(self): - """reset() --> Clear all stored fit, structure, and parameter data.""" - self.stru_files = [] - self.data_files = [] - pdffit2.reset(self._handle) - return - - def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): - """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 - """ - pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, rmax, bin) - return - - def calc(self): - """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 - """ - pdffit2.calc(self._handle) - return - - def refine(self, toler=0.00000001): - """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() - """ - step = 0 - finished = 0 - while not finished: - finished = pdffit2.refine_step(self._handle, toler) - step += 1 - return - - def refine_step(self, toler=0.00000001): - """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 - """ - self.finished = pdffit2.refine_step(self._handle, toler) - return self.finished - - def save_pdf(self, iset, fname): - """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 - """ - pdffit2.save_pdf(self._handle, iset, fname) - return - - def save_pdf_string(self, iset): - """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 - """ - pdffilestring = pdffit2.save_pdf(self._handle, iset, "") - return pdffilestring - - def save_dif(self, iset, fname): - """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 - """ - pdffit2.save_dif(self._handle, iset, fname) - return - - def save_dif_string(self, iset): - """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 - """ - diffilestring = pdffit2.save_dif(self._handle, iset, "") - return diffilestring - - def save_res(self, fname): - """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 - """ - pdffit2.save_res(self._handle, fname) - return - - def save_res_string(self): - """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 - """ - resfilestring = pdffit2.save_res(self._handle, "") - return resfilestring - - def get_structure(self, ip): - """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. - """ - from diffpy.structure import PDFFitStructure - - s = self.save_struct_string(ip) - stru = PDFFitStructure() - stru.readStr(s, "pdffit") - return stru - - def save_struct(self, ip, fname): - """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 - """ - pdffit2.save_struct(self._handle, ip, fname) - return - - def save_struct_string(self, ip): - """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 - """ - structfilestring = pdffit2.save_struct(self._handle, ip, "") - return structfilestring - - def show_struct(self, ip): - """show_struct(ip) --> Print structure resulting from fit. - - ip -- phase to display - - Raises: pdffit2.unassignedError if the phase is undefined - """ - pdffit2.show_struct(self._handle, ip) - return - - def constrain(self, var, par, fcon=None): - """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)) - """ - var_ref = self.__getRef(var) - varnc = _convertCallable(var) - if fcon: - fc = self.FCON[fcon] - pdffit2.constrain_int(self._handle, var_ref, varnc, par, fc) - elif isinstance(par, six.string_types): - pdffit2.constrain_str(self._handle, var_ref, varnc, par) - else: - pdffit2.constrain_int(self._handle, var_ref, varnc, par) - return - - def setpar(self, par, val): - """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 - """ - # people do not use parenthesis, e.g., "setpar(3, qdamp)" - # in such case val is a reference to PdfFit method - val = _convertCallable(val) - try: - val = float(val) - pdffit2.setpar_dbl(self._handle, par, val) - except ValueError: - var_ref = self.__getRef(val) - pdffit2.setpar_RV(self._handle, par, var_ref) - return - - def setvar(self, var, val): - """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)) - """ - var_ref = self.__getRef(var) - pdffit2.setvar(self._handle, var_ref, val) - return - - def getvar(self, var): - """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)) - """ - var_ref = self.__getRef(var) - retval = pdffit2.getvar(self._handle, var_ref) - return retval - - def getrw(self): - """getrw() --> Get normalized total error of the fit rw. - - getrw calculates total fit error summed for all datasets in the fit. - - Return float. - """ - rw = pdffit2.getrw(self._handle) - return rw - - def getcrw(self): - """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. - """ - crw = pdffit2.getcrw(self._handle) - return crw - - def getR(self): - """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. - """ - R = pdffit2.getR(self._handle) - return R - - def getpdf_fit(self): - """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. - """ - pdfdata = pdffit2.getpdf_fit(self._handle) - return pdfdata - - def getpdf_obs(self): - """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. - """ - pdfdata = pdffit2.getpdf_obs(self._handle) - return pdfdata - - def getpdf_diff(self): - """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. - """ - Gdiff = pdffit2.getpdf_diff(self._handle) - return Gdiff - - def get_atoms(self, ip=None): - """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. - """ - if ip is None: - rv = pdffit2.get_atoms(self._handle) - else: - rv = pdffit2.get_atoms(self._handle, ip) - return rv - - def get_atom_types(self, ip=None): - """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. - """ - if ip is None: - rv = pdffit2.get_atom_types(self._handle) - else: - rv = pdffit2.get_atom_types(self._handle, ip) - return rv - - def getpar(self, par): - """getpar(par) --> Get value of parameter. - - Raises: ValueError if parameter does not exists - """ - return pdffit2.getpar(self._handle, par) - - def fixpar(self, par): - """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 - """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: - par = self.selalias[par.upper()] - pdffit2.fixpar(self._handle, par) - return - - def freepar(self, par): - """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 - """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: - par = self.selalias[par.upper()] - pdffit2.freepar(self._handle, par) - return - - def setphase(self, ip): - """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 - """ - pdffit2.setphase(self._handle, ip) - return - - def setdata(self, iset): - """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 - """ - pdffit2.setdata(self._handle, iset) - return - - def psel(self, ip): - """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 - """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: - ip = self.selalias[ip.upper()] - pdffit2.psel(self._handle, ip) - return - - def pdesel(self, ip): - """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 - """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: - ip = self.selalias[ip.upper()] - pdffit2.pdesel(self._handle, ip) - return - - def 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. - - 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 - """ - pdffit2.selectAtomType(self._handle, ip, six.b(ijchar), symbol, flag) - return - - def 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. - - 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 - """ - pdffit2.selectAtomIndex(self._handle, ip, six.b(ijchar), aidx, flag) - return - - def selectAll(self, ip, ijchar): - """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 - """ - pdffit2.selectAll(self._handle, ip, six.b(ijchar)) - return - - def selectNone(self, ip, ijchar): - """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 - """ - pdffit2.selectNone(self._handle, ip, six.b(ijchar)) - return - - def bang(self, i, j, k): - """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 - """ - angle, stdev = pdffit2.bond_angle(self._handle, i, j, k) - # indices should be already checked here by bond_angle - atom_symbols = self.get_atoms() - leader = " %s (#%i) - %s (#%i) - %s (#%i) = " % ( - atom_symbols[i - 1], - i, - atom_symbols[j - 1], - j, - atom_symbols[k - 1], - k, - ) - s = leader + _format_value_std(angle, stdev) + " degrees" - print(s, file=output.stdout) - return - - def bond_angle(self, i, j, k): - """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 - """ - rv = pdffit2.bond_angle(self._handle, i, j, k) - return rv - - def blen(self, *args): - """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 - """ - # first form - if len(args) == 2: - dij, ddij = self.bond_length_atoms(*args[0:2]) - atom_symbols = self.get_atoms() - ij = (args[0], args[1]) - # indices were already checked in bond_length_atoms call - assert (0 <= min(ij) - 1) and (max(ij) - 1 < len(atom_symbols)) - symij = (atom_symbols[ij[0] - 1].upper(), atom_symbols[ij[1] - 1].upper()) - print(_format_bond_length(dij, ddij, ij, symij), file=output.stdout) - # second form - elif len(args) == 4: - a1, a2, lb, ub = args - try: - atom_types = self.get_atom_types() - if isinstance(a1, numbers.Integral): - a1 = atom_types[a1 - 1] - if isinstance(a2, numbers.Integral): - a2 = atom_types[a2 - 1] - except IndexError: - # index of non-existant atom type - return - # arguments are OK here, get bond length dictionary - bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % (a1, a2, lb, ub) - print(s, file=output.stdout) - atom_symbols = self.get_atoms() - npts = len(bld["dij"]) - for idx in range(npts): - dij = bld["dij"][idx] - ddij = bld["ddij"][idx] - ij0 = bld["ij0"][idx] - ij1 = bld["ij1"][idx] - symij = (atom_symbols[ij0[0]], atom_symbols[ij0[1]]) - s = _format_bond_length(dij, ddij, ij1, symij) - print(s, file=output.stdout) - print(file=output.stdout) - if not bld["dij"]: - print(" *** No pairs found ***", file=output.stdout) - else: - emsg = "blen() takes 2 or 4 arguments (%i given)" % len(args) - raise TypeError(emsg) - # done - return - - def bond_length_atoms(self, i, j): - """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. - """ - rv = pdffit2.bond_length_atoms(self._handle, i, j) - return rv - - def bond_length_types(self, a1, a2, lb, ub): - """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. - """ - rv = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - return rv - - def show_scat(self, stype): - """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 - """ - print(self.get_scat_string(stype), file=output.stdout) - return - - def get_scat_string(self, stype): - """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. - """ - return pdffit2.get_scat_string(self._handle, six.b(stype)) - - def get_scat(self, stype, element): - """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. - """ - rv = pdffit2.get_scat(self._handle, six.b(stype), element) - return rv - - def set_scat(self, stype, element, value): - """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. - """ - pdffit2.set_scat(self._handle, six.b(stype), element, value) - return - - def reset_scat(self, element): - """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. - """ - pdffit2.reset_scat(self._handle, element) - return - - def num_atoms(self): - """num_atoms() --> Get number of atoms in current phase. - - Raises: pdffit2.unassignedError if no atoms exist - """ - return pdffit2.num_atoms(self._handle) - - def num_phases(self): - """num_phases() --> Number of phases loaded in PdfFit instance. - - Use setphase to bring a specific phase in focus. - - Return integer. - """ - n = pdffit2.num_phases(self._handle) - return n - - def num_datasets(self): - """num_datasets() --> Number of datasets loaded in PdfFit instance. - - Use setdata to bring a specific dataset in focus. - - Return integer. - """ - n = pdffit2.num_datasets(self._handle) - return n - - def phase_fractions(self): - """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. - """ - return pdffit2.phase_fractions(self._handle) - - # Begin refinable variables. - - def lat(n): - """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' - """ - LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} - if isinstance(n, six.string_types): - n = LatParams[n] - return "lat(%i)" % n - - lat = staticmethod(lat) - - def x(i): - """x(i) --> Get reference to x-value of atom i.""" - return "x(%i)" % i - - x = staticmethod(x) - - def y(i): - """y(i) --> Get reference to y-value of atom i.""" - return "y(%i)" % i - - y = staticmethod(y) - - def z(i): - """z(i) --> Get reference to z-value of atom i.""" - return "z(%i)" % i - - z = staticmethod(z) - - def u11(i): - """u11(i) --> Get reference to U(1,1) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u11(%i)" % i - - u11 = staticmethod(u11) - - def u22(i): - """u22(i) --> Get reference to U(2,2) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u22(%i)" % i - - u22 = staticmethod(u22) - - def u33(i): - """u33(i) --> Get reference to U(3,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u33(%i)" % i - - u33 = staticmethod(u33) - - def u12(i): - """u12(i) --> Get reference to U(1,2) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u12(%i)" % i - - u12 = staticmethod(u12) - - def u13(i): - """u13(i) --> Get reference to U(1,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u13(%i)" % i - - u13 = staticmethod(u13) - - def u23(i): - """u23(i) --> Get reference to U(2,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u23(%i)" % i - - u23 = staticmethod(u23) - - def occ(i): - """occ(i) --> Get reference to occupancy of atom i.""" - return "occ(%i)" % i - - occ = staticmethod(occ) - - def pscale(): - """pscale() --> Get reference to pscale. - - pscale is the fraction of the total structure that the current phase - represents. - """ - return "pscale" - - pscale = staticmethod(pscale) - - def sratio(): - """sratio() --> Get reference to sigma ratio. - - The sigma ratio determines the reduction in the Debye-Waller factor for - distances below rcut. - """ - return "sratio" - - sratio = staticmethod(sratio) - - def delta1(): - """delta1() --> Get reference to 1/R peak sharpening factor.""" - return "delta1" - - delta1 = staticmethod(delta1) - - def delta2(): - """delta2() --> Reference to (1/R^2) sharpening factor. - The phenomenological correlation constant in the Debye-Waller factor. - The (1/R^2) peak sharpening factor. - """ - return "delta2" - - delta2 = staticmethod(delta2) - - def dscale(): - """dscale() --> Get reference to dscale. - - The data scale factor. - """ - return "dscale" - - dscale = staticmethod(dscale) - - def qdamp(): - """qdamp() --> Get reference to qdamp. - - Qdamp controls PDF damping due to instrument Q-resolution. - """ - return "qdamp" - - qdamp = staticmethod(qdamp) - - def qbroad(): - """qbroad() --> Get reference to qbroad. - - Quadratic peak broadening factor. - """ - return "qbroad" - - qbroad = staticmethod(qbroad) - - def spdiameter(): - """spdiameter() --> Get reference to spdiameter (phase property). - - Diameter value for the spherical particle PDF correction. - Spherical envelope is not applied when spdiameter equals 0. - """ - return "spdiameter" - - spdiameter = staticmethod(spdiameter) - - def stepcut(): - """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. - """ - return "stepcut" - - stepcut = staticmethod(stepcut) - - def rcut(): - """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. - """ - return "rcut" - - rcut = staticmethod(rcut) - - # End refinable variables. - - def __init__(self): - - self.stru_files = [] - self.data_files = [] - - self._handle = pdffit2.create() - self.intro() - return - - def __getRef(self, var_string): - """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)) - """ - var_string = _convertCallable(var_string) - arg_int = None - try: - method_string, arg_string = var_string.split("(") - method_string = method_string.strip() - arg_int = int(arg_string.strip(")").strip()) - except ValueError: # There is no arg_string - method_string = var_string.strip() - - f = getattr(pdffit2, method_string) - if arg_int is None: - retval = f(self._handle) - else: - retval = f(self._handle, arg_int) - return retval - - -# End of class PdfFit - - -# End of file diff --git a/diffpy/pdffit2/tests/ExceptionsTest.py b/diffpy/pdffit2/tests/ExceptionsTest.py deleted file mode 100644 index 5dee1b75..00000000 --- a/diffpy/pdffit2/tests/ExceptionsTest.py +++ /dev/null @@ -1,794 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Chris Farrow -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - - -import unittest - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -class read_structExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure file does not exist""" - self.assertRaises(IOError, self.P.read_struct, "Nofile.stru") - - def test_structureError(self): - """raise pdffit2.structureError when structure is malformed""" - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNi.stru")) - - def test_structureErrorZeroVolume(self): - """raise pdffit2.structureError when unit cell volume is negative""" - # I don't know how to test for this, but it's in the library code - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNiZeroVolume.stru")) - - -class read_dataExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when data file does not exist""" - self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) - - def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" - self.assertRaises(pdffit2.dataError, self.P.read_data, datafile("badNi.dat"), "X", 25.0, 0.5) - - -class read_data_listsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.r_data = [0.1, 0.2] - self.Gr_data = [1, 2, 3] - self.qmax = 10 - self.qdamp = 0.5 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when lists are of different length""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data - ) - - def test_ValueError2(self): - """raise ValueError when qmax < 0""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data - ) - - def test_ValueError3(self): - """raise ValueError when qdamp < 0""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data - ) - - def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" - r_data = [0.1, 0.52, 0.2] - self.assertRaises( - pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data - ) - - -class pdfrangeExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.rmin = 4.0 - self.rmax = 10.0 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when iset does not exist""" - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) - - def test_ValueError2(self): - """raise ValueError when rmax < rmin""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) - - def test_ValueError3(self): - """raise ValueError when range outside of data""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) - - -class allocExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.qmax = 25 - self.qdamp = 0.5 - self.rmin = 4.0 - self.rmax = 10.0 - self.bin = 100 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when qmax < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) - - def test_ValueError2(self): - """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) - - def test_ValueError3(self): - """raise ValueError when rmin < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) - - def test_ValueError4(self): - """raise ValueError when rmax < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) - - def test_ValueError5(self): - """raise ValueError when bin < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) - - def test_ValueError6(self): - """raise ValueError when rmax < rmin""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) - - def test_ValueError7(self): - """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) - - -class calcExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no space has been allocated""" - self.assertRaises(pdffit2.unassignedError, self.P.calc) - - -# PJ 2006-03-06 -# -# test_calculationError raised exception, because for Qmax=0.5, rmax would -# increase to 4010A and this would throw exception when the size of bnd array -# would exceed MAXBND limit. However, bnd vector can now grow, thus rmax -# is not limited and the following test would hang indefinitely. - -# def test_calculationError(self): -# """raise pdffit2.calculationError when calculation cannot be done""" -# self.P.alloc('X', 0.01, 0.5, 2, 10, 100) -# self.assertRaises(pdffit2.calculationError, self.P.calc) - - -# class refineExceptions(unittest.TestCase): -# I'm not sure how to test these - -# def setUp(self): -# self.P = PdfFit() -# -# def test_calculationError(self): -# """raise pdffit2.calculationError when model pdf can't be calculated""" -# #self.assertRaises(pdffit2.calculationError, self.P.calc) -# -# def test_constraintError(self): -# """raise pdffit2.constraintError for bad constraint(s)""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -# class refine_stepExceptions(unittest.TestCase): -# I'm not sure how to test these - -# def setUp(self): -# self.P = PdfFit() -# -# def test_calculationError(self): -# """raise pdffit2.calculationError when model pdf can't be calculated""" -# #self.assertRaises(pdffit2.calculationError, self.P.calc) -# -# def test_constraintError(self): -# """raise pdffit2.constraintError for bad constraint(s)""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -class save_pdfExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.pdf" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.P.calc() - self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) - - -class save_difExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.dif" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when dif cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.P.calc() - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) - - -class save_resExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.resfile = "temp.res" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when residual file cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 30.0, 0.0) - self.P.constrain(self.P.lat(1), 1) - self.P.setpar(1, 3.0) - self.P.pdfrange(1, 2.0, 10.0) - self.P.refine_step() - self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) - - -class save_structExceptions(unittest.TestCase): - # Same code as show_struct - - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.stru" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) - - -class constrainExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.par = 1 - return - - def tearDown(self): - self.P = None - return - - def test_constraintError(self): - """raise constraintError when constraint is bad""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.constrain("x(1)", "junk+@1") - self.P.setpar(1, 0.01) - self.assertRaises(pdffit2.constraintError, self.P.calc) - self.assertRaises(pdffit2.constraintError, self.P.refine) - return - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) - return - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) - return - - def test_constrainNonRefVar(self): - "raise constraintError when attempting to constrain non-refinables" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") - return - - -class setvarExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.val = 3.0 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) - - -class getvarExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.getvar, self.P.lat(7)) - - -class getRExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getR) - - -class getpdf_fitExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_fit) - - -class getpdf_obsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_obs) - - -class getpdf_diffExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_diff) - - -class get_atomsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.get_atoms) - - -class getparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.constrain(self.P.lat(1), 2) - self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) - - -class pselExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.ip = 1 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - -class pdeselExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.ip = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - -class selectAtomTypeExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # selectAtomType should pass with one phase defined - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomType(self.iset, "i", "Ni", True) - self.P.selectAtomType(self.iset, "j", "Ni", False) - # but fail for phase 2 which is not present - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) - - def test_ijcharValueError(self): - """raise ValueError when ijchar is neither 'i' nor 'j'""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomType(self.iset, "i", "Ni", True) - self.P.selectAtomType(self.iset, "j", "Ni", True) - self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) - - -class selectAtomIndexExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # pass for phase 1 - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomIndex(self.iset, "i", 1, True) - self.P.selectAtomIndex(self.iset, "i", 2, False) - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) - - def test_ValueError(self): - """raise ValueError when selected atom does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) - - -class selectAllExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") - # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAll(self.iset, "i") - self.P.selectAll(self.iset, "j") - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "i") - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "j") - - -class selectNoneExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") - # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectNone(self.iset, "i") - self.P.selectNone(self.iset, "j") - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "i") - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "j") - - -class bangExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.a1 = 1 - self.a2 = 2 - self.a3 = 3 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) - - def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) - - def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) - - def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) - - -class blenExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.a1 = 1 - self.a2 = 2 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no data exists""" - self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) - - def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, 0, self.a2) - - def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, self.a1, 6) - - def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, 0, 6) - - -class show_scatExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.show_scat, "X") - - -# class set_scatExceptions(unittest.TestCase): -# I'm not sure how to use this function - -# def setUp(self): -# self.P = PdfFit() -# -# def test_unassignedError1(self): -# """raise pdffit2.unassignedError when phase does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) -# -# def test_unassignedError2(self): -# """raise pdffit2.unassignedError when phase does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) -# -# def test_ValueError(self): -# """raise pdffit2.unassignedError when selected atom does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -class num_atomsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no atoms exist""" - self.assertRaises(pdffit2.unassignedError, self.P.num_atoms) - - -class fixparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) - - -class freeparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) - - -class setphaseExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) - - -class setdataExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) - - -class getcrwExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getcrw) - - -# main -if __name__ == "__main__": - # suite = unittest.makeSuite(num_atomsExceptions) - # unittest.TextTestRunner(verbosity=3).run(suite) - # testcase = calcExceptions('test_unassignedError') - # unittest.TextTestRunner(verbosity=3).run(testcase) - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py deleted file mode 100644 index 70712356..00000000 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ /dev/null @@ -1,761 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for PdfFit.py -""" - -import unittest - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import capture_output, datafile -from diffpy.structure import loadStructure - -# ---------------------------------------------------------------------------- - - -class TestPdfFit(unittest.TestCase): - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - del self.P - return - - def test__exportAll(self): - "check PdfFit._exportAll()" - ns = {} - self.P._exportAll(ns) - self.assertEqual("ALL", ns["ALL"]) - self.assertEqual("FSQR", ns["FSQR"]) - self.assertEqual("N", ns["N"]) - self.assertIs("N", ns["N"]) - self.assertIs(self.P.lat, ns["lat"]) - self.assertEqual(self.P.reset, ns["reset"]) - return - - # def test_intro(self): - # """check PdfFit.intro() - # """ - # return - - def test_add_structure(self): - """check PdfFit.add_structure()""" - ni = loadStructure(datafile("Ni.stru")) - self.P.add_structure(ni) - self.assertEqual(4, self.P.num_atoms()) - return - - # def test_read_struct(self): - # """check PdfFit.read_struct() - # """ - # return - # - # def test_read_struct_string(self): - # """check PdfFit.read_struct_string() - # """ - # return - # - # def test_read_data(self): - # """check PdfFit.read_data() - # """ - # return - - def test_read_data_string(self): - """check PdfFit.read_data_string()""" - pf = self.P - with open(datafile("300K.gr")) as fp: - s = fp.read() - self.assertEqual([], pf.data_files) - pf.read_data_string(s, "N", 32, 0.03, "lmo") - self.assertEqual(1, len(pf.data_files)) - gobs = pf.getpdf_obs() - self.assertEqual(2000, len(gobs)) - self.assertEqual(0.384, gobs[-1]) - self.assertEqual(0.03, pf.getvar("qdamp")) - return - - # def test_read_data_lists(self): - # """check PdfFit.read_data_lists() - # """ - # return - # - # def test_pdfrange(self): - # """check PdfFit.pdfrange() - # """ - # return - # - # def test_reset(self): - # """check PdfFit.reset() - # """ - # return - - def test_alloc(self): - """check PdfFit.alloc()""" - # alloc and read_struct can be called in any order. - self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) - # without a structure calculated PDF is all zero - self.P.calc() - Gzero = self.P.getpdf_fit() - self.assertEqual(1000 * [0.0], Gzero) - self.P.read_struct(datafile("Ni.stru")) - self.P.calc() - # check r-values - r = self.P.getR() - self.assertEqual(1000, len(r)) - for i in range(1000): - self.assertAlmostEqual(0.01 * (i + 1), r[i], self.places) - Gfit_alloc_read = self.P.getpdf_fit() - # now try the other order - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) - self.P.calc() - Gfit_read_alloc = self.P.getpdf_fit() - # and they should be the same - self.assertEqual(Gfit_read_alloc, Gfit_alloc_read) - return - - # def test_calc(self): - # """check PdfFit.calc() - # """ - # return - # - # def test_refine(self): - # """check PdfFit.refine() - # """ - # return - # - # def test_refine_step(self): - # """check PdfFit.refine_step() - # """ - # return - # - # def test_save_pdf(self): - # """check PdfFit.save_pdf() - # """ - # return - # - # def test_save_pdf_string(self): - # """check PdfFit.save_pdf_string() - # """ - # return - # - # def test_save_dif(self): - # """check PdfFit.save_dif() - # """ - # return - # - # def test_save_dif_string(self): - # """check PdfFit.save_dif_string() - # """ - # return - # - # def test_save_res(self): - # """check PdfFit.save_res() - # """ - # return - # - # def test_save_res_string(self): - # """check PdfFit.save_res_string() - # """ - # return - - def test_get_structure(self): - """check PdfFit.get_structure()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - stru1 = self.P.get_structure(1) - self.assertEqual(4, len(stru1)) - self.assertEqual("Ni", stru1[0].element) - stru2 = self.P.get_structure(2) - self.assertEqual(56, len(stru2)) - self.assertEqual("Ti", stru2[-1].element) - return - - # def test_save_struct(self): - # """check PdfFit.save_struct() - # """ - # return - # - # def test_save_struct_string(self): - # """check PdfFit.save_struct_string() - # """ - # return - # - # def test_show_struct(self): - # """check PdfFit.show_struct() - # """ - # return - # - # def test_constrain(self): - # """check PdfFit.constrain() - # """ - # return - - def test_setpar(self): - """check PdfFit.setpar()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - pf.setpar(1, "lat(1)") - self.assertEqual(3.52, pf.getpar(1)) - pf.setpar(1, 4.0) - self.assertEqual(4, pf.getpar(1)) - pf.setpar(1, pf.lat("a")) - self.assertEqual(3.52, pf.getpar(1)) - return - - def test_setvar(self): - """check PdfFit.setvar()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - pf.setvar(pf.delta1, 1.2) - self.assertEqual(1.2, pf.getvar(pf.delta1)) - pf.setvar("delta1", 1.7) - self.assertEqual(1.7, pf.getvar("delta1")) - return - - # def test_getvar(self): - # """check PdfFit.getvar() - # """ - # return - # - # def test_getrw(self): - # """check PdfFit.getrw() - # """ - # return - # - # def test_getR(self): - # """check PdfFit.getR() - # """ - # return - # - # def test_getpdf_fit(self): - # """check PdfFit.getpdf_fit() - # """ - # return - # - # def test_getpdf_obs(self): - # """check PdfFit.getpdf_obs() - # """ - # return - # - # def test_getpdf_diff(self): - # """check PdfFit.getpdf_diff() - # """ - # return - - def test_get_atoms(self): - """check PdfFit.get_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.setphase(1) - a1 = self.P.get_atoms() - a2 = self.P.get_atoms(2) - self.assertEqual(4 * ["NI"], a1) - self.assertEqual(8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2) - return - - def test_get_atom_types(self): - """check PdfFit.get_atom_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.setphase(1) - atp1 = self.P.get_atom_types() - atp2 = self.P.get_atom_types(2) - self.assertEqual(["NI"], atp1) - self.assertEqual(["PB", "O", "SC", "W", "TI"], atp2) - return - - def test_num_phases(self): - """check PdfFit.num_phases()""" - self.assertEqual(0, self.P.num_phases()) - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(1, self.P.num_phases()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(2, self.P.num_phases()) - self.P.reset() - self.assertEqual(0, self.P.num_phases()) - return - - def test_num_datasets(self): - """check PdfFit.num_datasets()""" - self.assertEqual(0, self.P.num_datasets()) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertEqual(1, self.P.num_datasets()) - # failed data should not increase num_datasets - try: - self.P.read_data(datafile("badNi.dat")) - except (RuntimeError, TypeError, NameError, ValueError, IOError): - pass - self.assertEqual(1, self.P.num_datasets()) - # alloc should increase number of datasets - # alloc requires a loaded structure - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.assertEqual(2, self.P.num_datasets()) - self.P.reset() - self.assertEqual(0, self.P.num_datasets()) - return - - def test_getcrw(self): - """check PdfFit.getcrw()""" - import numpy - - self.assertEqual(0, self.P.num_datasets()) - # Setting qmax=0 so that partial crw are not disturbed by - # termination ripples. - self.P.read_data(datafile("Ni.dat"), "X", 0.0, 0.0) - # crw is empty before data refinement - self.assertEqual([], self.P.getcrw()) - self.P.read_struct(datafile("Ni.stru")) - self.P.pdfrange(1, 2, 19) - self.P.refine() - crw19 = numpy.array(self.P.getcrw()) - self.assertTrue(numpy.all(crw19 >= 0.0)) - # check that crw19 is non decreasing - self.assertTrue(numpy.all(numpy.diff(crw19) >= 0.0)) - # check that crw19 and getrw give the same value - rw19 = crw19[-1] - self.assertAlmostEqual(self.P.getrw(), rw19, self.places) - # renormalize cumulative Rw and compare with Rw at r=15 - Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) - r = numpy.array(self.P.getR()) - idx = numpy.nonzero(r <= 15)[0] - Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) - i15 = idx[-1] - rw15 = crw19[i15] * Gnorm19 / Gnorm15 - self.P.pdfrange(1, 2, r[i15] + 1e-5) - self.P.refine() - self.assertAlmostEqual(self.P.getrw(), rw15, self.places) - return - - def test_getcrw_two_datasets(self): - """check that getcrw() and getrw() are consistent for two datasets.""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.pdfrange(1, 2, 8) - self.P.read_data(datafile("300K.gr"), "N", 32.0, 0.0) - self.P.pdfrange(2, 1, 11) - self.P.read_struct(datafile("Ni.stru")) - # mess lattice parameters to have comparable Rw contributions - self.P.setvar("lat(1)", 3) - self.P.setvar("lat(2)", 3) - self.P.setvar("lat(3)", 3) - self.P.refine() - rwtot = self.P.getrw() - self.assertTrue(rwtot > 0.0) - self.P.setdata(1) - rw1 = self.P.getcrw()[-1] - self.P.setdata(2) - rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) - return - - # def test_getpar(self): - # """check PdfFit.getpar() - # """ - # return - - def test_fixpar(self): - """check PdfFit.fixpar()""" - self.P.fixpar("all") - self.assertRaises(TypeError, self.P.fixpar, "x") - return - - def test_freepar(self): - """check PdfFit.freepar()""" - self.P.freepar("all") - self.assertRaises(TypeError, self.P.freepar, "x") - return - - # def test_setphase(self): - # """check PdfFit.setphase() - # """ - # return - # - # def test_setdata(self): - # """check PdfFit.setdata() - # """ - # return - # - def test_psel(self): - """check PdfFit.psel()""" - - def doalloc(): - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - return - - self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 1) - self.P.read_struct(datafile("Ni.stru")) - doalloc() - self.P.calc() - G1 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.calc() - G2 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.pdesel("ALL") - self.P.psel(1) - self.P.calc() - self.assertEqual(G1, self.P.getpdf_fit()) - self.P.pdesel("ALL") - self.P.psel(2) - self.P.calc() - self.assertEqual(G2, self.P.getpdf_fit()) - self.P.psel("ALL") - self.P.calc() - Gall = self.P.getpdf_fit() - dGmax = max([abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)]) - self.assertAlmostEqual(0, dGmax, self.places) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 10) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.psel, -100) - return - - def test_pdesel(self): - """check PdfFit.pdesel()""" - - def doalloc(): - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - return - - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 1) - self.P.read_struct(datafile("Ni.stru")) - doalloc() - self.P.calc() - G1 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.calc() - G2 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.psel("ALL") - self.P.pdesel(2) - self.P.calc() - self.assertEqual(G1, self.P.getpdf_fit()) - self.P.psel("ALL") - self.P.pdesel(1) - self.P.calc() - self.assertEqual(G2, self.P.getpdf_fit()) - self.P.pdesel("ALL") - self.P.calc() - G0 = self.P.getpdf_fit() - self.assertEqual([0.0] * len(G0), G0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 10) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, -100) - return - - # - # def test_selectAtomType(self): - # """check PdfFit.selectAtomType() - # """ - # return - # - # def test_selectAtomIndex(self): - # """check PdfFit.selectAtomIndex() - # """ - # return - # - # def test_selectAll(self): - # """check PdfFit.selectAll() - # """ - # return - # - # def test_selectNone(self): - # """check PdfFit.selectNone() - # """ - # return - - def test_bond_angle(self): - """check PdfFit.bond_angle()""" - self.P.read_struct(datafile("Ni.stru")) - a, e = self.P.bond_angle(1, 2, 3) - self.assertAlmostEqual(60.0, a, self.places) - self.assertRaises(ValueError, self.P.bond_angle, 0, 1, 2) - self.assertRaises(ValueError, self.P.bond_angle, 1, 2, 7) - return - - def test_bang(self): - "check PdfFit.bang() function" - self.P.read_struct(datafile("Ni.stru")) - out = capture_output(self.P.bang, 1, 2, 3).strip() - self.assertTrue(out.endswith("60 degrees")) - self.assertTrue(out.startswith("NI (#1) - NI (#2) - NI (#3)")) - return - - def test_bond_length_atoms(self): - """check PdfFit.bond_length_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - dij, ddij = self.P.bond_length_atoms(1, 5) - self.assertAlmostEqual(4.03635, dij, self.places) - self.P.setphase(1) - self.assertRaises(ValueError, self.P.bond_length_atoms, 1, 5) - return - - def test_bond_length_types(self): - """check PdfFit.bond_length_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) - # check if keys are present - self.assertTrue("dij" in dPbO) - self.assertTrue("ddij" in dPbO) - self.assertTrue("ij0" in dPbO) - self.assertTrue("ij1" in dPbO) - # check if they have the same length - npts = len(dPbO["dij"]) - self.assertEqual(npts, len(dPbO["ddij"])) - self.assertEqual(npts, len(dPbO["ij0"])) - self.assertEqual(npts, len(dPbO["ij1"])) - # 8 Pb atoms have coordination 12 in perovskite structure - self.assertEqual(8 * 12, len(dPbO["dij"])) - self.P.setphase(1) - dfcc = self.P.bond_length_types("ALL", "ALL", 0.1, 2.6) - # 4 Ni atoms with coordination 12 - self.assertEqual(4 * 12, len(dfcc["dij"])) - # invalid element - self.assertRaises(ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0) - # check indices ij0 - allij0 = sum(dfcc["ij0"], tuple()) - self.assertEqual(0, min(allij0)) - self.assertEqual(3, max(allij0)) - # check indices ij1 - allij1 = sum(dfcc["ij1"], tuple()) - self.assertEqual(1, min(allij1)) - self.assertEqual(4, max(allij1)) - # check index values - ij0check = [(i1 - 1, j1 - 1) for i1, j1 in dfcc["ij1"]] - self.assertEqual(ij0check, dfcc["ij0"]) - # test valid element which is not present in the structure - dnone = self.P.bond_length_types("Ni", "Au", 0.1, 5.0) - self.assertEqual(0, len(dnone["dij"])) - self.assertEqual(0, len(dnone["ddij"])) - self.assertEqual(0, len(dnone["ij0"])) - self.assertEqual(0, len(dnone["ij1"])) - return - - def test_blen(self): - """check PdfFit.blen()""" - self.P.read_struct(datafile("PbScW25TiO3.stru")) - blen = self.P.blen - o = capture_output(blen, 1, 5).strip() - self.assertTrue(o.endswith("4.03635 A")) - self.assertTrue("PB (#1)" in o) - self.assertTrue("PB (#5)" in o) - self.assertRaises(ValueError, blen, 1, 99) - self.assertRaises(ValueError, blen, 0, 1) - o1 = capture_output(blen, 1, 1, 0.1, 1) - self.assertTrue("No pairs found" in o1) - o2 = capture_output(blen, 1, 50, 0.1, 1) - self.assertEqual("", o2) - o3 = capture_output(blen, "Sc", "O", 0.5, 2.3).strip() - self.assertEqual(1 + 48, len(o3.split("\n"))) - self.assertEqual(6, o3.count("SC (#33)")) - self.assertEqual(2, o3.count("O (#9)")) - self.assertRaises(TypeError, blen, "Sc", "O", 0.5) - return - - # def test_show_scat(self): - # """check PdfFit.show_scat() - # """ - # return - # - # def test_get_scat_string(self): - # """check PdfFit.get_scat_string() - # """ - # return - - def test_get_scat(self): - """check PdfFit.get_scat()""" - # x-ray scattering factors - fPb = self.P.get_scat("X", "Pb") - self.assertEqual(82.0, fPb) - fTi = self.P.get_scat("X", "tI") - self.assertEqual(22.0, fTi) - # neutron scattering lengths - bPb = self.P.get_scat("N", "PB") - self.assertAlmostEqual(9.401, bPb, 3) - bTi = self.P.get_scat("N", "ti") - self.assertAlmostEqual(-3.370, bTi, 3) - # exceptions - self.assertRaises(ValueError, self.P.get_scat, "N", "zz") - self.assertRaises(ValueError, self.P.get_scat, "Z", "Ti") - return - - def test_set_scat(self): - """check PdfFit.set_scat()""" - # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) - # check if it is local to phase - fPb = self.P.get_scat("X", "Pb") - bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("X", "Pb", 142) - self.assertEqual(142, self.P.get_scat("X", "Pb")) - self.assertEqual(bPb, self.P.get_scat("N", "Pb")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.setphase(1) - self.assertEqual(142, self.P.get_scat("X", "Pb")) - self.P.setphase(2) - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - # check exception for invalid inputs - self.assertRaises(ValueError, self.P.set_scat, "Z", "C", 123) - self.assertRaises(ValueError, self.P.set_scat, "X", "ZZ", 123) - return - - def test_reset_scat(self): - """check PdfFit.reset_scat()""" - # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, "Ti") - # check if it is local to phase - fPb = self.P.get_scat("X", "Pb") - bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("X", "Pb", 142) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("N", "Pb", -17) - self.P.setphase(1) - self.assertNotEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.reset_scat("Pb") - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.setphase(2) - self.assertNotEqual(bPb, self.P.get_scat("N", "Pb")) - self.P.reset_scat("Pb") - self.assertEqual(bPb, self.P.get_scat("N", "Pb")) - # check exception for invalid inputs - self.assertRaises(ValueError, self.P.reset_scat, "Zz") - return - - def test_num_atoms(self): - """check PdfFit.num_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(4, self.P.num_atoms()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(56, self.P.num_atoms()) - self.P.setphase(1) - self.assertEqual(4, self.P.num_atoms()) - self.P.setphase(2) - self.assertEqual(56, self.P.num_atoms()) - return - - def test_lat(self): - """check PdfFit.lat()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - for i in ("a", "b", "c", 1, 2, 3): - self.assertEqual(3.52, pf.getvar(pf.lat(i))) - for i in ("alpha", "beta", "gamma", 4, 5, 6): - self.assertEqual(90, pf.getvar(pf.lat(i))) - return - - def test_xyz(self): - """check PdfFit.x() PdfFit.y(), PdfFit.z()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - self.assertEqual(0.5, pf.getvar(pf.x(3))) - self.assertEqual(0, pf.getvar(pf.y(3))) - self.assertEqual(0.5, pf.getvar(pf.z(3))) - return - - def test_uij(self): - """check PdfFit.uij()""" - ni = loadStructure(datafile("Ni.stru")) - ni[2].anisotropy = True - ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 - ni[2].U12, ni[2].U13, ni[2].U23 = 4, 5, 6 - pf = self.P - pf.add_structure(ni) - self.assertEqual(1, pf.getvar(pf.u11(3))) - self.assertEqual(2, pf.getvar(pf.u22(3))) - self.assertEqual(3, pf.getvar(pf.u33(3))) - self.assertEqual(4, pf.getvar(pf.u12(3))) - self.assertEqual(5, pf.getvar(pf.u13(3))) - self.assertEqual(6, pf.getvar(pf.u23(3))) - return - - def test_occ(self): - """check PdfFit.occ()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - for i in range(1, 5): - self.assertEqual(1, pf.getvar(pf.occ(i))) - return - - -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_sratio(self): -# """check PdfFit.sratio() -# """ -# return -# -# def test_delta1(self): -# """check PdfFit.delta1() -# """ -# return -# -# def test_delta2(self): -# """check PdfFit.delta2() -# """ -# return -# -# def test_dscale(self): -# """check PdfFit.dscale() -# """ -# return -# -# def test_qdamp(self): -# """check PdfFit.qdamp() -# """ -# return -# -# def test_qbroad(self): -# """check PdfFit.qbroad() -# """ -# return -# -# def test_rcut(self): -# """check PdfFit.rcut() -# """ -# return -# -# def test___init__(self): -# """check PdfFit.__init__() -# """ -# return -# -# def test__PdfFit__getRef(self): -# """check PdfFit._PdfFit__getRef() -# """ -# return - -# End of class TestPdfFit - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py deleted file mode 100644 index afc57c06..00000000 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for phase fraction calculations. -""" - -import unittest - -from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -############################################################################## -class TestPhaseFractions(unittest.TestCase): - places = 4 - - def setUp(self): - self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.alloc("N", 0.0, 0.05, 0.1, 10, 200) - return - - def tearDown(self): - del self.P - return - - def test_xray_fractions(self): - """test_xray_fractions -- check phase fractions in x-ray dataset.""" - self.P.setdata(1) - ph = self.P.phase_fractions() - bb1 = 28**2 - bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 - self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) - mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) - self.assertEqual(0.0, sum(ph["stdatom"])) - self.assertEqual(0.0, sum(ph["stdcell"])) - self.assertEqual(0.0, sum(ph["stdmass"])) - self.P.setphase(1) - self.P.setvar("pscale", 2.0) - ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) - return - - def test_neutron_fractions(self): - """test_neutron_fractions -- check phase fractions in neutron dataset.""" - self.P.setdata(2) - ph = self.P.phase_fractions() - bb1 = 10.31**2 - bPb = 9.4012 - bO = 5.8054 - bSc = 12.11 - bW = 4.75518 - bTi = -3.37013 - bb2 = ((8 * bPb + 24 * bO + 4 * bSc + 2 * bW + 2 * bTi) / 40.0) ** 2 - self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) - mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) - self.assertEqual(0.0, sum(ph["stdatom"])) - self.assertEqual(0.0, sum(ph["stdcell"])) - self.assertEqual(0.0, sum(ph["stdmass"])) - self.P.setphase(1) - self.P.setvar("pscale", 2.0) - ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) - return - - -# End of class TestSphereEnvelope - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestShapeFactors.py b/diffpy/pdffit2/tests/TestShapeFactors.py deleted file mode 100644 index 1eaa9711..00000000 --- a/diffpy/pdffit2/tests/TestShapeFactors.py +++ /dev/null @@ -1,274 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for particle shape envelope factors. -""" - - -import unittest - -import numpy - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -def spherefactor(r, d): - """Calculate spherical envelope correction - - r -- PDF radius - d -- diameter of spherical particle - - Return numpy array of shape correction envelope. - """ - r1 = numpy.array(r) - fsph = 1.0 - 1.5 * r1 / d + 0.5 * (r1 / d) ** 3 - fsph[r1 > d] = 0.0 - return fsph - - -############################################################################## -class TestSphereEnvelope(unittest.TestCase): - - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - self.P = None - return - - def test_calculation(self): - """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.calc() - d = 8.0 - r = numpy.array(self.P.getR()) - G0 = numpy.array(self.P.getpdf_fit()) - self.P.setvar("spdiameter", d) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - dG = G0 * spherefactor(r, d) - G1 - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_refinement(self): - """check refinement of sphere envelope factor""" - dcheck = 8.0 - dstart = 12.0 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck) - self.P.calc() - r = numpy.array(self.P.getR()) - Gd8 = numpy.array(self.P.getpdf_fit()) - Gd8noise = Gd8 - Gd8noise[::2] += 0.01 - Gd8noise[1::2] -= 0.01 - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gd8noise)) - self.P.constrain("spdiameter", "@8") - self.P.setpar(8, dstart) - self.P.refine() - dfinal = self.P.getvar("spdiameter") - self.assertAlmostEqual(dcheck, dfinal, 3) - return - - def test_twophase_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" - d1 = 6 - d2 = 9 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", d1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", d2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setphase(1) - self.P.setvar("spdiameter", d1) - self.P.setphase(2) - self.P.setvar("spdiameter", d2) - self.P.calc() - Gtot = numpy.array(self.P.getpdf_fit()) - dG = G1 + G2 - Gtot - r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_twophase_refinement(self): - """check PDF refinement of 2 phases that have different spdiameter.""" - dcheck1 = 8.0 - dstart1 = 8.2 - dcheck2 = 6.0 - dstart2 = 5.5 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - r = numpy.array(self.P.getR()) - Gnoise = G1 + G2 - Gnoise[::2] += 0.01 - Gnoise[1::2] -= 0.01 - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gnoise)) - self.P.setphase(1) - self.P.constrain("spdiameter", "@11") - self.P.setphase(2) - self.P.constrain("spdiameter", "@12") - self.P.setpar(11, dstart1) - self.P.setpar(12, dstart2) - self.P.refine() - dfinal2 = self.P.getvar("spdiameter") - self.P.setphase(1) - dfinal1 = self.P.getvar("spdiameter") - self.assertAlmostEqual(dcheck1, dfinal1, 3) - self.assertAlmostEqual(dcheck2, dfinal2, 3) - return - - def test_spdiameter_io(self): - """Check reading and writing of spdiameter from structure file.""" - import re - - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(0.0, self.P.getvar("spdiameter")) - # engine should not write shape factor when not defined - spdnone = self.P.save_struct_string(1) - self.assertTrue(not re.search("(?m)^shape +sphere,", spdnone)) - self.P.setvar("spdiameter", 7) - spd7 = self.P.save_struct_string(1) - # spd7 should contain shape factor data - self.assertTrue(re.search("(?m)^shape +sphere,", spd7)) - self.P.reset() - self.P.read_struct_string(spd7) - self.assertEqual(7.0, self.P.getvar("spdiameter")) - # try to read without comma - spd14 = re.sub("(?m)^shape +sphere.*$", "shape sphere 14.00", spd7) - self.P.read_struct_string(spd14) - self.assertEqual(14.0, self.P.getvar("spdiameter")) - # try to read invalid shape data - sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", spd7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) - return - - -# End of class TestSphereEnvelope - - -############################################################################## -class TestStepCutEnvelope(unittest.TestCase): - - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - self.P = None - return - - def test_stepcut_calculation(self): - """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.calc() - stepcut = 8.0 - r = numpy.array(self.P.getR()) - G0 = numpy.array(self.P.getpdf_fit()) - G0[r > stepcut] = 0.0 - self.P.setvar("stepcut", stepcut) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - dG = G0 - G1 - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_twophase_stepcut_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" - d1 = 6 - d2 = 9 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("stepcut", d1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("stepcut", d2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setphase(1) - self.P.setvar("stepcut", d1) - self.P.setphase(2) - self.P.setvar("stepcut", d2) - self.P.calc() - Gtot = numpy.array(self.P.getpdf_fit()) - dG = G1 + G2 - Gtot - r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - # G after step should be zero - self.assertTrue(numpy.all(0 == Gtot[r > max(d1, d2)])) - return - - def test_stepcut_io(self): - """Check reading and writing of stepcut from structure file.""" - import re - - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(0.0, self.P.getvar("stepcut")) - # engine should not write shape factor when not defined - sscnone = self.P.save_struct_string(1) - self.assertTrue(not re.search("(?m)^shape +stepcut,", sscnone)) - self.P.setvar("stepcut", 7) - ssc7 = self.P.save_struct_string(1) - # ssc7 should contain shape factor data - self.assertTrue(re.search("(?m)^shape +stepcut,", ssc7)) - self.P.reset() - self.P.read_struct_string(ssc7) - self.assertEqual(7.0, self.P.getvar("stepcut")) - # try to read without comma - ssc14 = re.sub("(?m)^shape +stepcut.*$", "shape stepcut 14.00", ssc7) - self.P.read_struct_string(ssc14) - self.assertEqual(14.0, self.P.getvar("stepcut")) - # try to read invalid shape data - sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", ssc7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) - return - - -# End of class TestStepCutEnvelope - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/__init__.py b/diffpy/pdffit2/tests/__init__.py deleted file mode 100644 index e01060cf..00000000 --- a/diffpy/pdffit2/tests/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Unit tests for the diffpy.pdffit2 package. -""" - -import unittest - - -def testsuite(pattern=""): - """Create a unit tests suite for the diffpy.pdffit2 package. - - Parameters - ---------- - pattern : str, optional - Regular expression pattern for selecting test cases. - Select all tests when empty. Ignore the pattern when - any of unit test modules fails to import. - - Returns - ------- - suite : `unittest.TestSuite` - The TestSuite object containing the matching tests. - """ - import re - from itertools import chain - from os.path import dirname - - from pkg_resources import resource_filename - - loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, "") - depth = __name__.count(".") + 1 - topdir = thisdir - for i in range(depth): - topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) - # always filter the suite by pattern to test-cover the selection code. - suite = unittest.TestSuite() - rx = re.compile(pattern) - tsuites = list(chain.from_iterable(suite_all)) - tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover - return suite_all - tcases = chain.from_iterable(tsuites) - for tc in tcases: - tcwords = tc.id().split(".") - shortname = ".".join(tcwords[-3:]) - if rx.search(shortname): - suite.addTest(tc) - # verify all tests are found for an empty pattern. - assert pattern or suite_all.countTestCases() == suite.countTestCases() - return suite - - -def test(): - """Execute all unit tests for the diffpy.pdffit2 package. - - Returns - ------- - result : `unittest.TestResult` - """ - suite = testsuite() - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - -def testdeps(): - """Execute all unit tests for diffpy.pdffit2 and its dependencies. - - Returns - ------- - result : `unittest.TestResult` - """ - from importlib import import_module - - modulenames = """ - diffpy.pdffit2.tests - diffpy.structure.tests - """.split() - suite = unittest.TestSuite() - for mname in modulenames: - mod = import_module(mname) - suite.addTests(mod.testsuite()) - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - -# End of file diff --git a/diffpy/pdffit2/tests/debug.py b/diffpy/pdffit2/tests/debug.py deleted file mode 100644 index 83074005..00000000 --- a/diffpy/pdffit2/tests/debug.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 Complex Modeling Initiative -# (c) 2016 Brookhaven Science Associates, -# Brookhaven National Laboratory. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - - -"""\ -Convenience module for debugging the unit tests using - -python -m diffpy.pdffit2.tests.debug - -Exceptions raised by failed tests or other errors are not caught. -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testsuite - - pattern = sys.argv[1] if len(sys.argv) > 1 else "" - suite = testsuite(pattern) - suite.debug() - - -# End of file diff --git a/diffpy/pdffit2/tests/pdffit2testutils.py b/diffpy/pdffit2/tests/pdffit2testutils.py deleted file mode 100644 index ce61aa16..00000000 --- a/diffpy/pdffit2/tests/pdffit2testutils.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.srreal by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2010 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Helper routines for running other unit tests. -Import of this module suppresses the chatty output from the C++ extension. -""" - - -import os.path - -import six - -import diffpy.pdffit2 - -# silence the C++ engine output -diffpy.pdffit2.redirect_stdout(open(os.path.devnull, "w")) - -# path variables -thisfile = locals().get("__file__", "file.py") -tests_dir = os.path.dirname(os.path.abspath(thisfile)) -testdata_dir = os.path.join(tests_dir, "testdata") - - -def datafile(filename): - """prepend testdata_dir to filename.""" - return os.path.join(testdata_dir, filename) - - -def capture_output(f, *args, **kwargs): - """Capture output from pdffit2 engine produced in function call.""" - savestdout = diffpy.pdffit2.output.stdout - fp = six.StringIO() - diffpy.pdffit2.redirect_stdout(fp) - try: - f(*args, **kwargs) - finally: - diffpy.pdffit2.redirect_stdout(savestdout) - return fp.getvalue() - - -# End of file diff --git a/diffpy/pdffit2/tests/run.py b/diffpy/pdffit2/tests/run.py deleted file mode 100644 index 790e018d..00000000 --- a/diffpy/pdffit2/tests/run.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Convenience module for executing all unit tests with - -python -m diffpy.pdffit2.tests.run -""" - - -if __name__ == "__main__": - import sys - - # show warnings by default - if not sys.warnoptions: - import os - import warnings - - warnings.simplefilter("default") - # also affect subprocesses - os.environ["PYTHONWARNINGS"] = "default" - from diffpy.pdffit2.tests import test - - # produce zero exit code for a successful test - sys.exit(not test().wasSuccessful()) - -# End of file diff --git a/diffpy/pdffit2/tests/rundeps.py b/diffpy/pdffit2/tests/rundeps.py deleted file mode 100644 index 038475ae..00000000 --- a/diffpy/pdffit2/tests/rundeps.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Convenience module for executing unit tests for all pdffit2 dependencies - -python -m diffpy.pdffit2.tests.rundeps -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testdeps - - # produce zero exit code for a successful test - sys.exit(not testdeps().wasSuccessful()) - -# End of file diff --git a/diffpy/pdffit2/tests/testdata/300K.gr b/diffpy/pdffit2/tests/testdata/300K.gr deleted file mode 100644 index 15578911..00000000 --- a/diffpy/pdffit2/tests/testdata/300K.gr +++ /dev/null @@ -1,2062 +0,0 @@ -History written: Fri Apr 30 13:05:36 2004 -produced by -##### Run Information runCorrection=T -prep=gsas machine=npdf -run=300K background=npdf_00907 -smooth=2 smoothParam=32 32 0 backKillThresh=-1.0 -in beam: radius=0.635 height=2.54 -temp=308 runTitle=Run 1018: LMO - RT (before), HIPPO-furnace - -##### Vanadium runCorrection=T -run=npdf_00709 background=npdf_00710 -smooth=2 smoothParam=32 32 0 vanKillThresh=4.0 vBackKillThresh=-1.0 -in beam: radius=0.635 height=2.54 - -##### Container runCorrection=T -run=npdf_00917 background=npdf_00907 -smooth=2 smoothParam=32 32 0 cBackKillThresh=-1.0 -wallThick=0.023 atomDensity=0.072110 -atomic information: scattCS=5.100 absorpCS=5.080 - -##### Sample Material numElements=3 NormLaue=0.47445 -Element relAtomNum atomMass atomCoherCS atomIncoherCS atomAbsorpCS - O 0.6000 15.999 4.2320 0.0008 0.00019 - Mn 0.2000 54.931 -1.7500 0.4000 13.30000 - La 0.2000 138.905 8.5300 1.1300 8.97000 -density= effDensity=3.4138 - -##### Banks=6 deltaQ=0.01 matchRef=0 matchScal=T matchOffset=T -bank angle blendQmin blendQmax (0.0 means no info) - 1 90.0 1.62 29.42 - 2 -90.0 1.62 29.42 - 3 119.0 1.97 35.85 - 4 -119.0 1.97 35.85 - 5 148.0 2.20 40.00 - 6 -148.0 2.20 40.00 - -##### Program Specific Information -## Ft calcError=1 (1 for true, 0 for false) -numRpoints=2000 maxR=20.0 numDensity=0.0 intMaxR=1.5 -## Damp Qmin=2.0 Qmax=32 startDampQ=32 QAveMin=0.6 -dampFuncType=0 modEqn=1.0000*S(Q) +0.0000 +0.0000*Q dampExtraToZero=0 -## Blend numBanks=6 banks=1,2,3,4,5,6 -## Soqd minProcOut=0 -samPlazcek=0 vanPlazcek=0 smoothData=0 modifyData=1 -## Corps minProcOut=0 numBanksMiss=0 - -##### prepgsas prepOutput=1 numBanksMiss=0 fileExt=gsa -instParamFile=npdf_displex_757.iparm -numBanksAdd=0 -numBanksMult=6 -Bank# mulData mulBack - 1 1.0230 1.0000 - 2 1.0300 1.0000 - 3 1.0200 1.0000 - 4 0.9800 1.0000 - 5 0.9930 1.0000 - 6 0.9750 1.0000 -##### start data -#O0 rg_int sig_rg_int low_int sig_low_int rmax rhofit -#S 1 - PDF from PDFgetN -#P0 -4.09986 0.44295 0.11702 0.01370 1.50 0.0731 -#L r G(r) dr dG(r) - 0.010 0.086 0.0 0.0441 - 0.020 0.149 0.0 0.0849 - 0.030 0.169 0.0 0.1193 - 0.040 0.130 0.0 0.1448 - 0.050 0.021 0.0 0.1598 - 0.060 -0.160 0.0 0.1637 - 0.070 -0.410 0.0 0.1568 - 0.080 -0.717 0.0 0.1411 - 0.090 -1.064 0.0 0.1196 - 0.100 -1.428 0.0 0.0979 - 0.110 -1.782 0.0 0.0842 - 0.120 -2.101 0.0 0.0854 - 0.130 -2.359 0.0 0.0992 - 0.140 -2.535 0.0 0.1166 - 0.150 -2.612 0.0 0.1311 - 0.160 -2.581 0.0 0.1392 - 0.170 -2.440 0.0 0.1400 - 0.180 -2.196 0.0 0.1341 - 0.190 -1.863 0.0 0.1238 - 0.200 -1.462 0.0 0.1126 - 0.210 -1.017 0.0 0.1050 - 0.220 -0.556 0.0 0.1044 - 0.230 -0.109 0.0 0.1107 - 0.240 0.299 0.0 0.1202 - 0.250 0.643 0.0 0.1290 - 0.260 0.906 0.0 0.1341 - 0.270 1.077 0.0 0.1343 - 0.280 1.152 0.0 0.1298 - 0.290 1.134 0.0 0.1222 - 0.300 1.035 0.0 0.1143 - 0.310 0.870 0.0 0.1091 - 0.320 0.660 0.0 0.1090 - 0.330 0.426 0.0 0.1137 - 0.340 0.193 0.0 0.1209 - 0.350 -0.019 0.0 0.1275 - 0.360 -0.192 0.0 0.1313 - 0.370 -0.313 0.0 0.1313 - 0.380 -0.373 0.0 0.1276 - 0.390 -0.372 0.0 0.1217 - 0.400 -0.314 0.0 0.1156 - 0.410 -0.207 0.0 0.1119 - 0.420 -0.065 0.0 0.1121 - 0.430 0.095 0.0 0.1159 - 0.440 0.257 0.0 0.1215 - 0.450 0.404 0.0 0.1267 - 0.460 0.523 0.0 0.1295 - 0.470 0.601 0.0 0.1292 - 0.480 0.632 0.0 0.1259 - 0.490 0.614 0.0 0.1210 - 0.500 0.548 0.0 0.1163 - 0.510 0.443 0.0 0.1136 - 0.520 0.307 0.0 0.1141 - 0.530 0.152 0.0 0.1175 - 0.540 -0.007 0.0 0.1222 - 0.550 -0.158 0.0 0.1263 - 0.560 -0.290 0.0 0.1283 - 0.570 -0.393 0.0 0.1277 - 0.580 -0.461 0.0 0.1248 - 0.590 -0.493 0.0 0.1205 - 0.600 -0.490 0.0 0.1166 - 0.610 -0.458 0.0 0.1146 - 0.620 -0.404 0.0 0.1153 - 0.630 -0.338 0.0 0.1184 - 0.640 -0.271 0.0 0.1225 - 0.650 -0.214 0.0 0.1259 - 0.660 -0.176 0.0 0.1275 - 0.670 -0.163 0.0 0.1268 - 0.680 -0.180 0.0 0.1240 - 0.690 -0.228 0.0 0.1203 - 0.700 -0.306 0.0 0.1171 - 0.710 -0.409 0.0 0.1156 - 0.720 -0.529 0.0 0.1164 - 0.730 -0.659 0.0 0.1192 - 0.740 -0.789 0.0 0.1226 - 0.750 -0.910 0.0 0.1254 - 0.760 -1.015 0.0 0.1265 - 0.770 -1.097 0.0 0.1257 - 0.780 -1.153 0.0 0.1232 - 0.790 -1.181 0.0 0.1200 - 0.800 -1.185 0.0 0.1173 - 0.810 -1.166 0.0 0.1163 - 0.820 -1.132 0.0 0.1173 - 0.830 -1.088 0.0 0.1198 - 0.840 -1.043 0.0 0.1228 - 0.850 -1.002 0.0 0.1251 - 0.860 -0.973 0.0 0.1259 - 0.870 -0.958 0.0 0.1249 - 0.880 -0.961 0.0 0.1226 - 0.890 -0.982 0.0 0.1198 - 0.900 -1.018 0.0 0.1177 - 0.910 -1.066 0.0 0.1170 - 0.920 -1.122 0.0 0.1181 - 0.930 -1.179 0.0 0.1204 - 0.940 -1.232 0.0 0.1229 - 0.950 -1.277 0.0 0.1247 - 0.960 -1.308 0.0 0.1251 - 0.970 -1.324 0.0 0.1240 - 0.980 -1.325 0.0 0.1219 - 0.990 -1.311 0.0 0.1195 - 1.000 -1.287 0.0 0.1178 - 1.010 -1.255 0.0 0.1175 - 1.020 -1.222 0.0 0.1187 - 1.030 -1.192 0.0 0.1208 - 1.040 -1.170 0.0 0.1231 - 1.050 -1.161 0.0 0.1245 - 1.060 -1.165 0.0 0.1246 - 1.070 -1.185 0.0 0.1234 - 1.080 -1.217 0.0 0.1214 - 1.090 -1.260 0.0 0.1193 - 1.100 -1.309 0.0 0.1180 - 1.110 -1.358 0.0 0.1180 - 1.120 -1.401 0.0 0.1193 - 1.130 -1.432 0.0 0.1212 - 1.140 -1.448 0.0 0.1231 - 1.150 -1.443 0.0 0.1242 - 1.160 -1.417 0.0 0.1241 - 1.170 -1.371 0.0 0.1228 - 1.180 -1.307 0.0 0.1209 - 1.190 -1.230 0.0 0.1191 - 1.200 -1.147 0.0 0.1182 - 1.210 -1.065 0.0 0.1184 - 1.220 -0.992 0.0 0.1198 - 1.230 -0.934 0.0 0.1217 - 1.240 -0.898 0.0 0.1233 - 1.250 -0.888 0.0 0.1241 - 1.260 -0.905 0.0 0.1237 - 1.270 -0.950 0.0 0.1224 - 1.280 -1.019 0.0 0.1206 - 1.290 -1.106 0.0 0.1191 - 1.300 -1.205 0.0 0.1184 - 1.310 -1.306 0.0 0.1188 - 1.320 -1.400 0.0 0.1202 - 1.330 -1.479 0.0 0.1220 - 1.340 -1.534 0.0 0.1234 - 1.350 -1.562 0.0 0.1239 - 1.360 -1.557 0.0 0.1234 - 1.370 -1.519 0.0 0.1220 - 1.380 -1.452 0.0 0.1204 - 1.390 -1.360 0.0 0.1190 - 1.400 -1.251 0.0 0.1186 - 1.410 -1.133 0.0 0.1193 - 1.420 -1.017 0.0 0.1207 - 1.430 -0.913 0.0 0.1224 - 1.440 -0.830 0.0 0.1236 - 1.450 -0.775 0.0 0.1239 - 1.460 -0.755 0.0 0.1232 - 1.470 -0.770 0.0 0.1217 - 1.480 -0.822 0.0 0.1201 - 1.490 -0.906 0.0 0.1190 - 1.500 -1.017 0.0 0.1188 - 1.510 -1.147 0.0 0.1196 - 1.520 -1.285 0.0 0.1210 - 1.530 -1.422 0.0 0.1226 - 1.540 -1.548 0.0 0.1236 - 1.550 -1.653 0.0 0.1238 - 1.560 -1.730 0.0 0.1230 - 1.570 -1.774 0.0 0.1216 - 1.580 -1.781 0.0 0.1201 - 1.590 -1.753 0.0 0.1191 - 1.600 -1.691 0.0 0.1190 - 1.610 -1.600 0.0 0.1198 - 1.620 -1.487 0.0 0.1213 - 1.630 -1.360 0.0 0.1227 - 1.640 -1.227 0.0 0.1236 - 1.650 -1.097 0.0 0.1236 - 1.660 -0.977 0.0 0.1227 - 1.670 -0.876 0.0 0.1213 - 1.680 -0.797 0.0 0.1200 - 1.690 -0.747 0.0 0.1191 - 1.700 -0.727 0.0 0.1191 - 1.710 -0.739 0.0 0.1200 - 1.720 -0.782 0.0 0.1214 - 1.730 -0.858 0.0 0.1227 - 1.740 -0.964 0.0 0.1234 - 1.750 -1.099 0.0 0.1234 - 1.760 -1.262 0.0 0.1225 - 1.770 -1.452 0.0 0.1212 - 1.780 -1.668 0.0 0.1200 - 1.790 -1.908 0.0 0.1193 - 1.800 -2.171 0.0 0.1195 - 1.810 -2.456 0.0 0.1204 - 1.820 -2.758 0.0 0.1216 - 1.830 -3.075 0.0 0.1227 - 1.840 -3.401 0.0 0.1233 - 1.850 -3.730 0.0 0.1230 - 1.860 -4.053 0.0 0.1221 - 1.870 -4.362 0.0 0.1209 - 1.880 -4.647 0.0 0.1198 - 1.890 -4.897 0.0 0.1194 - 1.900 -5.103 0.0 0.1197 - 1.910 -5.256 0.0 0.1206 - 1.920 -5.349 0.0 0.1218 - 1.930 -5.378 0.0 0.1227 - 1.940 -5.342 0.0 0.1231 - 1.950 -5.241 0.0 0.1227 - 1.960 -5.081 0.0 0.1218 - 1.970 -4.869 0.0 0.1207 - 1.980 -4.618 0.0 0.1198 - 1.990 -4.340 0.0 0.1196 - 2.000 -4.050 0.0 0.1200 - 2.010 -3.762 0.0 0.1210 - 2.020 -3.493 0.0 0.1221 - 2.030 -3.253 0.0 0.1229 - 2.040 -3.056 0.0 0.1231 - 2.050 -2.907 0.0 0.1226 - 2.060 -2.811 0.0 0.1215 - 2.070 -2.769 0.0 0.1204 - 2.080 -2.778 0.0 0.1197 - 2.090 -2.831 0.0 0.1196 - 2.100 -2.918 0.0 0.1201 - 2.110 -3.029 0.0 0.1211 - 2.120 -3.150 0.0 0.1222 - 2.130 -3.270 0.0 0.1229 - 2.140 -3.377 0.0 0.1229 - 2.150 -3.460 0.0 0.1223 - 2.160 -3.511 0.0 0.1213 - 2.170 -3.525 0.0 0.1202 - 2.180 -3.499 0.0 0.1196 - 2.190 -3.432 0.0 0.1196 - 2.200 -3.327 0.0 0.1202 - 2.210 -3.188 0.0 0.1213 - 2.220 -3.019 0.0 0.1223 - 2.230 -2.825 0.0 0.1229 - 2.240 -2.613 0.0 0.1229 - 2.250 -2.385 0.0 0.1222 - 2.260 -2.145 0.0 0.1212 - 2.270 -1.895 0.0 0.1202 - 2.280 -1.633 0.0 0.1197 - 2.290 -1.359 0.0 0.1197 - 2.300 -1.069 0.0 0.1204 - 2.310 -0.761 0.0 0.1214 - 2.320 -0.431 0.0 0.1223 - 2.330 -0.077 0.0 0.1228 - 2.340 0.303 0.0 0.1227 - 2.350 0.706 0.0 0.1221 - 2.360 1.131 0.0 0.1211 - 2.370 1.571 0.0 0.1203 - 2.380 2.020 0.0 0.1198 - 2.390 2.466 0.0 0.1199 - 2.400 2.899 0.0 0.1206 - 2.410 3.309 0.0 0.1215 - 2.420 3.682 0.0 0.1223 - 2.430 4.010 0.0 0.1227 - 2.440 4.285 0.0 0.1225 - 2.450 4.501 0.0 0.1218 - 2.460 4.656 0.0 0.1210 - 2.470 4.751 0.0 0.1203 - 2.480 4.792 0.0 0.1200 - 2.490 4.788 0.0 0.1203 - 2.500 4.749 0.0 0.1210 - 2.510 4.688 0.0 0.1218 - 2.520 4.620 0.0 0.1225 - 2.530 4.558 0.0 0.1226 - 2.540 4.518 0.0 0.1223 - 2.550 4.508 0.0 0.1215 - 2.560 4.539 0.0 0.1207 - 2.570 4.615 0.0 0.1201 - 2.580 4.738 0.0 0.1200 - 2.590 4.907 0.0 0.1204 - 2.600 5.115 0.0 0.1212 - 2.610 5.354 0.0 0.1220 - 2.620 5.613 0.0 0.1226 - 2.630 5.882 0.0 0.1226 - 2.640 6.146 0.0 0.1222 - 2.650 6.395 0.0 0.1213 - 2.660 6.619 0.0 0.1205 - 2.670 6.808 0.0 0.1200 - 2.680 6.957 0.0 0.1200 - 2.690 7.063 0.0 0.1205 - 2.700 7.126 0.0 0.1214 - 2.710 7.148 0.0 0.1222 - 2.720 7.134 0.0 0.1227 - 2.730 7.090 0.0 0.1226 - 2.740 7.023 0.0 0.1221 - 2.750 6.941 0.0 0.1212 - 2.760 6.849 0.0 0.1204 - 2.770 6.754 0.0 0.1200 - 2.780 6.659 0.0 0.1201 - 2.790 6.567 0.0 0.1206 - 2.800 6.477 0.0 0.1215 - 2.810 6.388 0.0 0.1222 - 2.820 6.297 0.0 0.1226 - 2.830 6.201 0.0 0.1225 - 2.840 6.094 0.0 0.1219 - 2.850 5.972 0.0 0.1211 - 2.860 5.832 0.0 0.1204 - 2.870 5.671 0.0 0.1200 - 2.880 5.487 0.0 0.1202 - 2.890 5.281 0.0 0.1209 - 2.900 5.053 0.0 0.1217 - 2.910 4.807 0.0 0.1224 - 2.920 4.548 0.0 0.1227 - 2.930 4.279 0.0 0.1225 - 2.940 4.006 0.0 0.1218 - 2.950 3.734 0.0 0.1210 - 2.960 3.467 0.0 0.1203 - 2.970 3.208 0.0 0.1200 - 2.980 2.958 0.0 0.1202 - 2.990 2.720 0.0 0.1209 - 3.000 2.491 0.0 0.1218 - 3.010 2.269 0.0 0.1224 - 3.020 2.053 0.0 0.1227 - 3.030 1.838 0.0 0.1224 - 3.040 1.622 0.0 0.1217 - 3.050 1.402 0.0 0.1209 - 3.060 1.176 0.0 0.1202 - 3.070 0.942 0.0 0.1200 - 3.080 0.703 0.0 0.1203 - 3.090 0.459 0.0 0.1210 - 3.100 0.213 0.0 0.1218 - 3.110 -0.029 0.0 0.1224 - 3.120 -0.263 0.0 0.1226 - 3.130 -0.484 0.0 0.1223 - 3.140 -0.688 0.0 0.1216 - 3.150 -0.868 0.0 0.1208 - 3.160 -1.024 0.0 0.1202 - 3.170 -1.152 0.0 0.1201 - 3.180 -1.254 0.0 0.1204 - 3.190 -1.330 0.0 0.1211 - 3.200 -1.385 0.0 0.1218 - 3.210 -1.423 0.0 0.1223 - 3.220 -1.450 0.0 0.1224 - 3.230 -1.472 0.0 0.1220 - 3.240 -1.495 0.0 0.1214 - 3.250 -1.526 0.0 0.1206 - 3.260 -1.568 0.0 0.1202 - 3.270 -1.625 0.0 0.1201 - 3.280 -1.698 0.0 0.1205 - 3.290 -1.787 0.0 0.1212 - 3.300 -1.888 0.0 0.1220 - 3.310 -1.998 0.0 0.1224 - 3.320 -2.111 0.0 0.1224 - 3.330 -2.220 0.0 0.1219 - 3.340 -2.319 0.0 0.1212 - 3.350 -2.401 0.0 0.1205 - 3.360 -2.460 0.0 0.1201 - 3.370 -2.492 0.0 0.1201 - 3.380 -2.495 0.0 0.1206 - 3.390 -2.467 0.0 0.1213 - 3.400 -2.411 0.0 0.1220 - 3.410 -2.329 0.0 0.1224 - 3.420 -2.229 0.0 0.1223 - 3.430 -2.116 0.0 0.1219 - 3.440 -1.998 0.0 0.1212 - 3.450 -1.885 0.0 0.1205 - 3.460 -1.785 0.0 0.1202 - 3.470 -1.705 0.0 0.1202 - 3.480 -1.652 0.0 0.1207 - 3.490 -1.631 0.0 0.1214 - 3.500 -1.645 0.0 0.1220 - 3.510 -1.696 0.0 0.1223 - 3.520 -1.782 0.0 0.1222 - 3.530 -1.901 0.0 0.1217 - 3.540 -2.049 0.0 0.1211 - 3.550 -2.219 0.0 0.1205 - 3.560 -2.405 0.0 0.1203 - 3.570 -2.600 0.0 0.1204 - 3.580 -2.797 0.0 0.1209 - 3.590 -2.990 0.0 0.1215 - 3.600 -3.171 0.0 0.1220 - 3.610 -3.337 0.0 0.1223 - 3.620 -3.483 0.0 0.1221 - 3.630 -3.605 0.0 0.1216 - 3.640 -3.702 0.0 0.1210 - 3.650 -3.771 0.0 0.1205 - 3.660 -3.813 0.0 0.1204 - 3.670 -3.826 0.0 0.1206 - 3.680 -3.810 0.0 0.1211 - 3.690 -3.765 0.0 0.1217 - 3.700 -3.691 0.0 0.1221 - 3.710 -3.589 0.0 0.1222 - 3.720 -3.456 0.0 0.1219 - 3.730 -3.294 0.0 0.1214 - 3.740 -3.101 0.0 0.1209 - 3.750 -2.880 0.0 0.1205 - 3.760 -2.629 0.0 0.1205 - 3.770 -2.351 0.0 0.1208 - 3.780 -2.049 0.0 0.1213 - 3.790 -1.726 0.0 0.1219 - 3.800 -1.387 0.0 0.1222 - 3.810 -1.038 0.0 0.1222 - 3.820 -0.686 0.0 0.1219 - 3.830 -0.338 0.0 0.1213 - 3.840 -0.003 0.0 0.1208 - 3.850 0.312 0.0 0.1205 - 3.860 0.598 0.0 0.1205 - 3.870 0.848 0.0 0.1209 - 3.880 1.056 0.0 0.1215 - 3.890 1.215 0.0 0.1220 - 3.900 1.323 0.0 0.1223 - 3.910 1.377 0.0 0.1222 - 3.920 1.376 0.0 0.1218 - 3.930 1.322 0.0 0.1212 - 3.940 1.217 0.0 0.1206 - 3.950 1.065 0.0 0.1204 - 3.960 0.871 0.0 0.1205 - 3.970 0.640 0.0 0.1210 - 3.980 0.378 0.0 0.1216 - 3.990 0.091 0.0 0.1221 - 4.000 -0.215 0.0 0.1223 - 4.010 -0.536 0.0 0.1222 - 4.020 -0.866 0.0 0.1217 - 4.030 -1.203 0.0 0.1211 - 4.040 -1.543 0.0 0.1206 - 4.050 -1.884 0.0 0.1204 - 4.060 -2.224 0.0 0.1206 - 4.070 -2.562 0.0 0.1211 - 4.080 -2.896 0.0 0.1217 - 4.090 -3.225 0.0 0.1222 - 4.100 -3.547 0.0 0.1223 - 4.110 -3.859 0.0 0.1221 - 4.120 -4.159 0.0 0.1216 - 4.130 -4.443 0.0 0.1210 - 4.140 -4.707 0.0 0.1205 - 4.150 -4.946 0.0 0.1203 - 4.160 -5.155 0.0 0.1205 - 4.170 -5.329 0.0 0.1211 - 4.180 -5.463 0.0 0.1217 - 4.190 -5.552 0.0 0.1222 - 4.200 -5.595 0.0 0.1224 - 4.210 -5.588 0.0 0.1221 - 4.220 -5.529 0.0 0.1216 - 4.230 -5.421 0.0 0.1210 - 4.240 -5.265 0.0 0.1205 - 4.250 -5.064 0.0 0.1204 - 4.260 -4.824 0.0 0.1206 - 4.270 -4.551 0.0 0.1211 - 4.280 -4.251 0.0 0.1217 - 4.290 -3.932 0.0 0.1221 - 4.300 -3.602 0.0 0.1222 - 4.310 -3.268 0.0 0.1219 - 4.320 -2.936 0.0 0.1214 - 4.330 -2.613 0.0 0.1209 - 4.340 -2.302 0.0 0.1205 - 4.350 -2.007 0.0 0.1204 - 4.360 -1.729 0.0 0.1207 - 4.370 -1.469 0.0 0.1212 - 4.380 -1.226 0.0 0.1218 - 4.390 -0.996 0.0 0.1221 - 4.400 -0.779 0.0 0.1222 - 4.410 -0.569 0.0 0.1219 - 4.420 -0.365 0.0 0.1213 - 4.430 -0.162 0.0 0.1208 - 4.440 0.042 0.0 0.1205 - 4.450 0.248 0.0 0.1205 - 4.460 0.456 0.0 0.1208 - 4.470 0.667 0.0 0.1213 - 4.480 0.878 0.0 0.1218 - 4.490 1.086 0.0 0.1221 - 4.500 1.288 0.0 0.1220 - 4.510 1.481 0.0 0.1217 - 4.520 1.658 0.0 0.1212 - 4.530 1.818 0.0 0.1207 - 4.540 1.955 0.0 0.1204 - 4.550 2.067 0.0 0.1205 - 4.560 2.153 0.0 0.1208 - 4.570 2.213 0.0 0.1214 - 4.580 2.249 0.0 0.1218 - 4.590 2.262 0.0 0.1221 - 4.600 2.258 0.0 0.1220 - 4.610 2.241 0.0 0.1216 - 4.620 2.219 0.0 0.1211 - 4.630 2.198 0.0 0.1207 - 4.640 2.185 0.0 0.1204 - 4.650 2.185 0.0 0.1206 - 4.660 2.205 0.0 0.1209 - 4.670 2.249 0.0 0.1214 - 4.680 2.319 0.0 0.1219 - 4.690 2.416 0.0 0.1220 - 4.700 2.540 0.0 0.1219 - 4.710 2.688 0.0 0.1215 - 4.720 2.856 0.0 0.1210 - 4.730 3.037 0.0 0.1206 - 4.740 3.226 0.0 0.1204 - 4.750 3.413 0.0 0.1206 - 4.760 3.592 0.0 0.1210 - 4.770 3.755 0.0 0.1215 - 4.780 3.896 0.0 0.1219 - 4.790 4.007 0.0 0.1220 - 4.800 4.084 0.0 0.1219 - 4.810 4.125 0.0 0.1215 - 4.820 4.129 0.0 0.1210 - 4.830 4.094 0.0 0.1207 - 4.840 4.025 0.0 0.1206 - 4.850 3.923 0.0 0.1208 - 4.860 3.794 0.0 0.1212 - 4.870 3.642 0.0 0.1216 - 4.880 3.474 0.0 0.1219 - 4.890 3.295 0.0 0.1220 - 4.900 3.112 0.0 0.1218 - 4.910 2.928 0.0 0.1214 - 4.920 2.748 0.0 0.1210 - 4.930 2.576 0.0 0.1207 - 4.940 2.412 0.0 0.1207 - 4.950 2.258 0.0 0.1210 - 4.960 2.113 0.0 0.1214 - 4.970 1.977 0.0 0.1218 - 4.980 1.847 0.0 0.1220 - 4.990 1.720 0.0 0.1220 - 5.000 1.594 0.0 0.1217 - 5.010 1.467 0.0 0.1213 - 5.020 1.336 0.0 0.1209 - 5.030 1.199 0.0 0.1207 - 5.040 1.057 0.0 0.1208 - 5.050 0.908 0.0 0.1211 - 5.060 0.754 0.0 0.1215 - 5.070 0.597 0.0 0.1219 - 5.080 0.440 0.0 0.1220 - 5.090 0.286 0.0 0.1219 - 5.100 0.140 0.0 0.1216 - 5.110 0.005 0.0 0.1211 - 5.120 -0.113 0.0 0.1208 - 5.130 -0.212 0.0 0.1206 - 5.140 -0.288 0.0 0.1207 - 5.150 -0.338 0.0 0.1211 - 5.160 -0.360 0.0 0.1216 - 5.170 -0.356 0.0 0.1220 - 5.180 -0.325 0.0 0.1221 - 5.190 -0.270 0.0 0.1220 - 5.200 -0.195 0.0 0.1216 - 5.210 -0.104 0.0 0.1211 - 5.220 -0.003 0.0 0.1208 - 5.230 0.102 0.0 0.1207 - 5.240 0.205 0.0 0.1208 - 5.250 0.299 0.0 0.1212 - 5.260 0.378 0.0 0.1217 - 5.270 0.439 0.0 0.1220 - 5.280 0.476 0.0 0.1221 - 5.290 0.487 0.0 0.1219 - 5.300 0.472 0.0 0.1215 - 5.310 0.432 0.0 0.1210 - 5.320 0.368 0.0 0.1207 - 5.330 0.285 0.0 0.1206 - 5.340 0.188 0.0 0.1208 - 5.350 0.084 0.0 0.1212 - 5.360 -0.020 0.0 0.1217 - 5.370 -0.116 0.0 0.1220 - 5.380 -0.197 0.0 0.1220 - 5.390 -0.256 0.0 0.1218 - 5.400 -0.287 0.0 0.1214 - 5.410 -0.287 0.0 0.1209 - 5.420 -0.250 0.0 0.1206 - 5.430 -0.178 0.0 0.1206 - 5.440 -0.070 0.0 0.1208 - 5.450 0.070 0.0 0.1212 - 5.460 0.240 0.0 0.1217 - 5.470 0.433 0.0 0.1219 - 5.480 0.643 0.0 0.1219 - 5.490 0.863 0.0 0.1217 - 5.500 1.086 0.0 0.1212 - 5.510 1.306 0.0 0.1208 - 5.520 1.515 0.0 0.1206 - 5.530 1.711 0.0 0.1206 - 5.540 1.889 0.0 0.1209 - 5.550 2.048 0.0 0.1214 - 5.560 2.187 0.0 0.1218 - 5.570 2.307 0.0 0.1221 - 5.580 2.412 0.0 0.1220 - 5.590 2.504 0.0 0.1217 - 5.600 2.587 0.0 0.1213 - 5.610 2.664 0.0 0.1209 - 5.620 2.740 0.0 0.1206 - 5.630 2.817 0.0 0.1207 - 5.640 2.897 0.0 0.1210 - 5.650 2.979 0.0 0.1214 - 5.660 3.062 0.0 0.1218 - 5.670 3.144 0.0 0.1220 - 5.680 3.221 0.0 0.1219 - 5.690 3.287 0.0 0.1216 - 5.700 3.338 0.0 0.1212 - 5.710 3.366 0.0 0.1208 - 5.720 3.366 0.0 0.1206 - 5.730 3.333 0.0 0.1207 - 5.740 3.264 0.0 0.1210 - 5.750 3.156 0.0 0.1214 - 5.760 3.009 0.0 0.1218 - 5.770 2.825 0.0 0.1219 - 5.780 2.606 0.0 0.1218 - 5.790 2.357 0.0 0.1215 - 5.800 2.087 0.0 0.1211 - 5.810 1.802 0.0 0.1207 - 5.820 1.511 0.0 0.1206 - 5.830 1.222 0.0 0.1207 - 5.840 0.944 0.0 0.1210 - 5.850 0.684 0.0 0.1214 - 5.860 0.447 0.0 0.1218 - 5.870 0.238 0.0 0.1219 - 5.880 0.059 0.0 0.1217 - 5.890 -0.089 0.0 0.1214 - 5.900 -0.208 0.0 0.1210 - 5.910 -0.301 0.0 0.1207 - 5.920 -0.374 0.0 0.1206 - 5.930 -0.430 0.0 0.1208 - 5.940 -0.477 0.0 0.1212 - 5.950 -0.520 0.0 0.1216 - 5.960 -0.566 0.0 0.1219 - 5.970 -0.619 0.0 0.1219 - 5.980 -0.684 0.0 0.1217 - 5.990 -0.763 0.0 0.1214 - 6.000 -0.859 0.0 0.1210 - 6.010 -0.971 0.0 0.1207 - 6.020 -1.098 0.0 0.1207 - 6.030 -1.238 0.0 0.1209 - 6.040 -1.388 0.0 0.1212 - 6.050 -1.545 0.0 0.1216 - 6.060 -1.705 0.0 0.1219 - 6.070 -1.865 0.0 0.1220 - 6.080 -2.021 0.0 0.1217 - 6.090 -2.172 0.0 0.1214 - 6.100 -2.315 0.0 0.1210 - 6.110 -2.449 0.0 0.1207 - 6.120 -2.575 0.0 0.1207 - 6.130 -2.694 0.0 0.1209 - 6.140 -2.805 0.0 0.1213 - 6.150 -2.912 0.0 0.1217 - 6.160 -3.016 0.0 0.1219 - 6.170 -3.119 0.0 0.1219 - 6.180 -3.223 0.0 0.1217 - 6.190 -3.329 0.0 0.1213 - 6.200 -3.439 0.0 0.1210 - 6.210 -3.552 0.0 0.1208 - 6.220 -3.669 0.0 0.1208 - 6.230 -3.789 0.0 0.1211 - 6.240 -3.911 0.0 0.1214 - 6.250 -4.033 0.0 0.1217 - 6.260 -4.153 0.0 0.1219 - 6.270 -4.269 0.0 0.1218 - 6.280 -4.378 0.0 0.1216 - 6.290 -4.478 0.0 0.1213 - 6.300 -4.567 0.0 0.1210 - 6.310 -4.640 0.0 0.1208 - 6.320 -4.697 0.0 0.1209 - 6.330 -4.734 0.0 0.1212 - 6.340 -4.751 0.0 0.1215 - 6.350 -4.745 0.0 0.1218 - 6.360 -4.714 0.0 0.1219 - 6.370 -4.659 0.0 0.1218 - 6.380 -4.578 0.0 0.1215 - 6.390 -4.473 0.0 0.1211 - 6.400 -4.344 0.0 0.1209 - 6.410 -4.194 0.0 0.1208 - 6.420 -4.025 0.0 0.1209 - 6.430 -3.840 0.0 0.1212 - 6.440 -3.645 0.0 0.1215 - 6.450 -3.443 0.0 0.1218 - 6.460 -3.241 0.0 0.1219 - 6.470 -3.045 0.0 0.1217 - 6.480 -2.860 0.0 0.1214 - 6.490 -2.691 0.0 0.1211 - 6.500 -2.545 0.0 0.1208 - 6.510 -2.424 0.0 0.1208 - 6.520 -2.333 0.0 0.1210 - 6.530 -2.272 0.0 0.1213 - 6.540 -2.241 0.0 0.1217 - 6.550 -2.239 0.0 0.1219 - 6.560 -2.262 0.0 0.1219 - 6.570 -2.305 0.0 0.1216 - 6.580 -2.361 0.0 0.1213 - 6.590 -2.425 0.0 0.1209 - 6.600 -2.488 0.0 0.1207 - 6.610 -2.541 0.0 0.1207 - 6.620 -2.578 0.0 0.1209 - 6.630 -2.592 0.0 0.1213 - 6.640 -2.577 0.0 0.1216 - 6.650 -2.530 0.0 0.1219 - 6.660 -2.449 0.0 0.1218 - 6.670 -2.334 0.0 0.1216 - 6.680 -2.187 0.0 0.1213 - 6.690 -2.012 0.0 0.1209 - 6.700 -1.815 0.0 0.1207 - 6.710 -1.601 0.0 0.1207 - 6.720 -1.380 0.0 0.1209 - 6.730 -1.158 0.0 0.1213 - 6.740 -0.944 0.0 0.1216 - 6.750 -0.743 0.0 0.1218 - 6.760 -0.562 0.0 0.1218 - 6.770 -0.404 0.0 0.1216 - 6.780 -0.272 0.0 0.1212 - 6.790 -0.166 0.0 0.1209 - 6.800 -0.083 0.0 0.1208 - 6.810 -0.022 0.0 0.1208 - 6.820 0.023 0.0 0.1211 - 6.830 0.057 0.0 0.1214 - 6.840 0.088 0.0 0.1217 - 6.850 0.122 0.0 0.1218 - 6.860 0.164 0.0 0.1217 - 6.870 0.222 0.0 0.1214 - 6.880 0.299 0.0 0.1211 - 6.890 0.398 0.0 0.1208 - 6.900 0.521 0.0 0.1207 - 6.910 0.667 0.0 0.1208 - 6.920 0.835 0.0 0.1211 - 6.930 1.021 0.0 0.1215 - 6.940 1.221 0.0 0.1217 - 6.950 1.428 0.0 0.1218 - 6.960 1.636 0.0 0.1217 - 6.970 1.839 0.0 0.1214 - 6.980 2.030 0.0 0.1211 - 6.990 2.203 0.0 0.1209 - 7.000 2.353 0.0 0.1208 - 7.010 2.476 0.0 0.1209 - 7.020 2.569 0.0 0.1212 - 7.030 2.630 0.0 0.1215 - 7.040 2.660 0.0 0.1217 - 7.050 2.658 0.0 0.1217 - 7.060 2.627 0.0 0.1216 - 7.070 2.571 0.0 0.1213 - 7.080 2.493 0.0 0.1210 - 7.090 2.397 0.0 0.1207 - 7.100 2.289 0.0 0.1207 - 7.110 2.173 0.0 0.1209 - 7.120 2.053 0.0 0.1213 - 7.130 1.933 0.0 0.1216 - 7.140 1.819 0.0 0.1218 - 7.150 1.712 0.0 0.1218 - 7.160 1.615 0.0 0.1216 - 7.170 1.531 0.0 0.1213 - 7.180 1.461 0.0 0.1210 - 7.190 1.405 0.0 0.1209 - 7.200 1.366 0.0 0.1209 - 7.210 1.342 0.0 0.1211 - 7.220 1.333 0.0 0.1214 - 7.230 1.340 0.0 0.1217 - 7.240 1.363 0.0 0.1218 - 7.250 1.401 0.0 0.1218 - 7.260 1.455 0.0 0.1216 - 7.270 1.524 0.0 0.1213 - 7.280 1.608 0.0 0.1210 - 7.290 1.707 0.0 0.1208 - 7.300 1.823 0.0 0.1209 - 7.310 1.954 0.0 0.1211 - 7.320 2.099 0.0 0.1215 - 7.330 2.260 0.0 0.1217 - 7.340 2.434 0.0 0.1219 - 7.350 2.620 0.0 0.1218 - 7.360 2.816 0.0 0.1216 - 7.370 3.018 0.0 0.1213 - 7.380 3.224 0.0 0.1210 - 7.390 3.430 0.0 0.1209 - 7.400 3.631 0.0 0.1210 - 7.410 3.823 0.0 0.1213 - 7.420 4.001 0.0 0.1216 - 7.430 4.160 0.0 0.1218 - 7.440 4.297 0.0 0.1219 - 7.450 4.406 0.0 0.1218 - 7.460 4.486 0.0 0.1215 - 7.470 4.534 0.0 0.1212 - 7.480 4.550 0.0 0.1209 - 7.490 4.533 0.0 0.1208 - 7.500 4.485 0.0 0.1210 - 7.510 4.408 0.0 0.1212 - 7.520 4.306 0.0 0.1216 - 7.530 4.183 0.0 0.1218 - 7.540 4.044 0.0 0.1218 - 7.550 3.892 0.0 0.1217 - 7.560 3.733 0.0 0.1214 - 7.570 3.571 0.0 0.1211 - 7.580 3.409 0.0 0.1209 - 7.590 3.251 0.0 0.1208 - 7.600 3.097 0.0 0.1210 - 7.610 2.949 0.0 0.1213 - 7.620 2.804 0.0 0.1216 - 7.630 2.663 0.0 0.1218 - 7.640 2.523 0.0 0.1218 - 7.650 2.380 0.0 0.1216 - 7.660 2.233 0.0 0.1213 - 7.670 2.077 0.0 0.1210 - 7.680 1.911 0.0 0.1208 - 7.690 1.734 0.0 0.1208 - 7.700 1.543 0.0 0.1210 - 7.710 1.341 0.0 0.1213 - 7.720 1.128 0.0 0.1216 - 7.730 0.906 0.0 0.1218 - 7.740 0.681 0.0 0.1218 - 7.750 0.455 0.0 0.1216 - 7.760 0.234 0.0 0.1213 - 7.770 0.022 0.0 0.1209 - 7.780 -0.176 0.0 0.1208 - 7.790 -0.356 0.0 0.1208 - 7.800 -0.514 0.0 0.1210 - 7.810 -0.650 0.0 0.1213 - 7.820 -0.761 0.0 0.1216 - 7.830 -0.848 0.0 0.1218 - 7.840 -0.912 0.0 0.1217 - 7.850 -0.957 0.0 0.1215 - 7.860 -0.984 0.0 0.1212 - 7.870 -0.997 0.0 0.1209 - 7.880 -1.000 0.0 0.1208 - 7.890 -0.996 0.0 0.1208 - 7.900 -0.988 0.0 0.1210 - 7.910 -0.978 0.0 0.1213 - 7.920 -0.968 0.0 0.1216 - 7.930 -0.958 0.0 0.1217 - 7.940 -0.949 0.0 0.1217 - 7.950 -0.939 0.0 0.1214 - 7.960 -0.928 0.0 0.1211 - 7.970 -0.914 0.0 0.1209 - 7.980 -0.897 0.0 0.1207 - 7.990 -0.876 0.0 0.1208 - 8.000 -0.850 0.0 0.1211 - 8.010 -0.821 0.0 0.1214 - 8.020 -0.791 0.0 0.1217 - 8.030 -0.761 0.0 0.1218 - 8.040 -0.736 0.0 0.1217 - 8.050 -0.718 0.0 0.1215 - 8.060 -0.711 0.0 0.1211 - 8.070 -0.718 0.0 0.1209 - 8.080 -0.742 0.0 0.1208 - 8.090 -0.784 0.0 0.1209 - 8.100 -0.845 0.0 0.1211 - 8.110 -0.922 0.0 0.1214 - 8.120 -1.014 0.0 0.1217 - 8.130 -1.115 0.0 0.1218 - 8.140 -1.220 0.0 0.1216 - 8.150 -1.322 0.0 0.1214 - 8.160 -1.415 0.0 0.1211 - 8.170 -1.489 0.0 0.1208 - 8.180 -1.540 0.0 0.1208 - 8.190 -1.561 0.0 0.1209 - 8.200 -1.549 0.0 0.1212 - 8.210 -1.501 0.0 0.1215 - 8.220 -1.417 0.0 0.1217 - 8.230 -1.300 0.0 0.1218 - 8.240 -1.155 0.0 0.1217 - 8.250 -0.988 0.0 0.1214 - 8.260 -0.808 0.0 0.1211 - 8.270 -0.624 0.0 0.1209 - 8.280 -0.445 0.0 0.1209 - 8.290 -0.282 0.0 0.1210 - 8.300 -0.144 0.0 0.1213 - 8.310 -0.038 0.0 0.1216 - 8.320 0.030 0.0 0.1218 - 8.330 0.056 0.0 0.1218 - 8.340 0.039 0.0 0.1216 - 8.350 -0.020 0.0 0.1214 - 8.360 -0.119 0.0 0.1211 - 8.370 -0.253 0.0 0.1210 - 8.380 -0.415 0.0 0.1209 - 8.390 -0.598 0.0 0.1211 - 8.400 -0.794 0.0 0.1214 - 8.410 -0.996 0.0 0.1216 - 8.420 -1.195 0.0 0.1217 - 8.430 -1.387 0.0 0.1217 - 8.440 -1.565 0.0 0.1216 - 8.450 -1.725 0.0 0.1213 - 8.460 -1.864 0.0 0.1211 - 8.470 -1.980 0.0 0.1210 - 8.480 -2.073 0.0 0.1210 - 8.490 -2.143 0.0 0.1211 - 8.500 -2.189 0.0 0.1214 - 8.510 -2.213 0.0 0.1216 - 8.520 -2.215 0.0 0.1217 - 8.530 -2.196 0.0 0.1217 - 8.540 -2.156 0.0 0.1215 - 8.550 -2.096 0.0 0.1213 - 8.560 -2.016 0.0 0.1210 - 8.570 -1.916 0.0 0.1210 - 8.580 -1.798 0.0 0.1210 - 8.590 -1.664 0.0 0.1212 - 8.600 -1.516 0.0 0.1214 - 8.610 -1.358 0.0 0.1216 - 8.620 -1.194 0.0 0.1217 - 8.630 -1.030 0.0 0.1216 - 8.640 -0.872 0.0 0.1214 - 8.650 -0.728 0.0 0.1212 - 8.660 -0.604 0.0 0.1210 - 8.670 -0.508 0.0 0.1210 - 8.680 -0.446 0.0 0.1211 - 8.690 -0.423 0.0 0.1213 - 8.700 -0.442 0.0 0.1215 - 8.710 -0.505 0.0 0.1217 - 8.720 -0.611 0.0 0.1217 - 8.730 -0.758 0.0 0.1216 - 8.740 -0.941 0.0 0.1214 - 8.750 -1.154 0.0 0.1211 - 8.760 -1.387 0.0 0.1210 - 8.770 -1.633 0.0 0.1210 - 8.780 -1.883 0.0 0.1211 - 8.790 -2.127 0.0 0.1213 - 8.800 -2.357 0.0 0.1215 - 8.810 -2.568 0.0 0.1216 - 8.820 -2.753 0.0 0.1216 - 8.830 -2.911 0.0 0.1215 - 8.840 -3.041 0.0 0.1212 - 8.850 -3.144 0.0 0.1210 - 8.860 -3.222 0.0 0.1209 - 8.870 -3.280 0.0 0.1210 - 8.880 -3.323 0.0 0.1212 - 8.890 -3.357 0.0 0.1214 - 8.900 -3.384 0.0 0.1216 - 8.910 -3.411 0.0 0.1217 - 8.920 -3.438 0.0 0.1216 - 8.930 -3.467 0.0 0.1214 - 8.940 -3.498 0.0 0.1212 - 8.950 -3.529 0.0 0.1209 - 8.960 -3.554 0.0 0.1208 - 8.970 -3.571 0.0 0.1209 - 8.980 -3.574 0.0 0.1211 - 8.990 -3.556 0.0 0.1214 - 9.000 -3.515 0.0 0.1216 - 9.010 -3.445 0.0 0.1217 - 9.020 -3.346 0.0 0.1216 - 9.030 -3.215 0.0 0.1214 - 9.040 -3.055 0.0 0.1211 - 9.050 -2.869 0.0 0.1209 - 9.060 -2.661 0.0 0.1208 - 9.070 -2.438 0.0 0.1209 - 9.080 -2.207 0.0 0.1212 - 9.090 -1.976 0.0 0.1214 - 9.100 -1.752 0.0 0.1216 - 9.110 -1.542 0.0 0.1217 - 9.120 -1.351 0.0 0.1216 - 9.130 -1.183 0.0 0.1214 - 9.140 -1.041 0.0 0.1211 - 9.150 -0.925 0.0 0.1209 - 9.160 -0.835 0.0 0.1209 - 9.170 -0.768 0.0 0.1210 - 9.180 -0.720 0.0 0.1212 - 9.190 -0.688 0.0 0.1215 - 9.200 -0.666 0.0 0.1217 - 9.210 -0.651 0.0 0.1217 - 9.220 -0.638 0.0 0.1216 - 9.230 -0.626 0.0 0.1214 - 9.240 -0.611 0.0 0.1211 - 9.250 -0.593 0.0 0.1209 - 9.260 -0.572 0.0 0.1209 - 9.270 -0.546 0.0 0.1210 - 9.280 -0.518 0.0 0.1212 - 9.290 -0.487 0.0 0.1215 - 9.300 -0.453 0.0 0.1217 - 9.310 -0.416 0.0 0.1217 - 9.320 -0.372 0.0 0.1216 - 9.330 -0.320 0.0 0.1213 - 9.340 -0.255 0.0 0.1211 - 9.350 -0.172 0.0 0.1209 - 9.360 -0.066 0.0 0.1209 - 9.370 0.070 0.0 0.1211 - 9.380 0.241 0.0 0.1213 - 9.390 0.451 0.0 0.1215 - 9.400 0.704 0.0 0.1217 - 9.410 1.001 0.0 0.1217 - 9.420 1.341 0.0 0.1215 - 9.430 1.721 0.0 0.1213 - 9.440 2.135 0.0 0.1211 - 9.450 2.576 0.0 0.1210 - 9.460 3.035 0.0 0.1210 - 9.470 3.500 0.0 0.1211 - 9.480 3.959 0.0 0.1214 - 9.490 4.403 0.0 0.1216 - 9.500 4.819 0.0 0.1217 - 9.510 5.199 0.0 0.1217 - 9.520 5.536 0.0 0.1215 - 9.530 5.823 0.0 0.1213 - 9.540 6.060 0.0 0.1210 - 9.550 6.246 0.0 0.1209 - 9.560 6.384 0.0 0.1210 - 9.570 6.477 0.0 0.1211 - 9.580 6.533 0.0 0.1214 - 9.590 6.558 0.0 0.1216 - 9.600 6.558 0.0 0.1217 - 9.610 6.541 0.0 0.1216 - 9.620 6.512 0.0 0.1215 - 9.630 6.474 0.0 0.1212 - 9.640 6.430 0.0 0.1210 - 9.650 6.379 0.0 0.1210 - 9.660 6.321 0.0 0.1210 - 9.670 6.251 0.0 0.1212 - 9.680 6.166 0.0 0.1215 - 9.690 6.060 0.0 0.1216 - 9.700 5.929 0.0 0.1217 - 9.710 5.768 0.0 0.1216 - 9.720 5.574 0.0 0.1214 - 9.730 5.346 0.0 0.1212 - 9.740 5.085 0.0 0.1210 - 9.750 4.792 0.0 0.1210 - 9.760 4.472 0.0 0.1211 - 9.770 4.132 0.0 0.1213 - 9.780 3.778 0.0 0.1215 - 9.790 3.420 0.0 0.1216 - 9.800 3.065 0.0 0.1217 - 9.810 2.722 0.0 0.1216 - 9.820 2.398 0.0 0.1214 - 9.830 2.098 0.0 0.1211 - 9.840 1.826 0.0 0.1210 - 9.850 1.584 0.0 0.1210 - 9.860 1.371 0.0 0.1211 - 9.870 1.185 0.0 0.1213 - 9.880 1.021 0.0 0.1215 - 9.890 0.875 0.0 0.1217 - 9.900 0.741 0.0 0.1216 - 9.910 0.613 0.0 0.1215 - 9.920 0.485 0.0 0.1213 - 9.930 0.354 0.0 0.1211 - 9.940 0.216 0.0 0.1210 - 9.950 0.070 0.0 0.1210 - 9.960 -0.084 0.0 0.1211 - 9.970 -0.244 0.0 0.1213 - 9.980 -0.408 0.0 0.1215 - 9.990 -0.570 0.0 0.1217 - 10.000 -0.727 0.0 0.1216 - 10.010 -0.872 0.0 0.1215 - 10.020 -1.002 0.0 0.1212 - 10.030 -1.112 0.0 0.1210 - 10.040 -1.200 0.0 0.1209 - 10.050 -1.262 0.0 0.1210 - 10.060 -1.299 0.0 0.1212 - 10.070 -1.312 0.0 0.1214 - 10.080 -1.300 0.0 0.1216 - 10.090 -1.268 0.0 0.1217 - 10.100 -1.216 0.0 0.1216 - 10.110 -1.148 0.0 0.1214 - 10.120 -1.065 0.0 0.1212 - 10.130 -0.970 0.0 0.1210 - 10.140 -0.863 0.0 0.1209 - 10.150 -0.744 0.0 0.1210 - 10.160 -0.612 0.0 0.1212 - 10.170 -0.465 0.0 0.1214 - 10.180 -0.303 0.0 0.1216 - 10.190 -0.123 0.0 0.1217 - 10.200 0.075 0.0 0.1216 - 10.210 0.293 0.0 0.1214 - 10.220 0.529 0.0 0.1212 - 10.230 0.781 0.0 0.1210 - 10.240 1.044 0.0 0.1209 - 10.250 1.314 0.0 0.1210 - 10.260 1.582 0.0 0.1212 - 10.270 1.841 0.0 0.1214 - 10.280 2.081 0.0 0.1216 - 10.290 2.293 0.0 0.1217 - 10.300 2.466 0.0 0.1216 - 10.310 2.593 0.0 0.1213 - 10.320 2.666 0.0 0.1211 - 10.330 2.679 0.0 0.1209 - 10.340 2.630 0.0 0.1209 - 10.350 2.518 0.0 0.1210 - 10.360 2.343 0.0 0.1212 - 10.370 2.109 0.0 0.1215 - 10.380 1.822 0.0 0.1216 - 10.390 1.489 0.0 0.1217 - 10.400 1.119 0.0 0.1215 - 10.410 0.718 0.0 0.1213 - 10.420 0.298 0.0 0.1211 - 10.430 -0.135 0.0 0.1209 - 10.440 -0.574 0.0 0.1209 - 10.450 -1.012 0.0 0.1210 - 10.460 -1.444 0.0 0.1212 - 10.470 -1.868 0.0 0.1214 - 10.480 -2.282 0.0 0.1216 - 10.490 -2.685 0.0 0.1216 - 10.500 -3.077 0.0 0.1215 - 10.510 -3.458 0.0 0.1213 - 10.520 -3.829 0.0 0.1211 - 10.530 -4.190 0.0 0.1210 - 10.540 -4.541 0.0 0.1210 - 10.550 -4.879 0.0 0.1211 - 10.560 -5.204 0.0 0.1213 - 10.570 -5.511 0.0 0.1215 - 10.580 -5.797 0.0 0.1217 - 10.590 -6.059 0.0 0.1216 - 10.600 -6.290 0.0 0.1215 - 10.610 -6.489 0.0 0.1213 - 10.620 -6.650 0.0 0.1211 - 10.630 -6.771 0.0 0.1210 - 10.640 -6.850 0.0 0.1210 - 10.650 -6.888 0.0 0.1211 - 10.660 -6.886 0.0 0.1214 - 10.670 -6.845 0.0 0.1216 - 10.680 -6.769 0.0 0.1217 - 10.690 -6.663 0.0 0.1216 - 10.700 -6.532 0.0 0.1215 - 10.710 -6.380 0.0 0.1213 - 10.720 -6.212 0.0 0.1211 - 10.730 -6.032 0.0 0.1210 - 10.740 -5.844 0.0 0.1211 - 10.750 -5.648 0.0 0.1212 - 10.760 -5.445 0.0 0.1214 - 10.770 -5.234 0.0 0.1216 - 10.780 -5.013 0.0 0.1217 - 10.790 -4.780 0.0 0.1216 - 10.800 -4.529 0.0 0.1214 - 10.810 -4.257 0.0 0.1212 - 10.820 -3.959 0.0 0.1211 - 10.830 -3.633 0.0 0.1210 - 10.840 -3.274 0.0 0.1211 - 10.850 -2.880 0.0 0.1213 - 10.860 -2.452 0.0 0.1215 - 10.870 -1.989 0.0 0.1216 - 10.880 -1.494 0.0 0.1217 - 10.890 -0.970 0.0 0.1215 - 10.900 -0.421 0.0 0.1214 - 10.910 0.147 0.0 0.1211 - 10.920 0.727 0.0 0.1210 - 10.930 1.315 0.0 0.1210 - 10.940 1.901 0.0 0.1211 - 10.950 2.481 0.0 0.1213 - 10.960 3.047 0.0 0.1215 - 10.970 3.594 0.0 0.1217 - 10.980 4.115 0.0 0.1217 - 10.990 4.605 0.0 0.1216 - 11.000 5.060 0.0 0.1214 - 11.010 5.475 0.0 0.1212 - 11.020 5.846 0.0 0.1210 - 11.030 6.169 0.0 0.1210 - 11.040 6.441 0.0 0.1211 - 11.050 6.658 0.0 0.1213 - 11.060 6.817 0.0 0.1215 - 11.070 6.915 0.0 0.1216 - 11.080 6.950 0.0 0.1216 - 11.090 6.919 0.0 0.1215 - 11.100 6.823 0.0 0.1213 - 11.110 6.661 0.0 0.1211 - 11.120 6.434 0.0 0.1210 - 11.130 6.144 0.0 0.1210 - 11.140 5.793 0.0 0.1212 - 11.150 5.386 0.0 0.1214 - 11.160 4.929 0.0 0.1215 - 11.170 4.427 0.0 0.1216 - 11.180 3.888 0.0 0.1216 - 11.190 3.318 0.0 0.1214 - 11.200 2.725 0.0 0.1212 - 11.210 2.117 0.0 0.1211 - 11.220 1.502 0.0 0.1210 - 11.230 0.885 0.0 0.1210 - 11.240 0.272 0.0 0.1212 - 11.250 -0.330 0.0 0.1213 - 11.260 -0.918 0.0 0.1215 - 11.270 -1.488 0.0 0.1215 - 11.280 -2.037 0.0 0.1215 - 11.290 -2.563 0.0 0.1213 - 11.300 -3.065 0.0 0.1211 - 11.310 -3.539 0.0 0.1210 - 11.320 -3.986 0.0 0.1209 - 11.330 -4.404 0.0 0.1210 - 11.340 -4.791 0.0 0.1212 - 11.350 -5.146 0.0 0.1214 - 11.360 -5.467 0.0 0.1216 - 11.370 -5.752 0.0 0.1216 - 11.380 -5.999 0.0 0.1215 - 11.390 -6.206 0.0 0.1213 - 11.400 -6.371 0.0 0.1211 - 11.410 -6.493 0.0 0.1210 - 11.420 -6.571 0.0 0.1209 - 11.430 -6.605 0.0 0.1210 - 11.440 -6.595 0.0 0.1212 - 11.450 -6.543 0.0 0.1214 - 11.460 -6.450 0.0 0.1216 - 11.470 -6.319 0.0 0.1216 - 11.480 -6.154 0.0 0.1215 - 11.490 -5.958 0.0 0.1213 - 11.500 -5.735 0.0 0.1211 - 11.510 -5.488 0.0 0.1210 - 11.520 -5.222 0.0 0.1210 - 11.530 -4.940 0.0 0.1211 - 11.540 -4.646 0.0 0.1213 - 11.550 -4.342 0.0 0.1215 - 11.560 -4.031 0.0 0.1216 - 11.570 -3.713 0.0 0.1216 - 11.580 -3.391 0.0 0.1215 - 11.590 -3.064 0.0 0.1213 - 11.600 -2.734 0.0 0.1211 - 11.610 -2.399 0.0 0.1210 - 11.620 -2.062 0.0 0.1210 - 11.630 -1.720 0.0 0.1211 - 11.640 -1.375 0.0 0.1213 - 11.650 -1.026 0.0 0.1215 - 11.660 -0.673 0.0 0.1216 - 11.670 -0.319 0.0 0.1216 - 11.680 0.038 0.0 0.1215 - 11.690 0.395 0.0 0.1212 - 11.700 0.752 0.0 0.1210 - 11.710 1.106 0.0 0.1210 - 11.720 1.456 0.0 0.1210 - 11.730 1.800 0.0 0.1212 - 11.740 2.136 0.0 0.1214 - 11.750 2.461 0.0 0.1216 - 11.760 2.774 0.0 0.1217 - 11.770 3.071 0.0 0.1216 - 11.780 3.351 0.0 0.1215 - 11.790 3.611 0.0 0.1213 - 11.800 3.849 0.0 0.1211 - 11.810 4.063 0.0 0.1210 - 11.820 4.251 0.0 0.1210 - 11.830 4.411 0.0 0.1212 - 11.840 4.542 0.0 0.1214 - 11.850 4.644 0.0 0.1216 - 11.860 4.718 0.0 0.1216 - 11.870 4.763 0.0 0.1215 - 11.880 4.782 0.0 0.1214 - 11.890 4.776 0.0 0.1212 - 11.900 4.749 0.0 0.1210 - 11.910 4.704 0.0 0.1210 - 11.920 4.644 0.0 0.1211 - 11.930 4.574 0.0 0.1213 - 11.940 4.496 0.0 0.1215 - 11.950 4.416 0.0 0.1217 - 11.960 4.334 0.0 0.1217 - 11.970 4.254 0.0 0.1216 - 11.980 4.177 0.0 0.1214 - 11.990 4.102 0.0 0.1212 - 12.000 4.030 0.0 0.1211 - 12.010 3.959 0.0 0.1210 - 12.020 3.886 0.0 0.1211 - 12.030 3.809 0.0 0.1213 - 12.040 3.725 0.0 0.1215 - 12.050 3.631 0.0 0.1216 - 12.060 3.524 0.0 0.1217 - 12.070 3.403 0.0 0.1216 - 12.080 3.266 0.0 0.1214 - 12.090 3.115 0.0 0.1212 - 12.100 2.950 0.0 0.1211 - 12.110 2.775 0.0 0.1211 - 12.120 2.593 0.0 0.1212 - 12.130 2.411 0.0 0.1214 - 12.140 2.233 0.0 0.1215 - 12.150 2.066 0.0 0.1216 - 12.160 1.916 0.0 0.1216 - 12.170 1.789 0.0 0.1215 - 12.180 1.690 0.0 0.1213 - 12.190 1.622 0.0 0.1211 - 12.200 1.587 0.0 0.1210 - 12.210 1.587 0.0 0.1210 - 12.220 1.620 0.0 0.1211 - 12.230 1.684 0.0 0.1213 - 12.240 1.774 0.0 0.1215 - 12.250 1.886 0.0 0.1216 - 12.260 2.013 0.0 0.1216 - 12.270 2.150 0.0 0.1215 - 12.280 2.290 0.0 0.1213 - 12.290 2.427 0.0 0.1211 - 12.300 2.556 0.0 0.1210 - 12.310 2.673 0.0 0.1210 - 12.320 2.775 0.0 0.1212 - 12.330 2.860 0.0 0.1213 - 12.340 2.928 0.0 0.1215 - 12.350 2.979 0.0 0.1215 - 12.360 3.015 0.0 0.1215 - 12.370 3.036 0.0 0.1214 - 12.380 3.046 0.0 0.1212 - 12.390 3.045 0.0 0.1211 - 12.400 3.035 0.0 0.1210 - 12.410 3.016 0.0 0.1211 - 12.420 2.987 0.0 0.1212 - 12.430 2.947 0.0 0.1214 - 12.440 2.894 0.0 0.1215 - 12.450 2.825 0.0 0.1216 - 12.460 2.736 0.0 0.1215 - 12.470 2.625 0.0 0.1213 - 12.480 2.488 0.0 0.1211 - 12.490 2.322 0.0 0.1210 - 12.500 2.127 0.0 0.1209 - 12.510 1.901 0.0 0.1210 - 12.520 1.647 0.0 0.1212 - 12.530 1.367 0.0 0.1214 - 12.540 1.064 0.0 0.1215 - 12.550 0.745 0.0 0.1215 - 12.560 0.416 0.0 0.1214 - 12.570 0.083 0.0 0.1213 - 12.580 -0.245 0.0 0.1211 - 12.590 -0.561 0.0 0.1210 - 12.600 -0.858 0.0 0.1210 - 12.610 -1.131 0.0 0.1211 - 12.620 -1.376 0.0 0.1213 - 12.630 -1.588 0.0 0.1215 - 12.640 -1.767 0.0 0.1216 - 12.650 -1.912 0.0 0.1216 - 12.660 -2.026 0.0 0.1214 - 12.670 -2.111 0.0 0.1212 - 12.680 -2.172 0.0 0.1210 - 12.690 -2.212 0.0 0.1209 - 12.700 -2.237 0.0 0.1210 - 12.710 -2.251 0.0 0.1211 - 12.720 -2.259 0.0 0.1213 - 12.730 -2.264 0.0 0.1215 - 12.740 -2.269 0.0 0.1216 - 12.750 -2.276 0.0 0.1216 - 12.760 -2.285 0.0 0.1215 - 12.770 -2.297 0.0 0.1213 - 12.780 -2.310 0.0 0.1211 - 12.790 -2.324 0.0 0.1210 - 12.800 -2.336 0.0 0.1210 - 12.810 -2.345 0.0 0.1212 - 12.820 -2.350 0.0 0.1214 - 12.830 -2.349 0.0 0.1216 - 12.840 -2.343 0.0 0.1216 - 12.850 -2.333 0.0 0.1216 - 12.860 -2.319 0.0 0.1214 - 12.870 -2.303 0.0 0.1212 - 12.880 -2.289 0.0 0.1211 - 12.890 -2.279 0.0 0.1210 - 12.900 -2.275 0.0 0.1210 - 12.910 -2.282 0.0 0.1212 - 12.920 -2.301 0.0 0.1214 - 12.930 -2.333 0.0 0.1216 - 12.940 -2.381 0.0 0.1217 - 12.950 -2.444 0.0 0.1216 - 12.960 -2.521 0.0 0.1215 - 12.970 -2.612 0.0 0.1212 - 12.980 -2.712 0.0 0.1210 - 12.990 -2.820 0.0 0.1210 - 13.000 -2.931 0.0 0.1210 - 13.010 -3.043 0.0 0.1212 - 13.020 -3.150 0.0 0.1214 - 13.030 -3.251 0.0 0.1216 - 13.040 -3.342 0.0 0.1217 - 13.050 -3.420 0.0 0.1216 - 13.060 -3.485 0.0 0.1215 - 13.070 -3.535 0.0 0.1213 - 13.080 -3.570 0.0 0.1211 - 13.090 -3.592 0.0 0.1210 - 13.100 -3.601 0.0 0.1211 - 13.110 -3.599 0.0 0.1212 - 13.120 -3.589 0.0 0.1214 - 13.130 -3.571 0.0 0.1216 - 13.140 -3.549 0.0 0.1216 - 13.150 -3.524 0.0 0.1216 - 13.160 -3.497 0.0 0.1214 - 13.170 -3.469 0.0 0.1212 - 13.180 -3.441 0.0 0.1211 - 13.190 -3.412 0.0 0.1210 - 13.200 -3.381 0.0 0.1211 - 13.210 -3.349 0.0 0.1213 - 13.220 -3.314 0.0 0.1215 - 13.230 -3.273 0.0 0.1216 - 13.240 -3.226 0.0 0.1216 - 13.250 -3.170 0.0 0.1216 - 13.260 -3.105 0.0 0.1214 - 13.270 -3.028 0.0 0.1212 - 13.280 -2.939 0.0 0.1211 - 13.290 -2.836 0.0 0.1210 - 13.300 -2.719 0.0 0.1211 - 13.310 -2.587 0.0 0.1213 - 13.320 -2.440 0.0 0.1214 - 13.330 -2.277 0.0 0.1215 - 13.340 -2.100 0.0 0.1216 - 13.350 -1.907 0.0 0.1215 - 13.360 -1.701 0.0 0.1213 - 13.370 -1.483 0.0 0.1212 - 13.380 -1.252 0.0 0.1211 - 13.390 -1.012 0.0 0.1211 - 13.400 -0.763 0.0 0.1212 - 13.410 -0.508 0.0 0.1213 - 13.420 -0.251 0.0 0.1215 - 13.430 0.007 0.0 0.1216 - 13.440 0.261 0.0 0.1215 - 13.450 0.507 0.0 0.1214 - 13.460 0.743 0.0 0.1212 - 13.470 0.962 0.0 0.1211 - 13.480 1.162 0.0 0.1210 - 13.490 1.338 0.0 0.1210 - 13.500 1.486 0.0 0.1212 - 13.510 1.604 0.0 0.1213 - 13.520 1.689 0.0 0.1215 - 13.530 1.739 0.0 0.1216 - 13.540 1.755 0.0 0.1215 - 13.550 1.735 0.0 0.1214 - 13.560 1.682 0.0 0.1213 - 13.570 1.599 0.0 0.1212 - 13.580 1.489 0.0 0.1211 - 13.590 1.357 0.0 0.1211 - 13.600 1.208 0.0 0.1212 - 13.610 1.047 0.0 0.1213 - 13.620 0.882 0.0 0.1214 - 13.630 0.717 0.0 0.1215 - 13.640 0.559 0.0 0.1214 - 13.650 0.412 0.0 0.1213 - 13.660 0.282 0.0 0.1211 - 13.670 0.171 0.0 0.1211 - 13.680 0.081 0.0 0.1210 - 13.690 0.014 0.0 0.1211 - 13.700 -0.031 0.0 0.1213 - 13.710 -0.054 0.0 0.1214 - 13.720 -0.059 0.0 0.1215 - 13.730 -0.048 0.0 0.1215 - 13.740 -0.025 0.0 0.1214 - 13.750 0.006 0.0 0.1213 - 13.760 0.041 0.0 0.1211 - 13.770 0.075 0.0 0.1210 - 13.780 0.105 0.0 0.1210 - 13.790 0.128 0.0 0.1211 - 13.800 0.141 0.0 0.1213 - 13.810 0.143 0.0 0.1215 - 13.820 0.131 0.0 0.1216 - 13.830 0.107 0.0 0.1215 - 13.840 0.070 0.0 0.1214 - 13.850 0.021 0.0 0.1213 - 13.860 -0.039 0.0 0.1212 - 13.870 -0.109 0.0 0.1211 - 13.880 -0.187 0.0 0.1211 - 13.890 -0.273 0.0 0.1212 - 13.900 -0.364 0.0 0.1214 - 13.910 -0.461 0.0 0.1215 - 13.920 -0.564 0.0 0.1216 - 13.930 -0.671 0.0 0.1215 - 13.940 -0.782 0.0 0.1214 - 13.950 -0.897 0.0 0.1212 - 13.960 -1.017 0.0 0.1210 - 13.970 -1.138 0.0 0.1210 - 13.980 -1.261 0.0 0.1210 - 13.990 -1.381 0.0 0.1212 - 14.000 -1.497 0.0 0.1214 - 14.010 -1.605 0.0 0.1215 - 14.020 -1.699 0.0 0.1216 - 14.030 -1.774 0.0 0.1216 - 14.040 -1.825 0.0 0.1214 - 14.050 -1.846 0.0 0.1212 - 14.060 -1.830 0.0 0.1211 - 14.070 -1.775 0.0 0.1210 - 14.080 -1.674 0.0 0.1211 - 14.090 -1.526 0.0 0.1212 - 14.100 -1.330 0.0 0.1214 - 14.110 -1.085 0.0 0.1215 - 14.120 -0.795 0.0 0.1216 - 14.130 -0.463 0.0 0.1215 - 14.140 -0.094 0.0 0.1214 - 14.150 0.302 0.0 0.1212 - 14.160 0.720 0.0 0.1211 - 14.170 1.148 0.0 0.1211 - 14.180 1.579 0.0 0.1212 - 14.190 2.002 0.0 0.1213 - 14.200 2.410 0.0 0.1215 - 14.210 2.795 0.0 0.1216 - 14.220 3.150 0.0 0.1216 - 14.230 3.470 0.0 0.1215 - 14.240 3.753 0.0 0.1214 - 14.250 3.998 0.0 0.1212 - 14.260 4.203 0.0 0.1211 - 14.270 4.370 0.0 0.1211 - 14.280 4.503 0.0 0.1212 - 14.290 4.603 0.0 0.1213 - 14.300 4.674 0.0 0.1215 - 14.310 4.722 0.0 0.1216 - 14.320 4.748 0.0 0.1216 - 14.330 4.756 0.0 0.1215 - 14.340 4.750 0.0 0.1214 - 14.350 4.732 0.0 0.1212 - 14.360 4.703 0.0 0.1211 - 14.370 4.666 0.0 0.1211 - 14.380 4.622 0.0 0.1212 - 14.390 4.572 0.0 0.1213 - 14.400 4.519 0.0 0.1215 - 14.410 4.464 0.0 0.1215 - 14.420 4.410 0.0 0.1215 - 14.430 4.361 0.0 0.1215 - 14.440 4.320 0.0 0.1213 - 14.450 4.290 0.0 0.1212 - 14.460 4.276 0.0 0.1211 - 14.470 4.282 0.0 0.1211 - 14.480 4.310 0.0 0.1212 - 14.490 4.363 0.0 0.1214 - 14.500 4.442 0.0 0.1215 - 14.510 4.546 0.0 0.1216 - 14.520 4.674 0.0 0.1216 - 14.530 4.820 0.0 0.1215 - 14.540 4.980 0.0 0.1213 - 14.550 5.145 0.0 0.1211 - 14.560 5.308 0.0 0.1211 - 14.570 5.460 0.0 0.1211 - 14.580 5.591 0.0 0.1212 - 14.590 5.691 0.0 0.1213 - 14.600 5.752 0.0 0.1214 - 14.610 5.768 0.0 0.1215 - 14.620 5.734 0.0 0.1214 - 14.630 5.646 0.0 0.1213 - 14.640 5.503 0.0 0.1212 - 14.650 5.307 0.0 0.1211 - 14.660 5.063 0.0 0.1210 - 14.670 4.775 0.0 0.1211 - 14.680 4.451 0.0 0.1212 - 14.690 4.098 0.0 0.1214 - 14.700 3.724 0.0 0.1215 - 14.710 3.337 0.0 0.1215 - 14.720 2.945 0.0 0.1215 - 14.730 2.554 0.0 0.1213 - 14.740 2.166 0.0 0.1212 - 14.750 1.786 0.0 0.1211 - 14.760 1.414 0.0 0.1211 - 14.770 1.049 0.0 0.1211 - 14.780 0.689 0.0 0.1213 - 14.790 0.333 0.0 0.1214 - 14.800 -0.023 0.0 0.1215 - 14.810 -0.383 0.0 0.1215 - 14.820 -0.746 0.0 0.1215 - 14.830 -1.116 0.0 0.1213 - 14.840 -1.491 0.0 0.1212 - 14.850 -1.869 0.0 0.1211 - 14.860 -2.248 0.0 0.1211 - 14.870 -2.622 0.0 0.1211 - 14.880 -2.986 0.0 0.1213 - 14.890 -3.333 0.0 0.1214 - 14.900 -3.657 0.0 0.1215 - 14.910 -3.952 0.0 0.1215 - 14.920 -4.213 0.0 0.1214 - 14.930 -4.434 0.0 0.1213 - 14.940 -4.615 0.0 0.1212 - 14.950 -4.754 0.0 0.1211 - 14.960 -4.852 0.0 0.1211 - 14.970 -4.914 0.0 0.1212 - 14.980 -4.942 0.0 0.1213 - 14.990 -4.942 0.0 0.1215 - 15.000 -4.921 0.0 0.1215 - 15.010 -4.884 0.0 0.1215 - 15.020 -4.837 0.0 0.1214 - 15.030 -4.785 0.0 0.1213 - 15.040 -4.730 0.0 0.1211 - 15.050 -4.676 0.0 0.1211 - 15.060 -4.622 0.0 0.1211 - 15.070 -4.568 0.0 0.1212 - 15.080 -4.511 0.0 0.1213 - 15.090 -4.449 0.0 0.1215 - 15.100 -4.380 0.0 0.1215 - 15.110 -4.299 0.0 0.1215 - 15.120 -4.204 0.0 0.1214 - 15.130 -4.096 0.0 0.1212 - 15.140 -3.973 0.0 0.1211 - 15.150 -3.838 0.0 0.1211 - 15.160 -3.693 0.0 0.1211 - 15.170 -3.544 0.0 0.1213 - 15.180 -3.397 0.0 0.1214 - 15.190 -3.257 0.0 0.1215 - 15.200 -3.131 0.0 0.1215 - 15.210 -3.025 0.0 0.1215 - 15.220 -2.943 0.0 0.1213 - 15.230 -2.888 0.0 0.1212 - 15.240 -2.862 0.0 0.1211 - 15.250 -2.863 0.0 0.1211 - 15.260 -2.888 0.0 0.1212 - 15.270 -2.931 0.0 0.1213 - 15.280 -2.986 0.0 0.1215 - 15.290 -3.044 0.0 0.1216 - 15.300 -3.097 0.0 0.1216 - 15.310 -3.137 0.0 0.1215 - 15.320 -3.155 0.0 0.1213 - 15.330 -3.146 0.0 0.1212 - 15.340 -3.106 0.0 0.1211 - 15.350 -3.035 0.0 0.1211 - 15.360 -2.932 0.0 0.1212 - 15.370 -2.804 0.0 0.1213 - 15.380 -2.654 0.0 0.1215 - 15.390 -2.492 0.0 0.1216 - 15.400 -2.326 0.0 0.1216 - 15.410 -2.165 0.0 0.1215 - 15.420 -2.018 0.0 0.1213 - 15.430 -1.892 0.0 0.1212 - 15.440 -1.793 0.0 0.1211 - 15.450 -1.725 0.0 0.1211 - 15.460 -1.687 0.0 0.1212 - 15.470 -1.677 0.0 0.1214 - 15.480 -1.690 0.0 0.1215 - 15.490 -1.720 0.0 0.1216 - 15.500 -1.757 0.0 0.1216 - 15.510 -1.793 0.0 0.1215 - 15.520 -1.819 0.0 0.1213 - 15.530 -1.825 0.0 0.1212 - 15.540 -1.806 0.0 0.1211 - 15.550 -1.757 0.0 0.1211 - 15.560 -1.677 0.0 0.1212 - 15.570 -1.566 0.0 0.1214 - 15.580 -1.430 0.0 0.1215 - 15.590 -1.273 0.0 0.1216 - 15.600 -1.106 0.0 0.1215 - 15.610 -0.939 0.0 0.1214 - 15.620 -0.782 0.0 0.1213 - 15.630 -0.645 0.0 0.1211 - 15.640 -0.537 0.0 0.1211 - 15.650 -0.467 0.0 0.1211 - 15.660 -0.437 0.0 0.1212 - 15.670 -0.450 0.0 0.1214 - 15.680 -0.505 0.0 0.1215 - 15.690 -0.596 0.0 0.1216 - 15.700 -0.716 0.0 0.1215 - 15.710 -0.857 0.0 0.1214 - 15.720 -1.006 0.0 0.1212 - 15.730 -1.152 0.0 0.1211 - 15.740 -1.284 0.0 0.1210 - 15.750 -1.392 0.0 0.1211 - 15.760 -1.465 0.0 0.1212 - 15.770 -1.498 0.0 0.1214 - 15.780 -1.486 0.0 0.1215 - 15.790 -1.428 0.0 0.1215 - 15.800 -1.325 0.0 0.1215 - 15.810 -1.181 0.0 0.1213 - 15.820 -1.001 0.0 0.1212 - 15.830 -0.793 0.0 0.1211 - 15.840 -0.564 0.0 0.1210 - 15.850 -0.323 0.0 0.1211 - 15.860 -0.078 0.0 0.1212 - 15.870 0.164 0.0 0.1214 - 15.880 0.398 0.0 0.1215 - 15.890 0.619 0.0 0.1215 - 15.900 0.824 0.0 0.1214 - 15.910 1.010 0.0 0.1213 - 15.920 1.178 0.0 0.1211 - 15.930 1.328 0.0 0.1210 - 15.940 1.459 0.0 0.1210 - 15.950 1.574 0.0 0.1211 - 15.960 1.671 0.0 0.1212 - 15.970 1.752 0.0 0.1214 - 15.980 1.815 0.0 0.1215 - 15.990 1.860 0.0 0.1215 - 16.000 1.884 0.0 0.1214 - 16.010 1.885 0.0 0.1213 - 16.020 1.861 0.0 0.1212 - 16.030 1.810 0.0 0.1211 - 16.040 1.731 0.0 0.1211 - 16.050 1.623 0.0 0.1212 - 16.060 1.488 0.0 0.1213 - 16.070 1.326 0.0 0.1214 - 16.080 1.143 0.0 0.1215 - 16.090 0.942 0.0 0.1215 - 16.100 0.731 0.0 0.1214 - 16.110 0.516 0.0 0.1213 - 16.120 0.305 0.0 0.1211 - 16.130 0.106 0.0 0.1211 - 16.140 -0.075 0.0 0.1211 - 16.150 -0.230 0.0 0.1212 - 16.160 -0.355 0.0 0.1213 - 16.170 -0.444 0.0 0.1215 - 16.180 -0.496 0.0 0.1215 - 16.190 -0.510 0.0 0.1215 - 16.200 -0.484 0.0 0.1214 - 16.210 -0.421 0.0 0.1212 - 16.220 -0.323 0.0 0.1211 - 16.230 -0.192 0.0 0.1211 - 16.240 -0.032 0.0 0.1211 - 16.250 0.155 0.0 0.1212 - 16.260 0.366 0.0 0.1213 - 16.270 0.599 0.0 0.1215 - 16.280 0.852 0.0 0.1215 - 16.290 1.124 0.0 0.1215 - 16.300 1.413 0.0 0.1214 - 16.310 1.720 0.0 0.1212 - 16.320 2.042 0.0 0.1211 - 16.330 2.378 0.0 0.1211 - 16.340 2.725 0.0 0.1212 - 16.350 3.079 0.0 0.1213 - 16.360 3.437 0.0 0.1215 - 16.370 3.793 0.0 0.1216 - 16.380 4.141 0.0 0.1216 - 16.390 4.475 0.0 0.1215 - 16.400 4.786 0.0 0.1214 - 16.410 5.070 0.0 0.1212 - 16.420 5.319 0.0 0.1211 - 16.430 5.529 0.0 0.1211 - 16.440 5.696 0.0 0.1212 - 16.450 5.818 0.0 0.1213 - 16.460 5.897 0.0 0.1214 - 16.470 5.932 0.0 0.1215 - 16.480 5.929 0.0 0.1215 - 16.490 5.891 0.0 0.1215 - 16.500 5.825 0.0 0.1213 - 16.510 5.736 0.0 0.1212 - 16.520 5.630 0.0 0.1211 - 16.530 5.513 0.0 0.1211 - 16.540 5.388 0.0 0.1212 - 16.550 5.258 0.0 0.1213 - 16.560 5.123 0.0 0.1215 - 16.570 4.982 0.0 0.1215 - 16.580 4.832 0.0 0.1215 - 16.590 4.669 0.0 0.1214 - 16.600 4.487 0.0 0.1213 - 16.610 4.280 0.0 0.1212 - 16.620 4.045 0.0 0.1211 - 16.630 3.776 0.0 0.1211 - 16.640 3.472 0.0 0.1212 - 16.650 3.131 0.0 0.1214 - 16.660 2.757 0.0 0.1215 - 16.670 2.352 0.0 0.1216 - 16.680 1.925 0.0 0.1215 - 16.690 1.484 0.0 0.1214 - 16.700 1.040 0.0 0.1213 - 16.710 0.603 0.0 0.1212 - 16.720 0.185 0.0 0.1211 - 16.730 -0.203 0.0 0.1211 - 16.740 -0.553 0.0 0.1212 - 16.750 -0.856 0.0 0.1213 - 16.760 -1.110 0.0 0.1215 - 16.770 -1.313 0.0 0.1215 - 16.780 -1.465 0.0 0.1215 - 16.790 -1.573 0.0 0.1214 - 16.800 -1.643 0.0 0.1212 - 16.810 -1.684 0.0 0.1211 - 16.820 -1.705 0.0 0.1211 - 16.830 -1.716 0.0 0.1212 - 16.840 -1.727 0.0 0.1213 - 16.850 -1.746 0.0 0.1214 - 16.860 -1.778 0.0 0.1215 - 16.870 -1.826 0.0 0.1215 - 16.880 -1.892 0.0 0.1214 - 16.890 -1.972 0.0 0.1213 - 16.900 -2.062 0.0 0.1212 - 16.910 -2.154 0.0 0.1211 - 16.920 -2.241 0.0 0.1211 - 16.930 -2.313 0.0 0.1211 - 16.940 -2.362 0.0 0.1213 - 16.950 -2.379 0.0 0.1214 - 16.960 -2.360 0.0 0.1215 - 16.970 -2.299 0.0 0.1215 - 16.980 -2.197 0.0 0.1214 - 16.990 -2.055 0.0 0.1213 - 17.000 -1.878 0.0 0.1212 - 17.010 -1.673 0.0 0.1211 - 17.020 -1.449 0.0 0.1211 - 17.030 -1.216 0.0 0.1212 - 17.040 -0.985 0.0 0.1213 - 17.050 -0.766 0.0 0.1214 - 17.060 -0.568 0.0 0.1215 - 17.070 -0.398 0.0 0.1215 - 17.080 -0.261 0.0 0.1214 - 17.090 -0.159 0.0 0.1212 - 17.100 -0.093 0.0 0.1211 - 17.110 -0.060 0.0 0.1210 - 17.120 -0.056 0.0 0.1211 - 17.130 -0.073 0.0 0.1212 - 17.140 -0.105 0.0 0.1213 - 17.150 -0.146 0.0 0.1215 - 17.160 -0.187 0.0 0.1215 - 17.170 -0.223 0.0 0.1215 - 17.180 -0.250 0.0 0.1214 - 17.190 -0.266 0.0 0.1213 - 17.200 -0.270 0.0 0.1211 - 17.210 -0.264 0.0 0.1211 - 17.220 -0.252 0.0 0.1211 - 17.230 -0.237 0.0 0.1212 - 17.240 -0.226 0.0 0.1213 - 17.250 -0.225 0.0 0.1215 - 17.260 -0.238 0.0 0.1215 - 17.270 -0.270 0.0 0.1215 - 17.280 -0.325 0.0 0.1214 - 17.290 -0.405 0.0 0.1212 - 17.300 -0.509 0.0 0.1211 - 17.310 -0.636 0.0 0.1211 - 17.320 -0.782 0.0 0.1211 - 17.330 -0.943 0.0 0.1213 - 17.340 -1.114 0.0 0.1214 - 17.350 -1.289 0.0 0.1215 - 17.360 -1.462 0.0 0.1216 - 17.370 -1.629 0.0 0.1215 - 17.380 -1.783 0.0 0.1214 - 17.390 -1.923 0.0 0.1212 - 17.400 -2.046 0.0 0.1211 - 17.410 -2.151 0.0 0.1211 - 17.420 -2.237 0.0 0.1211 - 17.430 -2.307 0.0 0.1213 - 17.440 -2.360 0.0 0.1214 - 17.450 -2.399 0.0 0.1215 - 17.460 -2.425 0.0 0.1216 - 17.470 -2.439 0.0 0.1215 - 17.480 -2.441 0.0 0.1214 - 17.490 -2.431 0.0 0.1213 - 17.500 -2.407 0.0 0.1211 - 17.510 -2.369 0.0 0.1211 - 17.520 -2.313 0.0 0.1212 - 17.530 -2.239 0.0 0.1213 - 17.540 -2.145 0.0 0.1214 - 17.550 -2.031 0.0 0.1215 - 17.560 -1.896 0.0 0.1215 - 17.570 -1.743 0.0 0.1215 - 17.580 -1.575 0.0 0.1213 - 17.590 -1.397 0.0 0.1212 - 17.600 -1.216 0.0 0.1211 - 17.610 -1.038 0.0 0.1211 - 17.620 -0.873 0.0 0.1212 - 17.630 -0.727 0.0 0.1213 - 17.640 -0.610 0.0 0.1215 - 17.650 -0.528 0.0 0.1216 - 17.660 -0.486 0.0 0.1216 - 17.670 -0.488 0.0 0.1215 - 17.680 -0.536 0.0 0.1214 - 17.690 -0.628 0.0 0.1212 - 17.700 -0.761 0.0 0.1211 - 17.710 -0.930 0.0 0.1211 - 17.720 -1.127 0.0 0.1212 - 17.730 -1.343 0.0 0.1213 - 17.740 -1.570 0.0 0.1215 - 17.750 -1.797 0.0 0.1215 - 17.760 -2.015 0.0 0.1215 - 17.770 -2.217 0.0 0.1214 - 17.780 -2.396 0.0 0.1213 - 17.790 -2.547 0.0 0.1211 - 17.800 -2.666 0.0 0.1211 - 17.810 -2.754 0.0 0.1211 - 17.820 -2.810 0.0 0.1212 - 17.830 -2.837 0.0 0.1214 - 17.840 -2.839 0.0 0.1215 - 17.850 -2.819 0.0 0.1216 - 17.860 -2.781 0.0 0.1215 - 17.870 -2.730 0.0 0.1214 - 17.880 -2.668 0.0 0.1213 - 17.890 -2.599 0.0 0.1211 - 17.900 -2.522 0.0 0.1210 - 17.910 -2.438 0.0 0.1211 - 17.920 -2.346 0.0 0.1212 - 17.930 -2.244 0.0 0.1213 - 17.940 -2.130 0.0 0.1214 - 17.950 -2.001 0.0 0.1215 - 17.960 -1.855 0.0 0.1215 - 17.970 -1.690 0.0 0.1214 - 17.980 -1.505 0.0 0.1213 - 17.990 -1.302 0.0 0.1211 - 18.000 -1.080 0.0 0.1211 - 18.010 -0.845 0.0 0.1211 - 18.020 -0.598 0.0 0.1212 - 18.030 -0.344 0.0 0.1213 - 18.040 -0.090 0.0 0.1215 - 18.050 0.161 0.0 0.1215 - 18.060 0.404 0.0 0.1215 - 18.070 0.635 0.0 0.1214 - 18.080 0.849 0.0 0.1212 - 18.090 1.047 0.0 0.1211 - 18.100 1.226 0.0 0.1211 - 18.110 1.387 0.0 0.1211 - 18.120 1.532 0.0 0.1212 - 18.130 1.662 0.0 0.1214 - 18.140 1.779 0.0 0.1215 - 18.150 1.887 0.0 0.1215 - 18.160 1.987 0.0 0.1214 - 18.170 2.081 0.0 0.1213 - 18.180 2.170 0.0 0.1212 - 18.190 2.251 0.0 0.1211 - 18.200 2.325 0.0 0.1211 - 18.210 2.388 0.0 0.1212 - 18.220 2.437 0.0 0.1213 - 18.230 2.467 0.0 0.1214 - 18.240 2.475 0.0 0.1214 - 18.250 2.457 0.0 0.1215 - 18.260 2.410 0.0 0.1214 - 18.270 2.332 0.0 0.1213 - 18.280 2.224 0.0 0.1212 - 18.290 2.086 0.0 0.1211 - 18.300 1.922 0.0 0.1211 - 18.310 1.736 0.0 0.1212 - 18.320 1.534 0.0 0.1213 - 18.330 1.324 0.0 0.1214 - 18.340 1.113 0.0 0.1215 - 18.350 0.909 0.0 0.1215 - 18.360 0.719 0.0 0.1214 - 18.370 0.550 0.0 0.1213 - 18.380 0.406 0.0 0.1212 - 18.390 0.291 0.0 0.1211 - 18.400 0.207 0.0 0.1211 - 18.410 0.153 0.0 0.1212 - 18.420 0.127 0.0 0.1213 - 18.430 0.126 0.0 0.1214 - 18.440 0.145 0.0 0.1215 - 18.450 0.180 0.0 0.1215 - 18.460 0.224 0.0 0.1214 - 18.470 0.273 0.0 0.1213 - 18.480 0.323 0.0 0.1212 - 18.490 0.370 0.0 0.1212 - 18.500 0.413 0.0 0.1212 - 18.510 0.452 0.0 0.1213 - 18.520 0.486 0.0 0.1214 - 18.530 0.519 0.0 0.1215 - 18.540 0.553 0.0 0.1215 - 18.550 0.592 0.0 0.1214 - 18.560 0.640 0.0 0.1213 - 18.570 0.700 0.0 0.1212 - 18.580 0.775 0.0 0.1212 - 18.590 0.866 0.0 0.1212 - 18.600 0.973 0.0 0.1212 - 18.610 1.097 0.0 0.1213 - 18.620 1.233 0.0 0.1214 - 18.630 1.379 0.0 0.1215 - 18.640 1.530 0.0 0.1215 - 18.650 1.681 0.0 0.1215 - 18.660 1.827 0.0 0.1213 - 18.670 1.963 0.0 0.1212 - 18.680 2.085 0.0 0.1212 - 18.690 2.188 0.0 0.1212 - 18.700 2.271 0.0 0.1212 - 18.710 2.333 0.0 0.1213 - 18.720 2.374 0.0 0.1215 - 18.730 2.396 0.0 0.1215 - 18.740 2.402 0.0 0.1215 - 18.750 2.394 0.0 0.1214 - 18.760 2.376 0.0 0.1213 - 18.770 2.351 0.0 0.1212 - 18.780 2.323 0.0 0.1211 - 18.790 2.292 0.0 0.1211 - 18.800 2.261 0.0 0.1212 - 18.810 2.228 0.0 0.1214 - 18.820 2.193 0.0 0.1215 - 18.830 2.154 0.0 0.1215 - 18.840 2.106 0.0 0.1215 - 18.850 2.047 0.0 0.1214 - 18.860 1.973 0.0 0.1213 - 18.870 1.880 0.0 0.1211 - 18.880 1.767 0.0 0.1211 - 18.890 1.631 0.0 0.1211 - 18.900 1.474 0.0 0.1212 - 18.910 1.296 0.0 0.1213 - 18.920 1.100 0.0 0.1214 - 18.930 0.892 0.0 0.1215 - 18.940 0.678 0.0 0.1215 - 18.950 0.462 0.0 0.1214 - 18.960 0.254 0.0 0.1213 - 18.970 0.060 0.0 0.1212 - 18.980 -0.114 0.0 0.1211 - 18.990 -0.262 0.0 0.1212 - 19.000 -0.380 0.0 0.1213 - 19.010 -0.465 0.0 0.1214 - 19.020 -0.517 0.0 0.1215 - 19.030 -0.536 0.0 0.1215 - 19.040 -0.526 0.0 0.1214 - 19.050 -0.490 0.0 0.1213 - 19.060 -0.434 0.0 0.1212 - 19.070 -0.363 0.0 0.1211 - 19.080 -0.284 0.0 0.1211 - 19.090 -0.203 0.0 0.1211 - 19.100 -0.125 0.0 0.1212 - 19.110 -0.055 0.0 0.1214 - 19.120 0.005 0.0 0.1215 - 19.130 0.054 0.0 0.1215 - 19.140 0.090 0.0 0.1214 - 19.150 0.114 0.0 0.1213 - 19.160 0.130 0.0 0.1212 - 19.170 0.139 0.0 0.1211 - 19.180 0.146 0.0 0.1211 - 19.190 0.152 0.0 0.1212 - 19.200 0.161 0.0 0.1213 - 19.210 0.175 0.0 0.1214 - 19.220 0.195 0.0 0.1215 - 19.230 0.221 0.0 0.1215 - 19.240 0.253 0.0 0.1214 - 19.250 0.287 0.0 0.1213 - 19.260 0.321 0.0 0.1212 - 19.270 0.351 0.0 0.1211 - 19.280 0.373 0.0 0.1211 - 19.290 0.383 0.0 0.1212 - 19.300 0.377 0.0 0.1213 - 19.310 0.354 0.0 0.1214 - 19.320 0.310 0.0 0.1215 - 19.330 0.245 0.0 0.1215 - 19.340 0.160 0.0 0.1214 - 19.350 0.057 0.0 0.1213 - 19.360 -0.060 0.0 0.1212 - 19.370 -0.187 0.0 0.1211 - 19.380 -0.320 0.0 0.1211 - 19.390 -0.453 0.0 0.1212 - 19.400 -0.580 0.0 0.1213 - 19.410 -0.696 0.0 0.1214 - 19.420 -0.798 0.0 0.1215 - 19.430 -0.880 0.0 0.1215 - 19.440 -0.942 0.0 0.1214 - 19.450 -0.981 0.0 0.1213 - 19.460 -0.999 0.0 0.1211 - 19.470 -0.996 0.0 0.1211 - 19.480 -0.976 0.0 0.1211 - 19.490 -0.941 0.0 0.1212 - 19.500 -0.896 0.0 0.1213 - 19.510 -0.845 0.0 0.1214 - 19.520 -0.793 0.0 0.1215 - 19.530 -0.743 0.0 0.1215 - 19.540 -0.699 0.0 0.1214 - 19.550 -0.664 0.0 0.1213 - 19.560 -0.641 0.0 0.1212 - 19.570 -0.631 0.0 0.1211 - 19.580 -0.634 0.0 0.1211 - 19.590 -0.650 0.0 0.1212 - 19.600 -0.678 0.0 0.1214 - 19.610 -0.718 0.0 0.1215 - 19.620 -0.767 0.0 0.1215 - 19.630 -0.825 0.0 0.1215 - 19.640 -0.888 0.0 0.1214 - 19.650 -0.957 0.0 0.1213 - 19.660 -1.028 0.0 0.1212 - 19.670 -1.102 0.0 0.1211 - 19.680 -1.176 0.0 0.1212 - 19.690 -1.250 0.0 0.1213 - 19.700 -1.323 0.0 0.1214 - 19.710 -1.395 0.0 0.1215 - 19.720 -1.463 0.0 0.1215 - 19.730 -1.529 0.0 0.1215 - 19.740 -1.589 0.0 0.1214 - 19.750 -1.643 0.0 0.1213 - 19.760 -1.690 0.0 0.1212 - 19.770 -1.727 0.0 0.1212 - 19.780 -1.754 0.0 0.1212 - 19.790 -1.767 0.0 0.1213 - 19.800 -1.767 0.0 0.1214 - 19.810 -1.751 0.0 0.1215 - 19.820 -1.720 0.0 0.1215 - 19.830 -1.672 0.0 0.1215 - 19.840 -1.609 0.0 0.1213 - 19.850 -1.530 0.0 0.1212 - 19.860 -1.438 0.0 0.1211 - 19.870 -1.334 0.0 0.1211 - 19.880 -1.219 0.0 0.1212 - 19.890 -1.097 0.0 0.1213 - 19.900 -0.969 0.0 0.1214 - 19.910 -0.837 0.0 0.1215 - 19.920 -0.703 0.0 0.1215 - 19.930 -0.568 0.0 0.1214 - 19.940 -0.432 0.0 0.1213 - 19.950 -0.298 0.0 0.1212 - 19.960 -0.163 0.0 0.1211 - 19.970 -0.028 0.0 0.1211 - 19.980 0.108 0.0 0.1212 - 19.990 0.245 0.0 0.1213 - 20.000 0.384 0.0 0.1214 diff --git a/diffpy/pdffit2/tests/testdata/Ni.dat b/diffpy/pdffit2/tests/testdata/Ni.dat deleted file mode 100644 index 360a4d6b..00000000 --- a/diffpy/pdffit2/tests/testdata/Ni.dat +++ /dev/null @@ -1,1001 +0,0 @@ - 1.50000 -0.539443 0.00000 1.00000 0.539443 - 1.51850 -1.03098 0.00000 1.00000 1.03098 - 1.53700 -1.43712 0.00000 1.00000 1.43712 - 1.55550 -1.73810 0.00000 1.00000 1.73810 - 1.57400 -1.93402 0.00000 1.00000 1.93402 - 1.59250 -2.04145 0.00000 1.00000 2.04145 - 1.61100 -2.08593 0.00000 1.00000 2.08593 - 1.62950 -2.09295 0.00000 1.00000 2.09295 - 1.64800 -2.08072 0.00000 1.00000 2.08072 - 1.66650 -2.05688 0.00000 1.00000 2.05688 - 1.68500 -2.02006 0.00000 1.00000 2.02006 - 1.70350 -1.96554 0.00000 1.00000 1.96554 - 1.72200 -1.89239 0.00000 1.00000 1.89239 - 1.74050 -1.80936 0.00000 1.00000 1.80936 - 1.75900 -1.73670 0.00000 1.00000 1.73670 - 1.77750 -1.70255 0.00000 1.00000 1.70255 - 1.79600 -1.73461 0.00000 1.00000 1.73461 - 1.81450 -1.84946 0.00000 1.00000 1.84946 - 1.83300 -2.04300 0.00000 1.00000 2.04300 - 1.85150 -2.28566 0.00000 1.00000 2.28566 - 1.87000 -2.52486 0.00000 1.00000 2.52486 - 1.88850 -2.69615 0.00000 1.00000 2.69615 - 1.90700 -2.74180 0.00000 1.00000 2.74180 - 1.92550 -2.63223 0.00000 1.00000 2.63223 - 1.94400 -2.38239 0.00000 1.00000 2.38239 - 1.96250 -2.05565 0.00000 1.00000 2.05565 - 1.98100 -1.75092 0.00000 1.00000 1.75092 - 1.99950 -1.57518 0.00000 1.00000 1.57518 - 2.01800 -1.60914 0.00000 1.00000 1.60914 - 2.03650 -1.87687 0.00000 1.00000 1.87687 - 2.05500 -2.33004 0.00000 1.00000 2.33004 - 2.07350 -2.85357 0.00000 1.00000 2.85357 - 2.09200 -3.29353 0.00000 1.00000 3.29353 - 2.11050 -3.50124 0.00000 1.00000 3.50124 - 2.12900 -3.38172 0.00000 1.00000 3.38172 - 2.14750 -2.93205 0.00000 1.00000 2.93205 - 2.16600 -2.25629 0.00000 1.00000 2.25629 - 2.18450 -1.54918 0.00000 1.00000 1.54918 - 2.20300 -1.04888 0.00000 1.00000 1.04888 - 2.22150 -0.968136 0.00000 1.00000 0.968136 - 2.24000 -1.42070 0.00000 1.00000 1.42070 - 2.25850 -2.36300 0.00000 1.00000 2.36300 - 2.27700 -3.56960 0.00000 1.00000 3.56960 - 2.29550 -4.65416 0.00000 1.00000 4.65416 - 2.31400 -5.13684 0.00000 1.00000 5.13684 - 2.33250 -4.54696 0.00000 1.00000 4.54696 - 2.35100 -2.53890 0.00000 1.00000 2.53890 - 2.36950 1.00656 0.00000 1.00000 -1.00656 - 2.38800 5.92223 0.00000 1.00000 -5.92223 - 2.40650 11.7527 0.00000 1.00000 -11.7527 - 2.42500 17.8143 0.00000 1.00000 -17.8143 - 2.44350 23.3057 0.00000 1.00000 -23.3057 - 2.46200 27.4478 0.00000 1.00000 -27.4478 - 2.48050 29.6246 0.00000 1.00000 -29.6246 - 2.49900 29.4986 0.00000 1.00000 -29.4986 - 2.51750 27.0749 0.00000 1.00000 -27.0749 - 2.53600 22.7028 0.00000 1.00000 -22.7028 - 2.55450 17.0112 0.00000 1.00000 -17.0112 - 2.57300 10.7932 0.00000 1.00000 -10.7932 - 2.59150 4.86134 0.00000 1.00000 -4.86134 - 2.61000 -0.0945224 0.00000 1.00000 0.0945224 - 2.62850 -3.61858 0.00000 1.00000 3.61858 - 2.64700 -5.54803 0.00000 1.00000 5.54803 - 2.66550 -6.01016 0.00000 1.00000 6.01016 - 2.68400 -5.36293 0.00000 1.00000 5.36293 - 2.70250 -4.09596 0.00000 1.00000 4.09596 - 2.72100 -2.71625 0.00000 1.00000 2.71625 - 2.73950 -1.64382 0.00000 1.00000 1.64382 - 2.75800 -1.13791 0.00000 1.00000 1.13791 - 2.77650 -1.26649 0.00000 1.00000 1.26649 - 2.79500 -1.92103 0.00000 1.00000 1.92103 - 2.81350 -2.86890 0.00000 1.00000 2.86890 - 2.83200 -3.82782 0.00000 1.00000 3.82782 - 2.85050 -4.54328 0.00000 1.00000 4.54328 - 2.86900 -4.85054 0.00000 1.00000 4.85054 - 2.88750 -4.70809 0.00000 1.00000 4.70809 - 2.90600 -4.19687 0.00000 1.00000 4.19687 - 2.92450 -3.48841 0.00000 1.00000 3.48841 - 2.94300 -2.79256 0.00000 1.00000 2.79256 - 2.96150 -2.29993 0.00000 1.00000 2.29993 - 2.98000 -2.13422 0.00000 1.00000 2.13422 - 2.99850 -2.32552 0.00000 1.00000 2.32552 - 3.01700 -2.80931 0.00000 1.00000 2.80931 - 3.03550 -3.44928 0.00000 1.00000 3.44928 - 3.05400 -4.07624 0.00000 1.00000 4.07624 - 3.07250 -4.53264 0.00000 1.00000 4.53264 - 3.09100 -4.71141 0.00000 1.00000 4.71141 - 3.10950 -4.58013 0.00000 1.00000 4.58013 - 3.12800 -4.18572 0.00000 1.00000 4.18572 - 3.14650 -3.63955 0.00000 1.00000 3.63955 - 3.16500 -3.08796 0.00000 1.00000 3.08796 - 3.18350 -2.67579 0.00000 1.00000 2.67579 - 3.20200 -2.51194 0.00000 1.00000 2.51194 - 3.22050 -2.64475 0.00000 1.00000 2.64475 - 3.23900 -3.05186 0.00000 1.00000 3.05186 - 3.25750 -3.64576 0.00000 1.00000 3.64576 - 3.27600 -4.29257 0.00000 1.00000 4.29257 - 3.29450 -4.83876 0.00000 1.00000 4.83876 - 3.31300 -5.14008 0.00000 1.00000 5.14008 - 3.33150 -5.08721 0.00000 1.00000 5.08721 - 3.35000 -4.62391 0.00000 1.00000 4.62391 - 3.36850 -3.75470 0.00000 1.00000 3.75470 - 3.38700 -2.54063 0.00000 1.00000 2.54063 - 3.40550 -1.08396 0.00000 1.00000 1.08396 - 3.42400 0.493223 0.00000 1.00000 -0.493223 - 3.44250 2.06874 0.00000 1.00000 -2.06874 - 3.46100 3.53152 0.00000 1.00000 -3.53152 - 3.47950 4.78254 0.00000 1.00000 -4.78254 - 3.49800 5.72969 0.00000 1.00000 -5.72969 - 3.51650 6.28423 0.00000 1.00000 -6.28423 - 3.53500 6.36504 0.00000 1.00000 -6.36504 - 3.55350 5.91247 0.00000 1.00000 -5.91247 - 3.57200 4.90861 0.00000 1.00000 -4.90861 - 3.59050 3.39740 0.00000 1.00000 -3.39740 - 3.60900 1.49612 0.00000 1.00000 -1.49612 - 3.62750 -0.608193 0.00000 1.00000 0.608193 - 3.64600 -2.68019 0.00000 1.00000 2.68019 - 3.66450 -4.47243 0.00000 1.00000 4.47243 - 3.68300 -5.76925 0.00000 1.00000 5.76925 - 3.70150 -6.42920 0.00000 1.00000 6.42920 - 3.72000 -6.41719 0.00000 1.00000 6.41719 - 3.73850 -5.81875 0.00000 1.00000 5.81875 - 3.75700 -4.83074 0.00000 1.00000 4.83074 - 3.77550 -3.72667 0.00000 1.00000 3.72667 - 3.79400 -2.80071 0.00000 1.00000 2.80071 - 3.81250 -2.30147 0.00000 1.00000 2.30147 - 3.83100 -2.37126 0.00000 1.00000 2.37126 - 3.84950 -3.00713 0.00000 1.00000 3.00713 - 3.86800 -4.05566 0.00000 1.00000 4.05566 - 3.88650 -5.24604 0.00000 1.00000 5.24604 - 3.90500 -6.25585 0.00000 1.00000 6.25585 - 3.92350 -6.79521 0.00000 1.00000 6.79521 - 3.94200 -6.68830 0.00000 1.00000 6.68830 - 3.96050 -5.93010 0.00000 1.00000 5.93010 - 3.97900 -4.70113 0.00000 1.00000 4.70113 - 3.99750 -3.33259 0.00000 1.00000 3.33259 - 4.01600 -2.22683 0.00000 1.00000 2.22683 - 4.03450 -1.75037 0.00000 1.00000 1.75037 - 4.05300 -2.12498 0.00000 1.00000 2.12498 - 4.07150 -3.34471 0.00000 1.00000 3.34471 - 4.09000 -5.14253 0.00000 1.00000 5.14253 - 4.10850 -7.01935 0.00000 1.00000 7.01935 - 4.12700 -8.33391 0.00000 1.00000 8.33391 - 4.14550 -8.43660 0.00000 1.00000 8.43660 - 4.16400 -6.81920 0.00000 1.00000 6.81920 - 4.18250 -3.24667 0.00000 1.00000 3.24667 - 4.20100 2.16009 0.00000 1.00000 -2.16009 - 4.21950 8.91152 0.00000 1.00000 -8.91152 - 4.23800 16.2134 0.00000 1.00000 -16.2134 - 4.25650 23.0973 0.00000 1.00000 -23.0973 - 4.27500 28.5935 0.00000 1.00000 -28.5935 - 4.29350 31.9106 0.00000 1.00000 -31.9106 - 4.31200 32.5842 0.00000 1.00000 -32.5842 - 4.33050 30.5617 0.00000 1.00000 -30.5617 - 4.34900 26.2027 0.00000 1.00000 -26.2027 - 4.36750 20.1990 0.00000 1.00000 -20.1990 - 4.38600 13.4320 0.00000 1.00000 -13.4320 - 4.40450 6.80337 0.00000 1.00000 -6.80337 - 4.42300 1.07527 0.00000 1.00000 -1.07527 - 4.44150 -3.24700 0.00000 1.00000 3.24700 - 4.46000 -5.96945 0.00000 1.00000 5.96945 - 4.47850 -7.19581 0.00000 1.00000 7.19581 - 4.49700 -7.25613 0.00000 1.00000 7.25613 - 4.51550 -6.59972 0.00000 1.00000 6.59972 - 4.53400 -5.68054 0.00000 1.00000 5.68054 - 4.55250 -4.86170 0.00000 1.00000 4.86170 - 4.57100 -4.35835 0.00000 1.00000 4.35835 - 4.58950 -4.22677 0.00000 1.00000 4.22677 - 4.60800 -4.39508 0.00000 1.00000 4.39508 - 4.62650 -4.72130 0.00000 1.00000 4.72130 - 4.64500 -5.05871 0.00000 1.00000 5.05871 - 4.66350 -5.30848 0.00000 1.00000 5.30848 - 4.68200 -5.44197 0.00000 1.00000 5.44197 - 4.70050 -5.50097 0.00000 1.00000 5.50097 - 4.71900 -5.56456 0.00000 1.00000 5.56456 - 4.73750 -5.69659 0.00000 1.00000 5.69659 - 4.75600 -5.90806 0.00000 1.00000 5.90806 - 4.77450 -6.13525 0.00000 1.00000 6.13525 - 4.79300 -6.24364 0.00000 1.00000 6.24364 - 4.81150 -6.05670 0.00000 1.00000 6.05670 - 4.83000 -5.40165 0.00000 1.00000 5.40165 - 4.84850 -4.16022 0.00000 1.00000 4.16022 - 4.86700 -2.31100 0.00000 1.00000 2.31100 - 4.88550 0.0479985 0.00000 1.00000 -0.0479985 - 4.90400 2.70271 0.00000 1.00000 -2.70271 - 4.92250 5.35252 0.00000 1.00000 -5.35252 - 4.94100 7.65960 0.00000 1.00000 -7.65960 - 4.95950 9.30734 0.00000 1.00000 -9.30734 - 4.97800 10.0558 0.00000 1.00000 -10.0558 - 4.99650 9.78268 0.00000 1.00000 -9.78268 - 5.01500 8.50309 0.00000 1.00000 -8.50309 - 5.03350 6.36470 0.00000 1.00000 -6.36470 - 5.05200 3.62252 0.00000 1.00000 -3.62252 - 5.07050 0.599290 0.00000 1.00000 -0.599290 - 5.08900 -2.36086 0.00000 1.00000 2.36086 - 5.10750 -4.93870 0.00000 1.00000 4.93870 - 5.12600 -6.88149 0.00000 1.00000 6.88149 - 5.14450 -8.03565 0.00000 1.00000 8.03565 - 5.16300 -8.36668 0.00000 1.00000 8.36668 - 5.18150 -7.96304 0.00000 1.00000 7.96304 - 5.20000 -7.02207 0.00000 1.00000 7.02207 - 5.21850 -5.81895 0.00000 1.00000 5.81895 - 5.23700 -4.66171 0.00000 1.00000 4.66171 - 5.25550 -3.83844 0.00000 1.00000 3.83844 - 5.27400 -3.56410 0.00000 1.00000 3.56410 - 5.29250 -3.93573 0.00000 1.00000 3.93573 - 5.31100 -4.90467 0.00000 1.00000 4.90467 - 5.32950 -6.27267 0.00000 1.00000 6.27267 - 5.34800 -7.71536 0.00000 1.00000 7.71536 - 5.36650 -8.83203 0.00000 1.00000 8.83203 - 5.38500 -9.21516 0.00000 1.00000 9.21516 - 5.40350 -8.52808 0.00000 1.00000 8.52808 - 5.42200 -6.57611 0.00000 1.00000 6.57611 - 5.44050 -3.35625 0.00000 1.00000 3.35625 - 5.45900 0.925287 0.00000 1.00000 -0.925287 - 5.47750 5.87209 0.00000 1.00000 -5.87209 - 5.49600 10.9500 0.00000 1.00000 -10.9500 - 5.51450 15.5640 0.00000 1.00000 -15.5640 - 5.53300 19.1477 0.00000 1.00000 -19.1477 - 5.55150 21.2490 0.00000 1.00000 -21.2490 - 5.57000 21.6003 0.00000 1.00000 -21.6003 - 5.58850 20.1588 0.00000 1.00000 -20.1588 - 5.60700 17.1124 0.00000 1.00000 -17.1124 - 5.62550 12.8494 0.00000 1.00000 -12.8494 - 5.64400 7.89927 0.00000 1.00000 -7.89927 - 5.66250 2.85190 0.00000 1.00000 -2.85190 - 5.68100 -1.72997 0.00000 1.00000 1.72997 - 5.69950 -5.39381 0.00000 1.00000 5.39381 - 5.71800 -7.86162 0.00000 1.00000 7.86162 - 5.73650 -9.06420 0.00000 1.00000 9.06420 - 5.75500 -9.13837 0.00000 1.00000 9.13837 - 5.77350 -8.38683 0.00000 1.00000 8.38683 - 5.79200 -7.20818 0.00000 1.00000 7.20818 - 5.81050 -6.01172 0.00000 1.00000 6.01172 - 5.82900 -5.13567 0.00000 1.00000 5.13567 - 5.84750 -4.78662 0.00000 1.00000 4.78662 - 5.86600 -5.01125 0.00000 1.00000 5.01125 - 5.88450 -5.70222 0.00000 1.00000 5.70222 - 5.90300 -6.63275 0.00000 1.00000 6.63275 - 5.92150 -7.51031 0.00000 1.00000 7.51031 - 5.94000 -8.03914 0.00000 1.00000 8.03914 - 5.95850 -7.98163 0.00000 1.00000 7.98163 - 5.97700 -7.20897 0.00000 1.00000 7.20897 - 5.99550 -5.73309 0.00000 1.00000 5.73309 - 6.01400 -3.71335 0.00000 1.00000 3.71335 - 6.03250 -1.43572 0.00000 1.00000 1.43572 - 6.05100 0.734316 0.00000 1.00000 -0.734316 - 6.06950 2.41816 0.00000 1.00000 -2.41816 - 6.08800 3.29880 0.00000 1.00000 -3.29880 - 6.10650 3.18922 0.00000 1.00000 -3.18922 - 6.12500 2.07961 0.00000 1.00000 -2.07961 - 6.14350 0.150522 0.00000 1.00000 -0.150522 - 6.16200 -2.25436 0.00000 1.00000 2.25436 - 6.18050 -4.69426 0.00000 1.00000 4.69426 - 6.19900 -6.72460 0.00000 1.00000 6.72460 - 6.21750 -7.99834 0.00000 1.00000 7.99834 - 6.23600 -8.35142 0.00000 1.00000 8.35142 - 6.25450 -7.84948 0.00000 1.00000 7.84948 - 6.27300 -6.78013 0.00000 1.00000 6.78013 - 6.29150 -5.58671 0.00000 1.00000 5.58671 - 6.31000 -4.75441 0.00000 1.00000 4.75441 - 6.32850 -4.67266 0.00000 1.00000 4.67266 - 6.34700 -5.50714 0.00000 1.00000 5.50714 - 6.36550 -7.11590 0.00000 1.00000 7.11590 - 6.38400 -9.03699 0.00000 1.00000 9.03699 - 6.40250 -10.5592 0.00000 1.00000 10.5592 - 6.42100 -10.8676 0.00000 1.00000 10.8676 - 6.43950 -9.23379 0.00000 1.00000 9.23379 - 6.45800 -5.20861 0.00000 1.00000 5.20861 - 6.47650 1.23011 0.00000 1.00000 -1.23011 - 6.49500 9.61241 0.00000 1.00000 -9.61241 - 6.51350 19.0142 0.00000 1.00000 -19.0142 - 6.53200 28.1967 0.00000 1.00000 -28.1967 - 6.55050 35.8243 0.00000 1.00000 -35.8243 - 6.56900 40.7166 0.00000 1.00000 -40.7166 - 6.58750 42.0833 0.00000 1.00000 -42.0833 - 6.60600 39.6873 0.00000 1.00000 -39.6873 - 6.62450 33.8989 0.00000 1.00000 -33.8989 - 6.64300 25.6256 0.00000 1.00000 -25.6256 - 6.66150 16.1324 0.00000 1.00000 -16.1324 - 6.68000 6.79125 0.00000 1.00000 -6.79125 - 6.69850 -1.18411 0.00000 1.00000 1.18411 - 6.71700 -6.95910 0.00000 1.00000 6.95910 - 6.73550 -10.2079 0.00000 1.00000 10.2079 - 6.75400 -11.1248 0.00000 1.00000 11.1248 - 6.77250 -10.3198 0.00000 1.00000 10.3198 - 6.79100 -8.62815 0.00000 1.00000 8.62815 - 6.80950 -6.88571 0.00000 1.00000 6.88571 - 6.82800 -5.72660 0.00000 1.00000 5.72660 - 6.84650 -5.45332 0.00000 1.00000 5.45332 - 6.86500 -6.00649 0.00000 1.00000 6.00649 - 6.88350 -7.03437 0.00000 1.00000 7.03437 - 6.90200 -8.03570 0.00000 1.00000 8.03570 - 6.92050 -8.53209 0.00000 1.00000 8.53209 - 6.93900 -8.22002 0.00000 1.00000 8.22002 - 6.95750 -7.06140 0.00000 1.00000 7.06140 - 6.97600 -5.29017 0.00000 1.00000 5.29017 - 6.99450 -3.33754 0.00000 1.00000 3.33754 - 7.01300 -1.70148 0.00000 1.00000 1.70148 - 7.03150 -0.800760 0.00000 1.00000 0.800760 - 7.05000 -0.856664 0.00000 1.00000 0.856664 - 7.06850 -1.83505 0.00000 1.00000 1.83505 - 7.08700 -3.46358 0.00000 1.00000 3.46358 - 7.10550 -5.31731 0.00000 1.00000 5.31731 - 7.12400 -6.94715 0.00000 1.00000 6.94715 - 7.14250 -8.01332 0.00000 1.00000 8.01332 - 7.16100 -8.38320 0.00000 1.00000 8.38320 - 7.17950 -8.16268 0.00000 1.00000 8.16268 - 7.19800 -7.64952 0.00000 1.00000 7.64952 - 7.21650 -7.22129 0.00000 1.00000 7.22129 - 7.23500 -7.19206 0.00000 1.00000 7.19206 - 7.25350 -7.68220 0.00000 1.00000 7.68220 - 7.27200 -8.54371 0.00000 1.00000 8.54371 - 7.29050 -9.36819 0.00000 1.00000 9.36819 - 7.30900 -9.58072 0.00000 1.00000 9.58072 - 7.32750 -8.59790 0.00000 1.00000 8.59790 - 7.34600 -6.00785 0.00000 1.00000 6.00785 - 7.36450 -1.72106 0.00000 1.00000 1.72106 - 7.38300 3.95269 0.00000 1.00000 -3.95269 - 7.40150 10.3276 0.00000 1.00000 -10.3276 - 7.42000 16.4640 0.00000 1.00000 -16.4640 - 7.43850 21.3618 0.00000 1.00000 -21.3618 - 7.45700 24.1782 0.00000 1.00000 -24.1782 - 7.47550 24.4162 0.00000 1.00000 -24.4162 - 7.49400 22.0356 0.00000 1.00000 -22.0356 - 7.51250 17.4573 0.00000 1.00000 -17.4573 - 7.53100 11.4623 0.00000 1.00000 -11.4623 - 7.54950 5.01118 0.00000 1.00000 -5.01118 - 7.56800 -0.965076 0.00000 1.00000 0.965076 - 7.58650 -5.75153 0.00000 1.00000 5.75153 - 7.60500 -8.96799 0.00000 1.00000 8.96799 - 7.62350 -10.5969 0.00000 1.00000 10.5969 - 7.64200 -10.9206 0.00000 1.00000 10.9206 - 7.66050 -10.3893 0.00000 1.00000 10.3893 - 7.67900 -9.46200 0.00000 1.00000 9.46200 - 7.69750 -8.46444 0.00000 1.00000 8.46444 - 7.71600 -7.50854 0.00000 1.00000 7.50854 - 7.73450 -6.49304 0.00000 1.00000 6.49304 - 7.75300 -5.18168 0.00000 1.00000 5.18168 - 7.77150 -3.32911 0.00000 1.00000 3.32911 - 7.79000 -0.811546 0.00000 1.00000 0.811546 - 7.80850 2.28073 0.00000 1.00000 -2.28073 - 7.82700 5.61902 0.00000 1.00000 -5.61902 - 7.84550 8.68909 0.00000 1.00000 -8.68909 - 7.86400 10.9073 0.00000 1.00000 -10.9073 - 7.88250 11.7676 0.00000 1.00000 -11.7676 - 7.90100 10.9777 0.00000 1.00000 -10.9777 - 7.91950 8.54633 0.00000 1.00000 -8.54633 - 7.93800 4.79627 0.00000 1.00000 -4.79627 - 7.95650 0.300695 0.00000 1.00000 -0.300695 - 7.97500 -4.24152 0.00000 1.00000 4.24152 - 7.99350 -8.15787 0.00000 1.00000 8.15787 - 8.01200 -10.9420 0.00000 1.00000 10.9420 - 8.03050 -12.3456 0.00000 1.00000 12.3456 - 8.04900 -12.4001 0.00000 1.00000 12.4001 - 8.06750 -11.3663 0.00000 1.00000 11.3663 - 8.08600 -9.63181 0.00000 1.00000 9.63181 - 8.10450 -7.58723 0.00000 1.00000 7.58723 - 8.12300 -5.52117 0.00000 1.00000 5.52117 - 8.14150 -3.56353 0.00000 1.00000 3.56353 - 8.16000 -1.69260 0.00000 1.00000 1.69260 - 8.17850 0.199827 0.00000 1.00000 -0.199827 - 8.19700 2.21044 0.00000 1.00000 -2.21044 - 8.21550 4.33057 0.00000 1.00000 -4.33057 - 8.23400 6.39218 0.00000 1.00000 -6.39218 - 8.25250 8.07555 0.00000 1.00000 -8.07555 - 8.27100 8.97896 0.00000 1.00000 -8.97896 - 8.28950 8.73073 0.00000 1.00000 -8.73073 - 8.30800 7.11016 0.00000 1.00000 -7.11016 - 8.32650 4.14151 0.00000 1.00000 -4.14151 - 8.34500 0.130936 0.00000 1.00000 -0.130936 - 8.36350 -4.36837 0.00000 1.00000 4.36837 - 8.38200 -8.65854 0.00000 1.00000 8.65854 - 8.40050 -12.0433 0.00000 1.00000 12.0433 - 8.41900 -13.9807 0.00000 1.00000 13.9807 - 8.43750 -14.2030 0.00000 1.00000 14.2030 - 8.45600 -12.7704 0.00000 1.00000 12.7704 - 8.47450 -10.0445 0.00000 1.00000 10.0445 - 8.49300 -6.58938 0.00000 1.00000 6.58938 - 8.51150 -3.02663 0.00000 1.00000 3.02663 - 8.53000 0.112114 0.00000 1.00000 -0.112114 - 8.54850 2.49566 0.00000 1.00000 -2.49566 - 8.56700 4.03580 0.00000 1.00000 -4.03580 - 8.58550 4.85377 0.00000 1.00000 -4.85377 - 8.60400 5.18537 0.00000 1.00000 -5.18537 - 8.62250 5.25808 0.00000 1.00000 -5.25808 - 8.64100 5.18193 0.00000 1.00000 -5.18193 - 8.65950 4.89182 0.00000 1.00000 -4.89182 - 8.67800 4.16349 0.00000 1.00000 -4.16349 - 8.69650 2.70252 0.00000 1.00000 -2.70252 - 8.71500 0.282220 0.00000 1.00000 -0.282220 - 8.73350 -3.11124 0.00000 1.00000 3.11124 - 8.75200 -7.17490 0.00000 1.00000 7.17490 - 8.77050 -11.2672 0.00000 1.00000 11.2672 - 8.78900 -14.4886 0.00000 1.00000 14.4886 - 8.80750 -15.8559 0.00000 1.00000 15.8559 - 8.82600 -14.5328 0.00000 1.00000 14.5328 - 8.84450 -10.0609 0.00000 1.00000 10.0609 - 8.86300 -2.52773 0.00000 1.00000 2.52773 - 8.88150 7.37428 0.00000 1.00000 -7.37428 - 8.90000 18.4240 0.00000 1.00000 -18.4240 - 8.91850 29.0726 0.00000 1.00000 -29.0726 - 8.93700 37.7295 0.00000 1.00000 -37.7295 - 8.95550 43.0717 0.00000 1.00000 -43.0717 - 8.97400 44.3044 0.00000 1.00000 -44.3044 - 8.99250 41.3154 0.00000 1.00000 -41.3154 - 9.01100 34.6857 0.00000 1.00000 -34.6857 - 9.02950 25.5570 0.00000 1.00000 -25.5570 - 9.04800 15.3859 0.00000 1.00000 -15.3859 - 9.06650 5.64529 0.00000 1.00000 -5.64529 - 9.08500 -2.45985 0.00000 1.00000 2.45985 - 9.10350 -8.19758 0.00000 1.00000 8.19758 - 9.12200 -11.3936 0.00000 1.00000 11.3936 - 9.14050 -12.3840 0.00000 1.00000 12.3840 - 9.15900 -11.8591 0.00000 1.00000 11.8591 - 9.17750 -10.6446 0.00000 1.00000 10.6446 - 9.19600 -9.48212 0.00000 1.00000 9.48212 - 9.21450 -8.86286 0.00000 1.00000 8.86286 - 9.23300 -8.95166 0.00000 1.00000 8.95166 - 9.25150 -9.60978 0.00000 1.00000 9.60978 - 9.27000 -10.4985 0.00000 1.00000 10.4985 - 9.28850 -11.2264 0.00000 1.00000 11.2264 - 9.30700 -11.4956 0.00000 1.00000 11.4956 - 9.32550 -11.2056 0.00000 1.00000 11.2056 - 9.34400 -10.4851 0.00000 1.00000 10.4851 - 9.36250 -9.64367 0.00000 1.00000 9.64367 - 9.38100 -9.05839 0.00000 1.00000 9.05839 - 9.39950 -9.03059 0.00000 1.00000 9.03059 - 9.41800 -9.65891 0.00000 1.00000 9.65891 - 9.43650 -10.7695 0.00000 1.00000 10.7695 - 9.45500 -11.9282 0.00000 1.00000 11.9282 - 9.47350 -12.5352 0.00000 1.00000 12.5352 - 9.49200 -11.9793 0.00000 1.00000 11.9793 - 9.51050 -9.80968 0.00000 1.00000 9.80968 - 9.52900 -5.88098 0.00000 1.00000 5.88098 - 9.54750 -0.429865 0.00000 1.00000 0.429865 - 9.56600 5.93738 0.00000 1.00000 -5.93738 - 9.58450 12.3467 0.00000 1.00000 -12.3467 - 9.60300 17.8253 0.00000 1.00000 -17.8253 - 9.62150 21.4983 0.00000 1.00000 -21.4983 - 9.64000 22.7684 0.00000 1.00000 -22.7684 - 9.65850 21.4353 0.00000 1.00000 -21.4353 - 9.67700 17.7297 0.00000 1.00000 -17.7297 - 9.69550 12.2556 0.00000 1.00000 -12.2556 - 9.71400 5.85940 0.00000 1.00000 -5.85940 - 9.73250 -0.539853 0.00000 1.00000 0.539853 - 9.75100 -6.11696 0.00000 1.00000 6.11696 - 9.76950 -10.2704 0.00000 1.00000 10.2704 - 9.78800 -12.6954 0.00000 1.00000 12.6954 - 9.80650 -13.3941 0.00000 1.00000 13.3941 - 9.82500 -12.6315 0.00000 1.00000 12.6315 - 9.84350 -10.8487 0.00000 1.00000 10.8487 - 9.86200 -8.55755 0.00000 1.00000 8.55755 - 9.88050 -6.24003 0.00000 1.00000 6.24003 - 9.89900 -4.27478 0.00000 1.00000 4.27478 - 9.91750 -2.90328 0.00000 1.00000 2.90328 - 9.93600 -2.23386 0.00000 1.00000 2.23386 - 9.95450 -2.27104 0.00000 1.00000 2.27104 - 9.97300 -2.95175 0.00000 1.00000 2.95175 - 9.99150 -4.17209 0.00000 1.00000 4.17209 - 10.0100 -5.79607 0.00000 1.00000 5.79607 - 10.0285 -7.64859 0.00000 1.00000 7.64859 - 10.0470 -9.50283 0.00000 1.00000 9.50283 - 10.0655 -11.0757 0.00000 1.00000 11.0757 - 10.0840 -12.0425 0.00000 1.00000 12.0425 - 10.1025 -12.0751 0.00000 1.00000 12.0751 - 10.1210 -10.9017 0.00000 1.00000 10.9017 - 10.1395 -8.37613 0.00000 1.00000 8.37613 - 10.1580 -4.54026 0.00000 1.00000 4.54026 - 10.1765 0.338357 0.00000 1.00000 -0.338357 - 10.1950 5.76996 0.00000 1.00000 -5.76996 - 10.2135 11.0939 0.00000 1.00000 -11.0939 - 10.2320 15.5741 0.00000 1.00000 -15.5741 - 10.2505 18.5225 0.00000 1.00000 -18.5225 - 10.2690 19.4270 0.00000 1.00000 -19.4270 - 10.2875 18.0567 0.00000 1.00000 -18.0567 - 10.3060 14.5227 0.00000 1.00000 -14.5227 - 10.3245 9.27796 0.00000 1.00000 -9.27796 - 10.3430 3.05599 0.00000 1.00000 -3.05599 - 10.3615 -3.24345 0.00000 1.00000 3.24345 - 10.3800 -8.70145 0.00000 1.00000 8.70145 - 10.3985 -12.5330 0.00000 1.00000 12.5330 - 10.4170 -14.2182 0.00000 1.00000 14.2182 - 10.4355 -13.5885 0.00000 1.00000 13.5885 - 10.4540 -10.8525 0.00000 1.00000 10.8525 - 10.4725 -6.55772 0.00000 1.00000 6.55772 - 10.4910 -1.49640 0.00000 1.00000 1.49640 - 10.5095 3.42852 0.00000 1.00000 -3.42852 - 10.5280 7.35363 0.00000 1.00000 -7.35363 - 10.5465 9.59717 0.00000 1.00000 -9.59717 - 10.5650 9.77054 0.00000 1.00000 -9.77054 - 10.5835 7.84234 0.00000 1.00000 -7.84234 - 10.6020 4.14584 0.00000 1.00000 -4.14584 - 10.6205 -0.671143 0.00000 1.00000 0.671143 - 10.6390 -5.74603 0.00000 1.00000 5.74603 - 10.6575 -10.1361 0.00000 1.00000 10.1361 - 10.6760 -12.9671 0.00000 1.00000 12.9671 - 10.6945 -13.5738 0.00000 1.00000 13.5738 - 10.7130 -11.6108 0.00000 1.00000 11.6108 - 10.7315 -7.11852 0.00000 1.00000 7.11852 - 10.7500 -0.532582 0.00000 1.00000 0.532582 - 10.7685 7.36496 0.00000 1.00000 -7.36496 - 10.7870 15.5502 0.00000 1.00000 -15.5502 - 10.8055 22.9046 0.00000 1.00000 -22.9046 - 10.8240 28.3836 0.00000 1.00000 -28.3836 - 10.8425 31.1819 0.00000 1.00000 -31.1819 - 10.8610 30.8667 0.00000 1.00000 -30.8667 - 10.8795 27.4544 0.00000 1.00000 -27.4544 - 10.8980 21.4174 0.00000 1.00000 -21.4174 - 10.9165 13.6149 0.00000 1.00000 -13.6149 - 10.9350 5.15717 0.00000 1.00000 -5.15717 - 10.9535 -2.77403 0.00000 1.00000 2.77403 - 10.9720 -9.11963 0.00000 1.00000 9.11963 - 10.9905 -13.1166 0.00000 1.00000 13.1166 - 11.0090 -14.4189 0.00000 1.00000 14.4189 - 11.0275 -13.1446 0.00000 1.00000 13.1446 - 11.0460 -9.84069 0.00000 1.00000 9.84069 - 11.0645 -5.37361 0.00000 1.00000 5.37361 - 11.0830 -0.766336 0.00000 1.00000 0.766336 - 11.1015 2.99059 0.00000 1.00000 -2.99059 - 11.1200 5.12102 0.00000 1.00000 -5.12102 - 11.1385 5.20555 0.00000 1.00000 -5.20555 - 11.1570 3.25580 0.00000 1.00000 -3.25580 - 11.1755 -0.295787 0.00000 1.00000 0.295787 - 11.1940 -4.68917 0.00000 1.00000 4.68917 - 11.2125 -8.99252 0.00000 1.00000 8.99252 - 11.2310 -12.2872 0.00000 1.00000 12.2872 - 11.2495 -13.8447 0.00000 1.00000 13.8447 - 11.2680 -13.2610 0.00000 1.00000 13.2610 - 11.2865 -10.5280 0.00000 1.00000 10.5280 - 11.3050 -6.02790 0.00000 1.00000 6.02790 - 11.3235 -0.457428 0.00000 1.00000 0.457428 - 11.3420 5.30272 0.00000 1.00000 -5.30272 - 11.3605 10.3468 0.00000 1.00000 -10.3468 - 11.3790 13.9003 0.00000 1.00000 -13.9003 - 11.3975 15.4459 0.00000 1.00000 -15.4459 - 11.4160 14.7993 0.00000 1.00000 -14.7993 - 11.4345 12.1251 0.00000 1.00000 -12.1251 - 11.4530 7.89515 0.00000 1.00000 -7.89515 - 11.4715 2.79743 0.00000 1.00000 -2.79743 - 11.4900 -2.38402 0.00000 1.00000 2.38402 - 11.5085 -6.89848 0.00000 1.00000 6.89848 - 11.5270 -10.1446 0.00000 1.00000 10.1446 - 11.5455 -11.7562 0.00000 1.00000 11.7562 - 11.5640 -11.6477 0.00000 1.00000 11.6477 - 11.5825 -10.0156 0.00000 1.00000 10.0156 - 11.6010 -7.29778 0.00000 1.00000 7.29778 - 11.6195 -4.09885 0.00000 1.00000 4.09885 - 11.6380 -1.08810 0.00000 1.00000 1.08810 - 11.6565 1.11439 0.00000 1.00000 -1.11439 - 11.6750 2.04788 0.00000 1.00000 -2.04788 - 11.6935 1.49867 0.00000 1.00000 -1.49867 - 11.7120 -0.451611 0.00000 1.00000 0.451611 - 11.7305 -3.42848 0.00000 1.00000 3.42848 - 11.7490 -6.82125 0.00000 1.00000 6.82125 - 11.7675 -9.88740 0.00000 1.00000 9.88740 - 11.7860 -11.8896 0.00000 1.00000 11.8896 - 11.8045 -12.2430 0.00000 1.00000 12.2430 - 11.8230 -10.6446 0.00000 1.00000 10.6446 - 11.8415 -7.15722 0.00000 1.00000 7.15722 - 11.8600 -2.22583 0.00000 1.00000 2.22583 - 11.8785 3.38458 0.00000 1.00000 -3.38458 - 11.8970 8.72108 0.00000 1.00000 -8.72108 - 11.9155 12.8213 0.00000 1.00000 -12.8213 - 11.9340 14.9032 0.00000 1.00000 -14.9032 - 11.9525 14.5281 0.00000 1.00000 -14.5281 - 11.9710 11.6999 0.00000 1.00000 -11.6999 - 11.9895 6.87776 0.00000 1.00000 -6.87776 - 12.0080 0.891504 0.00000 1.00000 -0.891504 - 12.0265 -5.22565 0.00000 1.00000 5.22565 - 12.0450 -10.4522 0.00000 1.00000 10.4522 - 12.0635 -13.9931 0.00000 1.00000 13.9931 - 12.0820 -15.4435 0.00000 1.00000 15.4435 - 12.1005 -14.8644 0.00000 1.00000 14.8644 - 12.1190 -12.7520 0.00000 1.00000 12.7520 - 12.1375 -9.90845 0.00000 1.00000 9.90845 - 12.1560 -7.24453 0.00000 1.00000 7.24453 - 12.1745 -5.56166 0.00000 1.00000 5.56166 - 12.1930 -5.36161 0.00000 1.00000 5.36161 - 12.2115 -6.72586 0.00000 1.00000 6.72586 - 12.2300 -9.28835 0.00000 1.00000 9.28835 - 12.2485 -12.3067 0.00000 1.00000 12.3067 - 12.2670 -14.8178 0.00000 1.00000 14.8178 - 12.2855 -15.8476 0.00000 1.00000 15.8476 - 12.3040 -14.6332 0.00000 1.00000 14.6332 - 12.3225 -10.8097 0.00000 1.00000 10.8097 - 12.3410 -4.52145 0.00000 1.00000 4.52145 - 12.3595 3.57058 0.00000 1.00000 -3.57058 - 12.3780 12.3893 0.00000 1.00000 -12.3893 - 12.3965 20.6314 0.00000 1.00000 -20.6314 - 12.4150 27.0092 0.00000 1.00000 -27.0092 - 12.4335 30.4959 0.00000 1.00000 -30.4959 - 12.4520 30.5247 0.00000 1.00000 -30.5247 - 12.4705 27.1034 0.00000 1.00000 -27.1034 - 12.4890 20.8197 0.00000 1.00000 -20.8197 - 12.5075 12.7348 0.00000 1.00000 -12.7348 - 12.5260 4.18409 0.00000 1.00000 -4.18409 - 12.5445 -3.47600 0.00000 1.00000 3.47600 - 12.5630 -9.12640 0.00000 1.00000 9.12640 - 12.5815 -12.0958 0.00000 1.00000 12.0958 - 12.6000 -12.2803 0.00000 1.00000 12.2803 - 12.6185 -10.1467 0.00000 1.00000 10.1467 - 12.6370 -6.61573 0.00000 1.00000 6.61573 - 12.6555 -2.84816 0.00000 1.00000 2.84816 - 12.6740 0.0234471 0.00000 1.00000 -0.0234471 - 12.6925 1.16051 0.00000 1.00000 -1.16051 - 12.7110 0.222329 0.00000 1.00000 -0.222329 - 12.7295 -2.53923 0.00000 1.00000 2.53923 - 12.7480 -6.31966 0.00000 1.00000 6.31966 - 12.7665 -9.93250 0.00000 1.00000 9.93250 - 12.7850 -12.0782 0.00000 1.00000 12.0782 - 12.8035 -11.6556 0.00000 1.00000 11.6556 - 12.8220 -8.04822 0.00000 1.00000 8.04822 - 12.8405 -1.31753 0.00000 1.00000 1.31753 - 12.8590 7.74657 0.00000 1.00000 -7.74657 - 12.8775 17.7420 0.00000 1.00000 -17.7420 - 12.8960 26.9214 0.00000 1.00000 -26.9214 - 12.9145 33.5578 0.00000 1.00000 -33.5578 - 12.9330 36.3277 0.00000 1.00000 -36.3277 - 12.9515 34.6234 0.00000 1.00000 -34.6234 - 12.9700 28.7156 0.00000 1.00000 -28.7156 - 12.9885 19.7233 0.00000 1.00000 -19.7233 - 13.0070 9.38804 0.00000 1.00000 -9.38804 - 13.0255 -0.297908 0.00000 1.00000 0.297908 - 13.0440 -7.52791 0.00000 1.00000 7.52791 - 13.0625 -11.0794 0.00000 1.00000 11.0794 - 13.0810 -10.5807 0.00000 1.00000 10.5807 - 13.0995 -6.58087 0.00000 1.00000 6.58087 - 13.1180 -0.404585 0.00000 1.00000 0.404585 - 13.1365 6.17556 0.00000 1.00000 -6.17556 - 13.1550 11.3708 0.00000 1.00000 -11.3708 - 13.1735 13.8053 0.00000 1.00000 -13.8053 - 13.1920 12.8357 0.00000 1.00000 -12.8357 - 13.2105 8.68336 0.00000 1.00000 -8.68336 - 13.2290 2.34908 0.00000 1.00000 -2.34908 - 13.2475 -4.66287 0.00000 1.00000 4.66287 - 13.2660 -10.7379 0.00000 1.00000 10.7379 - 13.2845 -14.5602 0.00000 1.00000 14.5602 - 13.3030 -15.4343 0.00000 1.00000 15.4343 - 13.3215 -13.4393 0.00000 1.00000 13.4393 - 13.3400 -9.37967 0.00000 1.00000 9.37967 - 13.3585 -4.55053 0.00000 1.00000 4.55053 - 13.3770 -0.382431 0.00000 1.00000 0.382431 - 13.3955 1.93839 0.00000 1.00000 -1.93839 - 13.4140 1.77366 0.00000 1.00000 -1.77366 - 13.4325 -0.818874 0.00000 1.00000 0.818874 - 13.4510 -5.13072 0.00000 1.00000 5.13072 - 13.4695 -10.0255 0.00000 1.00000 10.0255 - 13.4880 -14.2744 0.00000 1.00000 14.2744 - 13.5065 -16.9060 0.00000 1.00000 16.9060 - 13.5250 -17.4714 0.00000 1.00000 17.4714 - 13.5435 -16.1512 0.00000 1.00000 16.1512 - 13.5620 -13.6784 0.00000 1.00000 13.6784 - 13.5805 -11.1043 0.00000 1.00000 11.1043 - 13.5990 -9.47288 0.00000 1.00000 9.47288 - 13.6175 -9.49567 0.00000 1.00000 9.49567 - 13.6360 -11.3153 0.00000 1.00000 11.3153 - 13.6545 -14.4268 0.00000 1.00000 14.4268 - 13.6730 -17.7824 0.00000 1.00000 17.7824 - 13.6915 -20.0552 0.00000 1.00000 20.0552 - 13.7100 -19.9965 0.00000 1.00000 19.9965 - 13.7285 -16.7898 0.00000 1.00000 16.7898 - 13.7470 -10.3089 0.00000 1.00000 10.3089 - 13.7655 -1.20781 0.00000 1.00000 1.20781 - 13.7840 9.18567 0.00000 1.00000 -9.18567 - 13.8025 19.1488 0.00000 1.00000 -19.1488 - 13.8210 26.9489 0.00000 1.00000 -26.9489 - 13.8395 31.2366 0.00000 1.00000 -31.2366 - 13.8580 31.3496 0.00000 1.00000 -31.3496 - 13.8765 27.4511 0.00000 1.00000 -27.4511 - 13.8950 20.4697 0.00000 1.00000 -20.4697 - 13.9135 11.8582 0.00000 1.00000 -11.8582 - 13.9320 3.23523 0.00000 1.00000 -3.23523 - 13.9505 -3.99882 0.00000 1.00000 3.99882 - 13.9690 -8.96984 0.00000 1.00000 8.96984 - 13.9875 -11.4848 0.00000 1.00000 11.4848 - 14.0060 -11.9967 0.00000 1.00000 11.9967 - 14.0245 -11.3970 0.00000 1.00000 11.3970 - 14.0430 -10.7008 0.00000 1.00000 10.7008 - 14.0615 -10.7168 0.00000 1.00000 10.7168 - 14.0800 -11.7936 0.00000 1.00000 11.7936 - 14.0985 -13.7115 0.00000 1.00000 13.7115 - 14.1170 -15.7457 0.00000 1.00000 15.7457 - 14.1355 -16.8835 0.00000 1.00000 16.8835 - 14.1540 -16.1342 0.00000 1.00000 16.1342 - 14.1725 -12.8466 0.00000 1.00000 12.8466 - 14.1910 -6.94542 0.00000 1.00000 6.94542 - 14.2095 0.982134 0.00000 1.00000 -0.982134 - 14.2280 9.77953 0.00000 1.00000 -9.77953 - 14.2465 17.9729 0.00000 1.00000 -17.9729 - 14.2650 24.1178 0.00000 1.00000 -24.1178 - 14.2835 27.1485 0.00000 1.00000 -27.1485 - 14.3020 26.6355 0.00000 1.00000 -26.6355 - 14.3205 22.8839 0.00000 1.00000 -22.8839 - 14.3390 16.8479 0.00000 1.00000 -16.8479 - 14.3575 9.88786 0.00000 1.00000 -9.88786 - 14.3760 3.43554 0.00000 1.00000 -3.43554 - 14.3945 -1.34253 0.00000 1.00000 1.34253 - 14.4130 -3.79922 0.00000 1.00000 3.79922 - 14.4315 -3.91650 0.00000 1.00000 3.91650 - 14.4500 -2.25034 0.00000 1.00000 2.25034 - 14.4685 0.265934 0.00000 1.00000 -0.265934 - 14.4870 2.60091 0.00000 1.00000 -2.60091 - 14.5055 3.90902 0.00000 1.00000 -3.90902 - 14.5240 3.74411 0.00000 1.00000 -3.74411 - 14.5425 2.15013 0.00000 1.00000 -2.15013 - 14.5610 -0.388481 0.00000 1.00000 0.388481 - 14.5795 -3.11515 0.00000 1.00000 3.11515 - 14.5980 -5.23631 0.00000 1.00000 5.23631 - 14.6165 -6.15513 0.00000 1.00000 6.15513 - 14.6350 -5.63898 0.00000 1.00000 5.63898 - 14.6535 -3.87566 0.00000 1.00000 3.87566 - 14.6720 -1.40645 0.00000 1.00000 1.40645 - 14.6905 1.04029 0.00000 1.00000 -1.04029 - 14.7090 2.76304 0.00000 1.00000 -2.76304 - 14.7275 3.28473 0.00000 1.00000 -3.28473 - 14.7460 2.47788 0.00000 1.00000 -2.47788 - 14.7645 0.584519 0.00000 1.00000 -0.584519 - 14.7830 -1.87052 0.00000 1.00000 1.87052 - 14.8015 -4.24417 0.00000 1.00000 4.24417 - 14.8200 -5.96765 0.00000 1.00000 5.96765 - 14.8385 -6.70965 0.00000 1.00000 6.70965 - 14.8570 -6.46211 0.00000 1.00000 6.46211 - 14.8755 -5.52356 0.00000 1.00000 5.52356 - 14.8940 -4.38544 0.00000 1.00000 4.38544 - 14.9125 -3.55512 0.00000 1.00000 3.55512 - 14.9310 -3.36898 0.00000 1.00000 3.36898 - 14.9495 -3.85281 0.00000 1.00000 3.85281 - 14.9680 -4.67590 0.00000 1.00000 4.67590 - 14.9865 -5.21922 0.00000 1.00000 5.21922 - 15.0050 -4.74479 0.00000 1.00000 4.74479 - 15.0235 -2.62144 0.00000 1.00000 2.62144 - 15.0420 1.45687 0.00000 1.00000 -1.45687 - 15.0605 7.32500 0.00000 1.00000 -7.32500 - 15.0790 14.3193 0.00000 1.00000 -14.3193 - 15.0975 21.3835 0.00000 1.00000 -21.3835 - 15.1160 27.2852 0.00000 1.00000 -27.2852 - 15.1345 30.8902 0.00000 1.00000 -30.8902 - 15.1530 31.4245 0.00000 1.00000 -31.4245 - 15.1715 28.6588 0.00000 1.00000 -28.6588 - 15.1900 22.9682 0.00000 1.00000 -22.9682 - 15.2085 15.2541 0.00000 1.00000 -15.2541 - 15.2270 6.74712 0.00000 1.00000 -6.74712 - 15.2455 -1.25964 0.00000 1.00000 1.25964 - 15.2640 -7.68049 0.00000 1.00000 7.68049 - 15.2825 -11.8442 0.00000 1.00000 11.8442 - 15.3010 -13.5919 0.00000 1.00000 13.5919 - 15.3195 -13.2493 0.00000 1.00000 13.2493 - 15.3380 -11.4916 0.00000 1.00000 11.4916 - 15.3565 -9.14144 0.00000 1.00000 9.14144 - 15.3750 -6.95504 0.00000 1.00000 6.95504 - 15.3935 -5.44896 0.00000 1.00000 5.44896 - 15.4120 -4.80772 0.00000 1.00000 4.80772 - 15.4305 -4.88897 0.00000 1.00000 4.88897 - 15.4490 -5.31706 0.00000 1.00000 5.31706 - 15.4675 -5.63285 0.00000 1.00000 5.63285 - 15.4860 -5.45462 0.00000 1.00000 5.45462 - 15.5045 -4.60459 0.00000 1.00000 4.60459 - 15.5230 -3.16776 0.00000 1.00000 3.16776 - 15.5415 -1.46992 0.00000 1.00000 1.46992 - 15.5600 0.0157586 0.00000 1.00000 -0.0157586 - 15.5785 0.806047 0.00000 1.00000 -0.806047 - 15.5970 0.550242 0.00000 1.00000 -0.550242 - 15.6155 -0.861348 0.00000 1.00000 0.861348 - 15.6340 -3.25430 0.00000 1.00000 3.25430 - 15.6525 -6.20584 0.00000 1.00000 6.20584 - 15.6710 -9.14992 0.00000 1.00000 9.14992 - 15.6895 -11.5204 0.00000 1.00000 11.5204 - 15.7080 -12.8909 0.00000 1.00000 12.8909 - 15.7265 -13.0717 0.00000 1.00000 13.0717 - 15.7450 -12.1417 0.00000 1.00000 12.1417 - 15.7635 -10.4097 0.00000 1.00000 10.4097 - 15.7820 -8.32011 0.00000 1.00000 8.32011 - 15.8005 -6.33136 0.00000 1.00000 6.33136 - 15.8190 -4.80087 0.00000 1.00000 4.80087 - 15.8375 -3.90675 0.00000 1.00000 3.90675 - 15.8560 -3.62474 0.00000 1.00000 3.62474 - 15.8745 -3.76225 0.00000 1.00000 3.76225 - 15.8930 -4.03596 0.00000 1.00000 4.03596 - 15.9115 -4.16761 0.00000 1.00000 4.16761 - 15.9300 -3.96959 0.00000 1.00000 3.96959 - 15.9485 -3.39629 0.00000 1.00000 3.39629 - 15.9670 -2.54969 0.00000 1.00000 2.54969 - 15.9855 -1.64188 0.00000 1.00000 1.64188 - 16.0040 -0.928772 0.00000 1.00000 0.928772 - 16.0225 -0.634845 0.00000 1.00000 0.634845 - 16.0410 -0.888145 0.00000 1.00000 0.888145 - 16.0595 -1.67980 0.00000 1.00000 1.67980 - 16.0780 -2.85514 0.00000 1.00000 2.85514 - 16.0965 -4.13661 0.00000 1.00000 4.13661 - 16.1150 -5.17310 0.00000 1.00000 5.17310 - 16.1335 -5.60636 0.00000 1.00000 5.60636 - 16.1520 -5.14159 0.00000 1.00000 5.14159 - 16.1705 -3.60734 0.00000 1.00000 3.60734 - 16.1890 -0.992023 0.00000 1.00000 0.992023 - 16.2075 2.54958 0.00000 1.00000 -2.54958 - 16.2260 6.71807 0.00000 1.00000 -6.71807 - 16.2445 11.1120 0.00000 1.00000 -11.1120 - 16.2630 15.2812 0.00000 1.00000 -15.2812 - 16.2815 18.7822 0.00000 1.00000 -18.7822 - 16.3000 21.2269 0.00000 1.00000 -21.2269 - 16.3185 22.3212 0.00000 1.00000 -22.3212 - 16.3370 21.8912 0.00000 1.00000 -21.8912 - 16.3555 19.8991 0.00000 1.00000 -19.8991 - 16.3740 16.4493 0.00000 1.00000 -16.4493 - 16.3925 11.7863 0.00000 1.00000 -11.7863 - 16.4110 6.28331 0.00000 1.00000 -6.28331 - 16.4295 0.418687 0.00000 1.00000 -0.418687 - 16.4480 -5.25963 0.00000 1.00000 5.25963 - 16.4665 -10.1842 0.00000 1.00000 10.1842 - 16.4850 -13.8295 0.00000 1.00000 13.8295 - 16.5035 -15.7785 0.00000 1.00000 15.7785 - 16.5220 -15.7830 0.00000 1.00000 15.7830 - 16.5405 -13.8070 0.00000 1.00000 13.8070 - 16.5590 -10.0391 0.00000 1.00000 10.0391 - 16.5775 -4.87264 0.00000 1.00000 4.87264 - 16.5960 1.14589 0.00000 1.00000 -1.14589 - 16.6145 7.38649 0.00000 1.00000 -7.38649 - 16.6330 13.2091 0.00000 1.00000 -13.2091 - 16.6515 18.0296 0.00000 1.00000 -18.0296 - 16.6700 21.3708 0.00000 1.00000 -21.3708 - 16.6885 22.8991 0.00000 1.00000 -22.8991 - 16.7070 22.4456 0.00000 1.00000 -22.4456 - 16.7255 20.0158 0.00000 1.00000 -20.0158 - 16.7440 15.7881 0.00000 1.00000 -15.7881 - 16.7625 10.1035 0.00000 1.00000 -10.1035 - 16.7810 3.44424 0.00000 1.00000 -3.44424 - 16.7995 -3.59847 0.00000 1.00000 3.59847 - 16.8180 -10.3717 0.00000 1.00000 10.3717 - 16.8365 -16.2205 0.00000 1.00000 16.2205 - 16.8550 -20.5580 0.00000 1.00000 20.5580 - 16.8735 -22.9372 0.00000 1.00000 22.9372 - 16.8920 -23.1129 0.00000 1.00000 23.1129 - 16.9105 -21.0837 0.00000 1.00000 21.0837 - 16.9290 -17.1032 0.00000 1.00000 17.1032 - 16.9475 -11.6563 0.00000 1.00000 11.6563 - 16.9660 -5.39998 0.00000 1.00000 5.39998 - 16.9845 0.923758 0.00000 1.00000 -0.923758 - 17.0030 6.59122 0.00000 1.00000 -6.59122 - 17.0215 10.9979 0.00000 1.00000 -10.9979 - 17.0400 13.7383 0.00000 1.00000 -13.7383 - 17.0585 14.6477 0.00000 1.00000 -14.6477 - 17.0770 13.7998 0.00000 1.00000 -13.7998 - 17.0955 11.4638 0.00000 1.00000 -11.4638 - 17.1140 8.03578 0.00000 1.00000 -8.03578 - 17.1325 3.96378 0.00000 1.00000 -3.96378 - 17.1510 -0.316698 0.00000 1.00000 0.316698 - 17.1695 -4.42438 0.00000 1.00000 4.42438 - 17.1880 -8.04681 0.00000 1.00000 8.04681 - 17.2065 -10.9324 0.00000 1.00000 10.9324 - 17.2250 -12.8725 0.00000 1.00000 12.8725 - 17.2435 -13.6898 0.00000 1.00000 13.6898 - 17.2620 -13.2456 0.00000 1.00000 13.2456 - 17.2805 -11.4675 0.00000 1.00000 11.4675 - 17.2990 -8.39144 0.00000 1.00000 8.39144 - 17.3175 -4.20001 0.00000 1.00000 4.20001 - 17.3360 0.758004 0.00000 1.00000 -0.758004 - 17.3545 5.98116 0.00000 1.00000 -5.98116 - 17.3730 10.8661 0.00000 1.00000 -10.8661 - 17.3915 14.7906 0.00000 1.00000 -14.7906 - 17.4100 17.2137 0.00000 1.00000 -17.2137 - 17.4285 17.7745 0.00000 1.00000 -17.7745 - 17.4470 16.3661 0.00000 1.00000 -16.3661 - 17.4655 13.1690 0.00000 1.00000 -13.1690 - 17.4840 8.63053 0.00000 1.00000 -8.63053 - 17.5025 3.39246 0.00000 1.00000 -3.39246 - 17.5210 -1.82203 0.00000 1.00000 1.82203 - 17.5395 -6.33848 0.00000 1.00000 6.33848 - 17.5580 -9.64981 0.00000 1.00000 9.64981 - 17.5765 -11.4978 0.00000 1.00000 11.4978 - 17.5950 -11.9009 0.00000 1.00000 11.9009 - 17.6135 -11.1239 0.00000 1.00000 11.1239 - 17.6320 -9.59944 0.00000 1.00000 9.59944 - 17.6505 -7.81972 0.00000 1.00000 7.81972 - 17.6690 -6.22442 0.00000 1.00000 6.22442 - 17.6875 -5.11122 0.00000 1.00000 5.11122 - 17.7060 -4.58875 0.00000 1.00000 4.58875 - 17.7245 -4.58029 0.00000 1.00000 4.58029 - 17.7430 -4.87225 0.00000 1.00000 4.87225 - 17.7615 -5.18968 0.00000 1.00000 5.18968 - 17.7800 -5.27616 0.00000 1.00000 5.27616 - 17.7985 -4.95771 0.00000 1.00000 4.95771 - 17.8170 -4.17763 0.00000 1.00000 4.17763 - 17.8355 -2.99861 0.00000 1.00000 2.99861 - 17.8540 -1.57655 0.00000 1.00000 1.57655 - 17.8725 -0.115674 0.00000 1.00000 0.115674 - 17.8910 1.18232 0.00000 1.00000 -1.18232 - 17.9095 2.16253 0.00000 1.00000 -2.16253 - 17.9280 2.74507 0.00000 1.00000 -2.74507 - 17.9465 2.93310 0.00000 1.00000 -2.93310 - 17.9650 2.80225 0.00000 1.00000 -2.80225 - 17.9835 2.47685 0.00000 1.00000 -2.47685 - 18.0020 2.09940 0.00000 1.00000 -2.09940 - 18.0205 1.79907 0.00000 1.00000 -1.79907 - 18.0390 1.66403 0.00000 1.00000 -1.66403 - 18.0575 1.72260 0.00000 1.00000 -1.72260 - 18.0760 1.93703 0.00000 1.00000 -1.93703 - 18.0945 2.21113 0.00000 1.00000 -2.21113 - 18.1130 2.40837 0.00000 1.00000 -2.40837 - 18.1315 2.37442 0.00000 1.00000 -2.37442 - 18.1500 1.95988 0.00000 1.00000 -1.95988 - 18.1685 1.04724 0.00000 1.00000 -1.04724 - 18.1870 -0.426523 0.00000 1.00000 0.426523 - 18.2055 -2.45315 0.00000 1.00000 2.45315 - 18.2240 -4.90773 0.00000 1.00000 4.90773 - 18.2425 -7.52944 0.00000 1.00000 7.52944 - 18.2610 -9.92715 0.00000 1.00000 9.92715 - 18.2795 -11.6174 0.00000 1.00000 11.6174 - 18.2980 -12.0956 0.00000 1.00000 12.0956 - 18.3165 -10.9327 0.00000 1.00000 10.9327 - 18.3350 -7.88331 0.00000 1.00000 7.88331 - 18.3535 -2.98071 0.00000 1.00000 2.98071 - 18.3720 3.40650 0.00000 1.00000 -3.40650 - 18.3905 10.5811 0.00000 1.00000 -10.5811 - 18.4090 17.5968 0.00000 1.00000 -17.5968 - 18.4275 23.4036 0.00000 1.00000 -23.4036 - 18.4460 27.0310 0.00000 1.00000 -27.0310 - 18.4645 27.7731 0.00000 1.00000 -27.7731 - 18.4830 25.3345 0.00000 1.00000 -25.3345 - 18.5015 19.9052 0.00000 1.00000 -19.9052 - 18.5200 12.1472 0.00000 1.00000 -12.1472 - 18.5385 3.09099 0.00000 1.00000 -3.09099 - 18.5570 -6.03798 0.00000 1.00000 6.03798 - 18.5755 -14.0281 0.00000 1.00000 14.0281 - 18.5940 -19.8843 0.00000 1.00000 19.8843 - 18.6125 -22.9844 0.00000 1.00000 22.9844 - 18.6310 -23.1597 0.00000 1.00000 23.1597 - 18.6495 -20.6881 0.00000 1.00000 20.6881 - 18.6680 -16.2075 0.00000 1.00000 16.2075 - 18.6865 -10.5714 0.00000 1.00000 10.5714 - 18.7050 -4.68098 0.00000 1.00000 4.68098 - 18.7235 0.671251 0.00000 1.00000 -0.671251 - 18.7420 4.91529 0.00000 1.00000 -4.91529 - 18.7605 7.75797 0.00000 1.00000 -7.75797 - 18.7790 9.17588 0.00000 1.00000 -9.17588 - 18.7975 9.35965 0.00000 1.00000 -9.35965 - 18.8160 8.63035 0.00000 1.00000 -8.63035 - 18.8345 7.35145 0.00000 1.00000 -7.35145 - 18.8530 5.85510 0.00000 1.00000 -5.85510 - 18.8715 4.39513 0.00000 1.00000 -4.39513 - 18.8900 3.13002 0.00000 1.00000 -3.13002 - 18.9085 2.13168 0.00000 1.00000 -2.13168 - 18.9270 1.40976 0.00000 1.00000 -1.40976 - 18.9455 0.939913 0.00000 1.00000 -0.939913 - 18.9640 0.686429 0.00000 1.00000 -0.686429 - 18.9825 0.614229 0.00000 1.00000 -0.614229 - 19.0010 0.690570 0.00000 1.00000 -0.690570 - 19.0195 0.880032 0.00000 1.00000 -0.880032 - 19.0380 1.13788 0.00000 1.00000 -1.13788 - 19.0565 1.40627 0.00000 1.00000 -1.40627 - 19.0750 1.61604 0.00000 1.00000 -1.61604 - 19.0935 1.69418 0.00000 1.00000 -1.69418 - 19.1120 1.57467 0.00000 1.00000 -1.57467 - 19.1305 1.20912 0.00000 1.00000 -1.20912 - 19.1490 0.574418 0.00000 1.00000 -0.574418 - 19.1675 -0.322868 0.00000 1.00000 0.322868 - 19.1860 -1.44364 0.00000 1.00000 1.44364 - 19.2045 -2.71278 0.00000 1.00000 2.71278 - 19.2230 -4.01492 0.00000 1.00000 4.01492 - 19.2415 -5.19189 0.00000 1.00000 5.19189 - 19.2600 -6.04623 0.00000 1.00000 6.04623 - 19.2785 -6.35560 0.00000 1.00000 6.35560 - 19.2970 -5.90135 0.00000 1.00000 5.90135 - 19.3155 -4.51168 0.00000 1.00000 4.51168 - 19.3340 -2.11474 0.00000 1.00000 2.11474 - 19.3525 1.20914 0.00000 1.00000 -1.20914 - 19.3710 5.19105 0.00000 1.00000 -5.19105 - 19.3895 9.36912 0.00000 1.00000 -9.36912 - 19.4080 13.1271 0.00000 1.00000 -13.1271 - 19.4265 15.7779 0.00000 1.00000 -15.7779 - 19.4450 16.6827 0.00000 1.00000 -16.6827 - 19.4635 15.3867 0.00000 1.00000 -15.3867 - 19.4820 11.7418 0.00000 1.00000 -11.7418 - 19.5005 5.98757 0.00000 1.00000 -5.98757 - 19.5190 -1.23710 0.00000 1.00000 1.23710 - 19.5375 -8.96359 0.00000 1.00000 8.96359 - 19.5560 -16.0382 0.00000 1.00000 16.0382 - 19.5745 -21.3164 0.00000 1.00000 21.3164 - 19.5930 -23.8699 0.00000 1.00000 23.8699 - 19.6115 -23.1644 0.00000 1.00000 23.1644 - 19.6300 -19.1740 0.00000 1.00000 19.1740 - 19.6485 -12.4057 0.00000 1.00000 12.4057 - 19.6670 -3.82669 0.00000 1.00000 3.82669 - 19.6855 5.29471 0.00000 1.00000 -5.29471 - 19.7040 13.6058 0.00000 1.00000 -13.6058 - 19.7225 19.9014 0.00000 1.00000 -19.9014 - 19.7410 23.3260 0.00000 1.00000 -23.3260 - 19.7595 23.5068 0.00000 1.00000 -23.5068 - 19.7780 20.5929 0.00000 1.00000 -20.5929 - 19.7965 15.1973 0.00000 1.00000 -15.1973 - 19.8150 8.25741 0.00000 1.00000 -8.25741 - 19.8335 0.846490 0.00000 1.00000 -0.846490 - 19.8520 -6.02165 0.00000 1.00000 6.02165 - 19.8705 -11.5565 0.00000 1.00000 11.5565 - 19.8890 -15.2939 0.00000 1.00000 15.2939 - 19.9075 -17.1257 0.00000 1.00000 17.1257 - 19.9260 -17.2573 0.00000 1.00000 17.2573 - 19.9445 -16.1119 0.00000 1.00000 16.1119 - 19.9630 -14.2055 0.00000 1.00000 14.2055 - 19.9815 -12.0275 0.00000 1.00000 12.0275 - 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/diffpy/pdffit2/tests/testdata/Ni.stru b/diffpy/pdffit2/tests/testdata/Ni.stru deleted file mode 100644 index b4da517c..00000000 --- a/diffpy/pdffit2/tests/testdata/Ni.stru +++ /dev/null @@ -1,33 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru b/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru deleted file mode 100644 index 71ba3651..00000000 --- a/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru +++ /dev/null @@ -1,345 +0,0 @@ -title Pb8 (Sc16/3 W8/3)0.75 (Ti8)0.25 O24, B factors from BNL2 -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 8.072700, 8.072700, 8.072700, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 56 -atoms -PB 0.25000000 0.25000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.75000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.25000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.75000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.25000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.25000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.75000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.75000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.00000000 0.25735000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.50000000 0.75735003 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.00000000 0.75735003 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.50000000 0.25735000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.00000000 0.74264997 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.50000000 0.24265000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.00000000 0.24265000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.50000000 0.74264997 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.25735000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.75735003 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.75735003 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.25735000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.74264997 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.24265000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.24265000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.74264997 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.25735000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.75735003 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.75735003 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.25735000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.74264997 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.24265000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.24265000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.74264997 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.00000000 0.00000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.50000000 0.50000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.00000000 0.50000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.50000000 0.00000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.50000000 0.50000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.00000000 0.00000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.50000000 0.00000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.00000000 0.50000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.00000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.50000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.00000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.50000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.50000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.00000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.50000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.00000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.00000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.50000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.00000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.50000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.50000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.00000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.50000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.00000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/badNi.dat b/diffpy/pdffit2/tests/testdata/badNi.dat deleted file mode 100644 index ef5b7007..00000000 --- a/diffpy/pdffit2/tests/testdata/badNi.dat +++ /dev/null @@ -1,1001 +0,0 @@ - 1.50000 -0.539443 0.00000 1.00000 0.539443 - 1.51850 -1.03098 0.00000 1.00000 1.03098 - 1.53700 -1.43712 0.00000 1.00000 1.43712 - 1.55550 -1.73810 0.00000 1.00000 1.73810 - 1.57400 -1.93402 0.00000 1.00000 1.93402 - 1.59250 -2.04145 0.00000 1.00000 2.04145 - 1.61100 -2.08593 0.00000 1.00000 2.08593 - 1.62950 -2.09295 0.00000 1.00000 2.09295 - 1.64800 -2.08072 0.00000 1.00000 2.08072 - 1.66650 -2.05688 0.00000 1.00000 2.05688 - 1.68500 -2.02006 0.00000 1.00000 2.02006 - 1.70350 -1.96554 0.00000 1.00000 1.96554 - 1.72200 -1.89239 0.00000 1.00000 1.89239 - 1.74050 -1.80936 0.00000 1.00000 1.80936 - 1.75900 -1.73670 0.00000 1.00000 1.73670 - 1.77750 -1.70255 0.00000 1.00000 1.70255 - 1.79600 -1.73461 0.00000 1.00000 1.73461 - 1.81450 -1.84946 0.00000 1.00000 1.84946 - 1.83300 -2.04300 0.00000 1.00000 2.04300 - 1.85150 -2.28566 0.00000 1.00000 2.28566 - 1.87000 -2.52486 0.00000 1.00000 2.52486 - 1.88850 -2.69615 0.00000 1.00000 2.69615 - 1.92700 -2.74180 0.00000 1.00000 2.74180 - 1.92550 -2.63223 0.00000 1.00000 2.63223 - 1.94400 -2.38239 0.00000 1.00000 2.38239 - 1.96250 -2.05565 0.00000 1.00000 2.05565 - 1.98100 -1.75092 0.00000 1.00000 1.75092 - 1.99950 -1.57518 0.00000 1.00000 1.57518 - 2.01800 -1.60914 0.00000 1.00000 1.60914 - 2.03650 -1.87687 0.00000 1.00000 1.87687 - 2.05500 -2.33004 0.00000 1.00000 2.33004 - 2.07350 -2.85357 0.00000 1.00000 2.85357 - 2.09200 -3.29353 0.00000 1.00000 3.29353 - 2.11050 -3.50124 0.00000 1.00000 3.50124 - 2.12900 -3.38172 0.00000 1.00000 3.38172 - 2.14750 -2.93205 0.00000 1.00000 2.93205 - 2.16600 -2.25629 0.00000 1.00000 2.25629 - 2.18450 -1.54918 0.00000 1.00000 1.54918 - 2.20300 -1.04888 0.00000 1.00000 1.04888 - 2.22150 -0.968136 0.00000 1.00000 0.968136 - 2.24000 -1.42070 0.00000 1.00000 1.42070 - 2.25850 -2.36300 0.00000 1.00000 2.36300 - 2.27700 -3.56960 0.00000 1.00000 3.56960 - 2.29550 -4.65416 0.00000 1.00000 4.65416 - 2.31400 -5.13684 0.00000 1.00000 5.13684 - 2.33250 -4.54696 0.00000 1.00000 4.54696 - 2.35100 -2.53890 0.00000 1.00000 2.53890 - 2.36950 1.00656 0.00000 1.00000 -1.00656 - 2.38800 5.92223 0.00000 1.00000 -5.92223 - 2.40650 11.7527 0.00000 1.00000 -11.7527 - 2.42500 17.8143 0.00000 1.00000 -17.8143 - 2.44350 23.3057 0.00000 1.00000 -23.3057 - 2.46200 27.4478 0.00000 1.00000 -27.4478 - 2.48050 29.6246 0.00000 1.00000 -29.6246 - 2.49900 29.4986 0.00000 1.00000 -29.4986 - 2.51750 27.0749 0.00000 1.00000 -27.0749 - 2.53600 22.7028 0.00000 1.00000 -22.7028 - 2.55450 17.0112 0.00000 1.00000 -17.0112 - 2.57300 10.7932 0.00000 1.00000 -10.7932 - 2.59150 4.86134 0.00000 1.00000 -4.86134 - 2.61000 -0.0945224 0.00000 1.00000 0.0945224 - 2.62850 -3.61858 0.00000 1.00000 3.61858 - 2.64700 -5.54803 0.00000 1.00000 5.54803 - 2.66550 -6.01016 0.00000 1.00000 6.01016 - 2.68400 -5.36293 0.00000 1.00000 5.36293 - 2.70250 -4.09596 0.00000 1.00000 4.09596 - 2.72100 -2.71625 0.00000 1.00000 2.71625 - 2.73950 -1.64382 0.00000 1.00000 1.64382 - 2.75800 -1.13791 0.00000 1.00000 1.13791 - 2.77650 -1.26649 0.00000 1.00000 1.26649 - 2.79500 -1.92103 0.00000 1.00000 1.92103 - 2.81350 -2.86890 0.00000 1.00000 2.86890 - 2.83200 -3.82782 0.00000 1.00000 3.82782 - 2.85050 -4.54328 0.00000 1.00000 4.54328 - 2.86900 -4.85054 0.00000 1.00000 4.85054 - 2.88750 -4.70809 0.00000 1.00000 4.70809 - 2.90600 -4.19687 0.00000 1.00000 4.19687 - 2.92450 -3.48841 0.00000 1.00000 3.48841 - 2.94300 -2.79256 0.00000 1.00000 2.79256 - 2.96150 -2.29993 0.00000 1.00000 2.29993 - 2.98000 -2.13422 0.00000 1.00000 2.13422 - 2.99850 -2.32552 0.00000 1.00000 2.32552 - 3.01700 -2.80931 0.00000 1.00000 2.80931 - 3.03550 -3.44928 0.00000 1.00000 3.44928 - 3.05400 -4.07624 0.00000 1.00000 4.07624 - 3.07250 -4.53264 0.00000 1.00000 4.53264 - 3.09100 -4.71141 0.00000 1.00000 4.71141 - 3.10950 -4.58013 0.00000 1.00000 4.58013 - 3.12800 -4.18572 0.00000 1.00000 4.18572 - 3.14650 -3.63955 0.00000 1.00000 3.63955 - 3.16500 -3.08796 0.00000 1.00000 3.08796 - 3.18350 -2.67579 0.00000 1.00000 2.67579 - 3.20200 -2.51194 0.00000 1.00000 2.51194 - 3.22050 -2.64475 0.00000 1.00000 2.64475 - 3.23900 -3.05186 0.00000 1.00000 3.05186 - 3.25750 -3.64576 0.00000 1.00000 3.64576 - 3.27600 -4.29257 0.00000 1.00000 4.29257 - 3.29450 -4.83876 0.00000 1.00000 4.83876 - 3.31300 -5.14008 0.00000 1.00000 5.14008 - 3.33150 -5.08721 0.00000 1.00000 5.08721 - 3.35000 -4.62391 0.00000 1.00000 4.62391 - 3.36850 -3.75470 0.00000 1.00000 3.75470 - 3.38700 -2.54063 0.00000 1.00000 2.54063 - 3.40550 -1.08396 0.00000 1.00000 1.08396 - 3.42400 0.493223 0.00000 1.00000 -0.493223 - 3.44250 2.06874 0.00000 1.00000 -2.06874 - 3.46100 3.53152 0.00000 1.00000 -3.53152 - 3.47950 4.78254 0.00000 1.00000 -4.78254 - 3.49800 5.72969 0.00000 1.00000 -5.72969 - 3.51650 6.28423 0.00000 1.00000 -6.28423 - 3.53500 6.36504 0.00000 1.00000 -6.36504 - 3.55350 5.91247 0.00000 1.00000 -5.91247 - 3.57200 4.90861 0.00000 1.00000 -4.90861 - 3.59050 3.39740 0.00000 1.00000 -3.39740 - 3.60900 1.49612 0.00000 1.00000 -1.49612 - 3.62750 -0.608193 0.00000 1.00000 0.608193 - 3.64600 -2.68019 0.00000 1.00000 2.68019 - 3.66450 -4.47243 0.00000 1.00000 4.47243 - 3.68300 -5.76925 0.00000 1.00000 5.76925 - 3.70150 -6.42920 0.00000 1.00000 6.42920 - 3.72000 -6.41719 0.00000 1.00000 6.41719 - 3.73850 -5.81875 0.00000 1.00000 5.81875 - 3.75700 -4.83074 0.00000 1.00000 4.83074 - 3.77550 -3.72667 0.00000 1.00000 3.72667 - 3.79400 -2.80071 0.00000 1.00000 2.80071 - 3.81250 -2.30147 0.00000 1.00000 2.30147 - 3.83100 -2.37126 0.00000 1.00000 2.37126 - 3.84950 -3.00713 0.00000 1.00000 3.00713 - 3.86800 -4.05566 0.00000 1.00000 4.05566 - 3.88650 -5.24604 0.00000 1.00000 5.24604 - 3.90500 -6.25585 0.00000 1.00000 6.25585 - 3.92350 -6.79521 0.00000 1.00000 6.79521 - 3.94200 -6.68830 0.00000 1.00000 6.68830 - 3.96050 -5.93010 0.00000 1.00000 5.93010 - 3.97900 -4.70113 0.00000 1.00000 4.70113 - 3.99750 -3.33259 0.00000 1.00000 3.33259 - 4.01600 -2.22683 0.00000 1.00000 2.22683 - 4.03450 -1.75037 0.00000 1.00000 1.75037 - 4.05300 -2.12498 0.00000 1.00000 2.12498 - 4.07150 -3.34471 0.00000 1.00000 3.34471 - 4.09000 -5.14253 0.00000 1.00000 5.14253 - 4.10850 -7.01935 0.00000 1.00000 7.01935 - 4.12700 -8.33391 0.00000 1.00000 8.33391 - 4.14550 -8.43660 0.00000 1.00000 8.43660 - 4.16400 -6.81920 0.00000 1.00000 6.81920 - 4.18250 -3.24667 0.00000 1.00000 3.24667 - 4.20100 2.16009 0.00000 1.00000 -2.16009 - 4.21950 8.91152 0.00000 1.00000 -8.91152 - 4.23800 16.2134 0.00000 1.00000 -16.2134 - 4.25650 23.0973 0.00000 1.00000 -23.0973 - 4.27500 28.5935 0.00000 1.00000 -28.5935 - 4.29350 31.9106 0.00000 1.00000 -31.9106 - 4.31200 32.5842 0.00000 1.00000 -32.5842 - 4.33050 30.5617 0.00000 1.00000 -30.5617 - 4.34900 26.2027 0.00000 1.00000 -26.2027 - 4.36750 20.1990 0.00000 1.00000 -20.1990 - 4.38600 13.4320 0.00000 1.00000 -13.4320 - 4.40450 6.80337 0.00000 1.00000 -6.80337 - 4.42300 1.07527 0.00000 1.00000 -1.07527 - 4.44150 -3.24700 0.00000 1.00000 3.24700 - 4.46000 -5.96945 0.00000 1.00000 5.96945 - 4.47850 -7.19581 0.00000 1.00000 7.19581 - 4.49700 -7.25613 0.00000 1.00000 7.25613 - 4.51550 -6.59972 0.00000 1.00000 6.59972 - 4.53400 -5.68054 0.00000 1.00000 5.68054 - 4.55250 -4.86170 0.00000 1.00000 4.86170 - 4.57100 -4.35835 0.00000 1.00000 4.35835 - 4.58950 -4.22677 0.00000 1.00000 4.22677 - 4.60800 -4.39508 0.00000 1.00000 4.39508 - 4.62650 -4.72130 0.00000 1.00000 4.72130 - 4.64500 -5.05871 0.00000 1.00000 5.05871 - 4.66350 -5.30848 0.00000 1.00000 5.30848 - 4.68200 -5.44197 0.00000 1.00000 5.44197 - 4.70050 -5.50097 0.00000 1.00000 5.50097 - 4.71900 -5.56456 0.00000 1.00000 5.56456 - 4.73750 -5.69659 0.00000 1.00000 5.69659 - 4.75600 -5.90806 0.00000 1.00000 5.90806 - 4.77450 -6.13525 0.00000 1.00000 6.13525 - 4.79300 -6.24364 0.00000 1.00000 6.24364 - 4.81150 -6.05670 0.00000 1.00000 6.05670 - 4.83000 -5.40165 0.00000 1.00000 5.40165 - 4.84850 -4.16022 0.00000 1.00000 4.16022 - 4.86700 -2.31100 0.00000 1.00000 2.31100 - 4.88550 0.0479985 0.00000 1.00000 -0.0479985 - 4.90400 2.70271 0.00000 1.00000 -2.70271 - 4.92250 5.35252 0.00000 1.00000 -5.35252 - 4.94100 7.65960 0.00000 1.00000 -7.65960 - 4.95950 9.30734 0.00000 1.00000 -9.30734 - 4.97800 10.0558 0.00000 1.00000 -10.0558 - 4.99650 9.78268 0.00000 1.00000 -9.78268 - 5.01500 8.50309 0.00000 1.00000 -8.50309 - 5.03350 6.36470 0.00000 1.00000 -6.36470 - 5.05200 3.62252 0.00000 1.00000 -3.62252 - 5.07050 0.599290 0.00000 1.00000 -0.599290 - 5.08900 -2.36086 0.00000 1.00000 2.36086 - 5.10750 -4.93870 0.00000 1.00000 4.93870 - 5.12600 -6.88149 0.00000 1.00000 6.88149 - 5.14450 -8.03565 0.00000 1.00000 8.03565 - 5.16300 -8.36668 0.00000 1.00000 8.36668 - 5.18150 -7.96304 0.00000 1.00000 7.96304 - 5.20000 -7.02207 0.00000 1.00000 7.02207 - 5.21850 -5.81895 0.00000 1.00000 5.81895 - 5.23700 -4.66171 0.00000 1.00000 4.66171 - 5.25550 -3.83844 0.00000 1.00000 3.83844 - 5.27400 -3.56410 0.00000 1.00000 3.56410 - 5.29250 -3.93573 0.00000 1.00000 3.93573 - 5.31100 -4.90467 0.00000 1.00000 4.90467 - 5.32950 -6.27267 0.00000 1.00000 6.27267 - 5.34800 -7.71536 0.00000 1.00000 7.71536 - 5.36650 -8.83203 0.00000 1.00000 8.83203 - 5.38500 -9.21516 0.00000 1.00000 9.21516 - 5.40350 -8.52808 0.00000 1.00000 8.52808 - 5.42200 -6.57611 0.00000 1.00000 6.57611 - 5.44050 -3.35625 0.00000 1.00000 3.35625 - 5.45900 0.925287 0.00000 1.00000 -0.925287 - 5.47750 5.87209 0.00000 1.00000 -5.87209 - 5.49600 10.9500 0.00000 1.00000 -10.9500 - 5.51450 15.5640 0.00000 1.00000 -15.5640 - 5.53300 19.1477 0.00000 1.00000 -19.1477 - 5.55150 21.2490 0.00000 1.00000 -21.2490 - 5.57000 21.6003 0.00000 1.00000 -21.6003 - 5.58850 20.1588 0.00000 1.00000 -20.1588 - 5.60700 17.1124 0.00000 1.00000 -17.1124 - 5.62550 12.8494 0.00000 1.00000 -12.8494 - 5.64400 7.89927 0.00000 1.00000 -7.89927 - 5.66250 2.85190 0.00000 1.00000 -2.85190 - 5.68100 -1.72997 0.00000 1.00000 1.72997 - 5.69950 -5.39381 0.00000 1.00000 5.39381 - 5.71800 -7.86162 0.00000 1.00000 7.86162 - 5.73650 -9.06420 0.00000 1.00000 9.06420 - 5.75500 -9.13837 0.00000 1.00000 9.13837 - 5.77350 -8.38683 0.00000 1.00000 8.38683 - 5.79200 -7.20818 0.00000 1.00000 7.20818 - 5.81050 -6.01172 0.00000 1.00000 6.01172 - 5.82900 -5.13567 0.00000 1.00000 5.13567 - 5.84750 -4.78662 0.00000 1.00000 4.78662 - 5.86600 -5.01125 0.00000 1.00000 5.01125 - 5.88450 -5.70222 0.00000 1.00000 5.70222 - 5.90300 -6.63275 0.00000 1.00000 6.63275 - 5.92150 -7.51031 0.00000 1.00000 7.51031 - 5.94000 -8.03914 0.00000 1.00000 8.03914 - 5.95850 -7.98163 0.00000 1.00000 7.98163 - 5.97700 -7.20897 0.00000 1.00000 7.20897 - 5.99550 -5.73309 0.00000 1.00000 5.73309 - 6.01400 -3.71335 0.00000 1.00000 3.71335 - 6.03250 -1.43572 0.00000 1.00000 1.43572 - 6.05100 0.734316 0.00000 1.00000 -0.734316 - 6.06950 2.41816 0.00000 1.00000 -2.41816 - 6.08800 3.29880 0.00000 1.00000 -3.29880 - 6.10650 3.18922 0.00000 1.00000 -3.18922 - 6.12500 2.07961 0.00000 1.00000 -2.07961 - 6.14350 0.150522 0.00000 1.00000 -0.150522 - 6.16200 -2.25436 0.00000 1.00000 2.25436 - 6.18050 -4.69426 0.00000 1.00000 4.69426 - 6.19900 -6.72460 0.00000 1.00000 6.72460 - 6.21750 -7.99834 0.00000 1.00000 7.99834 - 6.23600 -8.35142 0.00000 1.00000 8.35142 - 6.25450 -7.84948 0.00000 1.00000 7.84948 - 6.27300 -6.78013 0.00000 1.00000 6.78013 - 6.29150 -5.58671 0.00000 1.00000 5.58671 - 6.31000 -4.75441 0.00000 1.00000 4.75441 - 6.32850 -4.67266 0.00000 1.00000 4.67266 - 6.34700 -5.50714 0.00000 1.00000 5.50714 - 6.36550 -7.11590 0.00000 1.00000 7.11590 - 6.38400 -9.03699 0.00000 1.00000 9.03699 - 6.40250 -10.5592 0.00000 1.00000 10.5592 - 6.42100 -10.8676 0.00000 1.00000 10.8676 - 6.43950 -9.23379 0.00000 1.00000 9.23379 - 6.45800 -5.20861 0.00000 1.00000 5.20861 - 6.47650 1.23011 0.00000 1.00000 -1.23011 - 6.49500 9.61241 0.00000 1.00000 -9.61241 - 6.51350 19.0142 0.00000 1.00000 -19.0142 - 6.53200 28.1967 0.00000 1.00000 -28.1967 - 6.55050 35.8243 0.00000 1.00000 -35.8243 - 6.56900 40.7166 0.00000 1.00000 -40.7166 - 6.58750 42.0833 0.00000 1.00000 -42.0833 - 6.60600 39.6873 0.00000 1.00000 -39.6873 - 6.62450 33.8989 0.00000 1.00000 -33.8989 - 6.64300 25.6256 0.00000 1.00000 -25.6256 - 6.66150 16.1324 0.00000 1.00000 -16.1324 - 6.68000 6.79125 0.00000 1.00000 -6.79125 - 6.69850 -1.18411 0.00000 1.00000 1.18411 - 6.71700 -6.95910 0.00000 1.00000 6.95910 - 6.73550 -10.2079 0.00000 1.00000 10.2079 - 6.75400 -11.1248 0.00000 1.00000 11.1248 - 6.77250 -10.3198 0.00000 1.00000 10.3198 - 6.79100 -8.62815 0.00000 1.00000 8.62815 - 6.80950 -6.88571 0.00000 1.00000 6.88571 - 6.82800 -5.72660 0.00000 1.00000 5.72660 - 6.84650 -5.45332 0.00000 1.00000 5.45332 - 6.86500 -6.00649 0.00000 1.00000 6.00649 - 6.88350 -7.03437 0.00000 1.00000 7.03437 - 6.90200 -8.03570 0.00000 1.00000 8.03570 - 6.92050 -8.53209 0.00000 1.00000 8.53209 - 6.93900 -8.22002 0.00000 1.00000 8.22002 - 6.95750 -7.06140 0.00000 1.00000 7.06140 - 6.97600 -5.29017 0.00000 1.00000 5.29017 - 6.99450 -3.33754 0.00000 1.00000 3.33754 - 7.01300 -1.70148 0.00000 1.00000 1.70148 - 7.03150 -0.800760 0.00000 1.00000 0.800760 - 7.05000 -0.856664 0.00000 1.00000 0.856664 - 7.06850 -1.83505 0.00000 1.00000 1.83505 - 7.08700 -3.46358 0.00000 1.00000 3.46358 - 7.10550 -5.31731 0.00000 1.00000 5.31731 - 7.12400 -6.94715 0.00000 1.00000 6.94715 - 7.14250 -8.01332 0.00000 1.00000 8.01332 - 7.16100 -8.38320 0.00000 1.00000 8.38320 - 7.17950 -8.16268 0.00000 1.00000 8.16268 - 7.19800 -7.64952 0.00000 1.00000 7.64952 - 7.21650 -7.22129 0.00000 1.00000 7.22129 - 7.23500 -7.19206 0.00000 1.00000 7.19206 - 7.25350 -7.68220 0.00000 1.00000 7.68220 - 7.27200 -8.54371 0.00000 1.00000 8.54371 - 7.29050 -9.36819 0.00000 1.00000 9.36819 - 7.30900 -9.58072 0.00000 1.00000 9.58072 - 7.32750 -8.59790 0.00000 1.00000 8.59790 - 7.34600 -6.00785 0.00000 1.00000 6.00785 - 7.36450 -1.72106 0.00000 1.00000 1.72106 - 7.38300 3.95269 0.00000 1.00000 -3.95269 - 7.40150 10.3276 0.00000 1.00000 -10.3276 - 7.42000 16.4640 0.00000 1.00000 -16.4640 - 7.43850 21.3618 0.00000 1.00000 -21.3618 - 7.45700 24.1782 0.00000 1.00000 -24.1782 - 7.47550 24.4162 0.00000 1.00000 -24.4162 - 7.49400 22.0356 0.00000 1.00000 -22.0356 - 7.51250 17.4573 0.00000 1.00000 -17.4573 - 7.53100 11.4623 0.00000 1.00000 -11.4623 - 7.54950 5.01118 0.00000 1.00000 -5.01118 - 7.56800 -0.965076 0.00000 1.00000 0.965076 - 7.58650 -5.75153 0.00000 1.00000 5.75153 - 7.60500 -8.96799 0.00000 1.00000 8.96799 - 7.62350 -10.5969 0.00000 1.00000 10.5969 - 7.64200 -10.9206 0.00000 1.00000 10.9206 - 7.66050 -10.3893 0.00000 1.00000 10.3893 - 7.67900 -9.46200 0.00000 1.00000 9.46200 - 7.69750 -8.46444 0.00000 1.00000 8.46444 - 7.71600 -7.50854 0.00000 1.00000 7.50854 - 7.73450 -6.49304 0.00000 1.00000 6.49304 - 7.75300 -5.18168 0.00000 1.00000 5.18168 - 7.77150 -3.32911 0.00000 1.00000 3.32911 - 7.79000 -0.811546 0.00000 1.00000 0.811546 - 7.80850 2.28073 0.00000 1.00000 -2.28073 - 7.82700 5.61902 0.00000 1.00000 -5.61902 - 7.84550 8.68909 0.00000 1.00000 -8.68909 - 7.86400 10.9073 0.00000 1.00000 -10.9073 - 7.88250 11.7676 0.00000 1.00000 -11.7676 - 7.90100 10.9777 0.00000 1.00000 -10.9777 - 7.91950 8.54633 0.00000 1.00000 -8.54633 - 7.93800 4.79627 0.00000 1.00000 -4.79627 - 7.95650 0.300695 0.00000 1.00000 -0.300695 - 7.97500 -4.24152 0.00000 1.00000 4.24152 - 7.99350 -8.15787 0.00000 1.00000 8.15787 - 8.01200 -10.9420 0.00000 1.00000 10.9420 - 8.03050 -12.3456 0.00000 1.00000 12.3456 - 8.04900 -12.4001 0.00000 1.00000 12.4001 - 8.06750 -11.3663 0.00000 1.00000 11.3663 - 8.08600 -9.63181 0.00000 1.00000 9.63181 - 8.10450 -7.58723 0.00000 1.00000 7.58723 - 8.12300 -5.52117 0.00000 1.00000 5.52117 - 8.14150 -3.56353 0.00000 1.00000 3.56353 - 8.16000 -1.69260 0.00000 1.00000 1.69260 - 8.17850 0.199827 0.00000 1.00000 -0.199827 - 8.19700 2.21044 0.00000 1.00000 -2.21044 - 8.21550 4.33057 0.00000 1.00000 -4.33057 - 8.23400 6.39218 0.00000 1.00000 -6.39218 - 8.25250 8.07555 0.00000 1.00000 -8.07555 - 8.27100 8.97896 0.00000 1.00000 -8.97896 - 8.28950 8.73073 0.00000 1.00000 -8.73073 - 8.30800 7.11016 0.00000 1.00000 -7.11016 - 8.32650 4.14151 0.00000 1.00000 -4.14151 - 8.34500 0.130936 0.00000 1.00000 -0.130936 - 8.36350 -4.36837 0.00000 1.00000 4.36837 - 8.38200 -8.65854 0.00000 1.00000 8.65854 - 8.40050 -12.0433 0.00000 1.00000 12.0433 - 8.41900 -13.9807 0.00000 1.00000 13.9807 - 8.43750 -14.2030 0.00000 1.00000 14.2030 - 8.45600 -12.7704 0.00000 1.00000 12.7704 - 8.47450 -10.0445 0.00000 1.00000 10.0445 - 8.49300 -6.58938 0.00000 1.00000 6.58938 - 8.51150 -3.02663 0.00000 1.00000 3.02663 - 8.53000 0.112114 0.00000 1.00000 -0.112114 - 8.54850 2.49566 0.00000 1.00000 -2.49566 - 8.56700 4.03580 0.00000 1.00000 -4.03580 - 8.58550 4.85377 0.00000 1.00000 -4.85377 - 8.60400 5.18537 0.00000 1.00000 -5.18537 - 8.62250 5.25808 0.00000 1.00000 -5.25808 - 8.64100 5.18193 0.00000 1.00000 -5.18193 - 8.65950 4.89182 0.00000 1.00000 -4.89182 - 8.67800 4.16349 0.00000 1.00000 -4.16349 - 8.69650 2.70252 0.00000 1.00000 -2.70252 - 8.71500 0.282220 0.00000 1.00000 -0.282220 - 8.73350 -3.11124 0.00000 1.00000 3.11124 - 8.75200 -7.17490 0.00000 1.00000 7.17490 - 8.77050 -11.2672 0.00000 1.00000 11.2672 - 8.78900 -14.4886 0.00000 1.00000 14.4886 - 8.80750 -15.8559 0.00000 1.00000 15.8559 - 8.82600 -14.5328 0.00000 1.00000 14.5328 - 8.84450 -10.0609 0.00000 1.00000 10.0609 - 8.86300 -2.52773 0.00000 1.00000 2.52773 - 8.88150 7.37428 0.00000 1.00000 -7.37428 - 8.90000 18.4240 0.00000 1.00000 -18.4240 - 8.91850 29.0726 0.00000 1.00000 -29.0726 - 8.93700 37.7295 0.00000 1.00000 -37.7295 - 8.95550 43.0717 0.00000 1.00000 -43.0717 - 8.97400 44.3044 0.00000 1.00000 -44.3044 - 8.99250 41.3154 0.00000 1.00000 -41.3154 - 9.01100 34.6857 0.00000 1.00000 -34.6857 - 9.02950 25.5570 0.00000 1.00000 -25.5570 - 9.04800 15.3859 0.00000 1.00000 -15.3859 - 9.06650 5.64529 0.00000 1.00000 -5.64529 - 9.08500 -2.45985 0.00000 1.00000 2.45985 - 9.10350 -8.19758 0.00000 1.00000 8.19758 - 9.12200 -11.3936 0.00000 1.00000 11.3936 - 9.14050 -12.3840 0.00000 1.00000 12.3840 - 9.15900 -11.8591 0.00000 1.00000 11.8591 - 9.17750 -10.6446 0.00000 1.00000 10.6446 - 9.19600 -9.48212 0.00000 1.00000 9.48212 - 9.21450 -8.86286 0.00000 1.00000 8.86286 - 9.23300 -8.95166 0.00000 1.00000 8.95166 - 9.25150 -9.60978 0.00000 1.00000 9.60978 - 9.27000 -10.4985 0.00000 1.00000 10.4985 - 9.28850 -11.2264 0.00000 1.00000 11.2264 - 9.30700 -11.4956 0.00000 1.00000 11.4956 - 9.32550 -11.2056 0.00000 1.00000 11.2056 - 9.34400 -10.4851 0.00000 1.00000 10.4851 - 9.36250 -9.64367 0.00000 1.00000 9.64367 - 9.38100 -9.05839 0.00000 1.00000 9.05839 - 9.39950 -9.03059 0.00000 1.00000 9.03059 - 9.41800 -9.65891 0.00000 1.00000 9.65891 - 9.43650 -10.7695 0.00000 1.00000 10.7695 - 9.45500 -11.9282 0.00000 1.00000 11.9282 - 9.47350 -12.5352 0.00000 1.00000 12.5352 - 9.49200 -11.9793 0.00000 1.00000 11.9793 - 9.51050 -9.80968 0.00000 1.00000 9.80968 - 9.52900 -5.88098 0.00000 1.00000 5.88098 - 9.54750 -0.429865 0.00000 1.00000 0.429865 - 9.56600 5.93738 0.00000 1.00000 -5.93738 - 9.58450 12.3467 0.00000 1.00000 -12.3467 - 9.60300 17.8253 0.00000 1.00000 -17.8253 - 9.62150 21.4983 0.00000 1.00000 -21.4983 - 9.64000 22.7684 0.00000 1.00000 -22.7684 - 9.65850 21.4353 0.00000 1.00000 -21.4353 - 9.67700 17.7297 0.00000 1.00000 -17.7297 - 9.69550 12.2556 0.00000 1.00000 -12.2556 - 9.71400 5.85940 0.00000 1.00000 -5.85940 - 9.73250 -0.539853 0.00000 1.00000 0.539853 - 9.75100 -6.11696 0.00000 1.00000 6.11696 - 9.76950 -10.2704 0.00000 1.00000 10.2704 - 9.78800 -12.6954 0.00000 1.00000 12.6954 - 9.80650 -13.3941 0.00000 1.00000 13.3941 - 9.82500 -12.6315 0.00000 1.00000 12.6315 - 9.84350 -10.8487 0.00000 1.00000 10.8487 - 9.86200 -8.55755 0.00000 1.00000 8.55755 - 9.88050 -6.24003 0.00000 1.00000 6.24003 - 9.89900 -4.27478 0.00000 1.00000 4.27478 - 9.91750 -2.90328 0.00000 1.00000 2.90328 - 9.93600 -2.23386 0.00000 1.00000 2.23386 - 9.95450 -2.27104 0.00000 1.00000 2.27104 - 9.97300 -2.95175 0.00000 1.00000 2.95175 - 9.99150 -4.17209 0.00000 1.00000 4.17209 - 10.0100 -5.79607 0.00000 1.00000 5.79607 - 10.0285 -7.64859 0.00000 1.00000 7.64859 - 10.0470 -9.50283 0.00000 1.00000 9.50283 - 10.0655 -11.0757 0.00000 1.00000 11.0757 - 10.0840 -12.0425 0.00000 1.00000 12.0425 - 10.1025 -12.0751 0.00000 1.00000 12.0751 - 10.1210 -10.9017 0.00000 1.00000 10.9017 - 10.1395 -8.37613 0.00000 1.00000 8.37613 - 10.1580 -4.54026 0.00000 1.00000 4.54026 - 10.1765 0.338357 0.00000 1.00000 -0.338357 - 10.1950 5.76996 0.00000 1.00000 -5.76996 - 10.2135 11.0939 0.00000 1.00000 -11.0939 - 10.2320 15.5741 0.00000 1.00000 -15.5741 - 10.2505 18.5225 0.00000 1.00000 -18.5225 - 10.2690 19.4270 0.00000 1.00000 -19.4270 - 10.2875 18.0567 0.00000 1.00000 -18.0567 - 10.3060 14.5227 0.00000 1.00000 -14.5227 - 10.3245 9.27796 0.00000 1.00000 -9.27796 - 10.3430 3.05599 0.00000 1.00000 -3.05599 - 10.3615 -3.24345 0.00000 1.00000 3.24345 - 10.3800 -8.70145 0.00000 1.00000 8.70145 - 10.3985 -12.5330 0.00000 1.00000 12.5330 - 10.4170 -14.2182 0.00000 1.00000 14.2182 - 10.4355 -13.5885 0.00000 1.00000 13.5885 - 10.4540 -10.8525 0.00000 1.00000 10.8525 - 10.4725 -6.55772 0.00000 1.00000 6.55772 - 10.4910 -1.49640 0.00000 1.00000 1.49640 - 10.5095 3.42852 0.00000 1.00000 -3.42852 - 10.5280 7.35363 0.00000 1.00000 -7.35363 - 10.5465 9.59717 0.00000 1.00000 -9.59717 - 10.5650 9.77054 0.00000 1.00000 -9.77054 - 10.5835 7.84234 0.00000 1.00000 -7.84234 - 10.6020 4.14584 0.00000 1.00000 -4.14584 - 10.6205 -0.671143 0.00000 1.00000 0.671143 - 10.6390 -5.74603 0.00000 1.00000 5.74603 - 10.6575 -10.1361 0.00000 1.00000 10.1361 - 10.6760 -12.9671 0.00000 1.00000 12.9671 - 10.6945 -13.5738 0.00000 1.00000 13.5738 - 10.7130 -11.6108 0.00000 1.00000 11.6108 - 10.7315 -7.11852 0.00000 1.00000 7.11852 - 10.7500 -0.532582 0.00000 1.00000 0.532582 - 10.7685 7.36496 0.00000 1.00000 -7.36496 - 10.7870 15.5502 0.00000 1.00000 -15.5502 - 10.8055 22.9046 0.00000 1.00000 -22.9046 - 10.8240 28.3836 0.00000 1.00000 -28.3836 - 10.8425 31.1819 0.00000 1.00000 -31.1819 - 10.8610 30.8667 0.00000 1.00000 -30.8667 - 10.8795 27.4544 0.00000 1.00000 -27.4544 - 10.8980 21.4174 0.00000 1.00000 -21.4174 - 10.9165 13.6149 0.00000 1.00000 -13.6149 - 10.9350 5.15717 0.00000 1.00000 -5.15717 - 10.9535 -2.77403 0.00000 1.00000 2.77403 - 10.9720 -9.11963 0.00000 1.00000 9.11963 - 10.9905 -13.1166 0.00000 1.00000 13.1166 - 11.0090 -14.4189 0.00000 1.00000 14.4189 - 11.0275 -13.1446 0.00000 1.00000 13.1446 - 11.0460 -9.84069 0.00000 1.00000 9.84069 - 11.0645 -5.37361 0.00000 1.00000 5.37361 - 11.0830 -0.766336 0.00000 1.00000 0.766336 - 11.1015 2.99059 0.00000 1.00000 -2.99059 - 11.1200 5.12102 0.00000 1.00000 -5.12102 - 11.1385 5.20555 0.00000 1.00000 -5.20555 - 11.1570 3.25580 0.00000 1.00000 -3.25580 - 11.1755 -0.295787 0.00000 1.00000 0.295787 - 11.1940 -4.68917 0.00000 1.00000 4.68917 - 11.2125 -8.99252 0.00000 1.00000 8.99252 - 11.2310 -12.2872 0.00000 1.00000 12.2872 - 11.2495 -13.8447 0.00000 1.00000 13.8447 - 11.2680 -13.2610 0.00000 1.00000 13.2610 - 11.2865 -10.5280 0.00000 1.00000 10.5280 - 11.3050 -6.02790 0.00000 1.00000 6.02790 - 11.3235 -0.457428 0.00000 1.00000 0.457428 - 11.3420 5.30272 0.00000 1.00000 -5.30272 - 11.3605 10.3468 0.00000 1.00000 -10.3468 - 11.3790 13.9003 0.00000 1.00000 -13.9003 - 11.3975 15.4459 0.00000 1.00000 -15.4459 - 11.4160 14.7993 0.00000 1.00000 -14.7993 - 11.4345 12.1251 0.00000 1.00000 -12.1251 - 11.4530 7.89515 0.00000 1.00000 -7.89515 - 11.4715 2.79743 0.00000 1.00000 -2.79743 - 11.4900 -2.38402 0.00000 1.00000 2.38402 - 11.5085 -6.89848 0.00000 1.00000 6.89848 - 11.5270 -10.1446 0.00000 1.00000 10.1446 - 11.5455 -11.7562 0.00000 1.00000 11.7562 - 11.5640 -11.6477 0.00000 1.00000 11.6477 - 11.5825 -10.0156 0.00000 1.00000 10.0156 - 11.6010 -7.29778 0.00000 1.00000 7.29778 - 11.6195 -4.09885 0.00000 1.00000 4.09885 - 11.6380 -1.08810 0.00000 1.00000 1.08810 - 11.6565 1.11439 0.00000 1.00000 -1.11439 - 11.6750 2.04788 0.00000 1.00000 -2.04788 - 11.6935 1.49867 0.00000 1.00000 -1.49867 - 11.7120 -0.451611 0.00000 1.00000 0.451611 - 11.7305 -3.42848 0.00000 1.00000 3.42848 - 11.7490 -6.82125 0.00000 1.00000 6.82125 - 11.7675 -9.88740 0.00000 1.00000 9.88740 - 11.7860 -11.8896 0.00000 1.00000 11.8896 - 11.8045 -12.2430 0.00000 1.00000 12.2430 - 11.8230 -10.6446 0.00000 1.00000 10.6446 - 11.8415 -7.15722 0.00000 1.00000 7.15722 - 11.8600 -2.22583 0.00000 1.00000 2.22583 - 11.8785 3.38458 0.00000 1.00000 -3.38458 - 11.8970 8.72108 0.00000 1.00000 -8.72108 - 11.9155 12.8213 0.00000 1.00000 -12.8213 - 11.9340 14.9032 0.00000 1.00000 -14.9032 - 11.9525 14.5281 0.00000 1.00000 -14.5281 - 11.9710 11.6999 0.00000 1.00000 -11.6999 - 11.9895 6.87776 0.00000 1.00000 -6.87776 - 12.0080 0.891504 0.00000 1.00000 -0.891504 - 12.0265 -5.22565 0.00000 1.00000 5.22565 - 12.0450 -10.4522 0.00000 1.00000 10.4522 - 12.0635 -13.9931 0.00000 1.00000 13.9931 - 12.0820 -15.4435 0.00000 1.00000 15.4435 - 12.1005 -14.8644 0.00000 1.00000 14.8644 - 12.1190 -12.7520 0.00000 1.00000 12.7520 - 12.1375 -9.90845 0.00000 1.00000 9.90845 - 12.1560 -7.24453 0.00000 1.00000 7.24453 - 12.1745 -5.56166 0.00000 1.00000 5.56166 - 12.1930 -5.36161 0.00000 1.00000 5.36161 - 12.2115 -6.72586 0.00000 1.00000 6.72586 - 12.2300 -9.28835 0.00000 1.00000 9.28835 - 12.2485 -12.3067 0.00000 1.00000 12.3067 - 12.2670 -14.8178 0.00000 1.00000 14.8178 - 12.2855 -15.8476 0.00000 1.00000 15.8476 - 12.3040 -14.6332 0.00000 1.00000 14.6332 - 12.3225 -10.8097 0.00000 1.00000 10.8097 - 12.3410 -4.52145 0.00000 1.00000 4.52145 - 12.3595 3.57058 0.00000 1.00000 -3.57058 - 12.3780 12.3893 0.00000 1.00000 -12.3893 - 12.3965 20.6314 0.00000 1.00000 -20.6314 - 12.4150 27.0092 0.00000 1.00000 -27.0092 - 12.4335 30.4959 0.00000 1.00000 -30.4959 - 12.4520 30.5247 0.00000 1.00000 -30.5247 - 12.4705 27.1034 0.00000 1.00000 -27.1034 - 12.4890 20.8197 0.00000 1.00000 -20.8197 - 12.5075 12.7348 0.00000 1.00000 -12.7348 - 12.5260 4.18409 0.00000 1.00000 -4.18409 - 12.5445 -3.47600 0.00000 1.00000 3.47600 - 12.5630 -9.12640 0.00000 1.00000 9.12640 - 12.5815 -12.0958 0.00000 1.00000 12.0958 - 12.6000 -12.2803 0.00000 1.00000 12.2803 - 12.6185 -10.1467 0.00000 1.00000 10.1467 - 12.6370 -6.61573 0.00000 1.00000 6.61573 - 12.6555 -2.84816 0.00000 1.00000 2.84816 - 12.6740 0.0234471 0.00000 1.00000 -0.0234471 - 12.6925 1.16051 0.00000 1.00000 -1.16051 - 12.7110 0.222329 0.00000 1.00000 -0.222329 - 12.7295 -2.53923 0.00000 1.00000 2.53923 - 12.7480 -6.31966 0.00000 1.00000 6.31966 - 12.7665 -9.93250 0.00000 1.00000 9.93250 - 12.7850 -12.0782 0.00000 1.00000 12.0782 - 12.8035 -11.6556 0.00000 1.00000 11.6556 - 12.8220 -8.04822 0.00000 1.00000 8.04822 - 12.8405 -1.31753 0.00000 1.00000 1.31753 - 12.8590 7.74657 0.00000 1.00000 -7.74657 - 12.8775 17.7420 0.00000 1.00000 -17.7420 - 12.8960 26.9214 0.00000 1.00000 -26.9214 - 12.9145 33.5578 0.00000 1.00000 -33.5578 - 12.9330 36.3277 0.00000 1.00000 -36.3277 - 12.9515 34.6234 0.00000 1.00000 -34.6234 - 12.9700 28.7156 0.00000 1.00000 -28.7156 - 12.9885 19.7233 0.00000 1.00000 -19.7233 - 13.0070 9.38804 0.00000 1.00000 -9.38804 - 13.0255 -0.297908 0.00000 1.00000 0.297908 - 13.0440 -7.52791 0.00000 1.00000 7.52791 - 13.0625 -11.0794 0.00000 1.00000 11.0794 - 13.0810 -10.5807 0.00000 1.00000 10.5807 - 13.0995 -6.58087 0.00000 1.00000 6.58087 - 13.1180 -0.404585 0.00000 1.00000 0.404585 - 13.1365 6.17556 0.00000 1.00000 -6.17556 - 13.1550 11.3708 0.00000 1.00000 -11.3708 - 13.1735 13.8053 0.00000 1.00000 -13.8053 - 13.1920 12.8357 0.00000 1.00000 -12.8357 - 13.2105 8.68336 0.00000 1.00000 -8.68336 - 13.2290 2.34908 0.00000 1.00000 -2.34908 - 13.2475 -4.66287 0.00000 1.00000 4.66287 - 13.2660 -10.7379 0.00000 1.00000 10.7379 - 13.2845 -14.5602 0.00000 1.00000 14.5602 - 13.3030 -15.4343 0.00000 1.00000 15.4343 - 13.3215 -13.4393 0.00000 1.00000 13.4393 - 13.3400 -9.37967 0.00000 1.00000 9.37967 - 13.3585 -4.55053 0.00000 1.00000 4.55053 - 13.3770 -0.382431 0.00000 1.00000 0.382431 - 13.3955 1.93839 0.00000 1.00000 -1.93839 - 13.4140 1.77366 0.00000 1.00000 -1.77366 - 13.4325 -0.818874 0.00000 1.00000 0.818874 - 13.4510 -5.13072 0.00000 1.00000 5.13072 - 13.4695 -10.0255 0.00000 1.00000 10.0255 - 13.4880 -14.2744 0.00000 1.00000 14.2744 - 13.5065 -16.9060 0.00000 1.00000 16.9060 - 13.5250 -17.4714 0.00000 1.00000 17.4714 - 13.5435 -16.1512 0.00000 1.00000 16.1512 - 13.5620 -13.6784 0.00000 1.00000 13.6784 - 13.5805 -11.1043 0.00000 1.00000 11.1043 - 13.5990 -9.47288 0.00000 1.00000 9.47288 - 13.6175 -9.49567 0.00000 1.00000 9.49567 - 13.6360 -11.3153 0.00000 1.00000 11.3153 - 13.6545 -14.4268 0.00000 1.00000 14.4268 - 13.6730 -17.7824 0.00000 1.00000 17.7824 - 13.6915 -20.0552 0.00000 1.00000 20.0552 - 13.7100 -19.9965 0.00000 1.00000 19.9965 - 13.7285 -16.7898 0.00000 1.00000 16.7898 - 13.7470 -10.3089 0.00000 1.00000 10.3089 - 13.7655 -1.20781 0.00000 1.00000 1.20781 - 13.7840 9.18567 0.00000 1.00000 -9.18567 - 13.8025 19.1488 0.00000 1.00000 -19.1488 - 13.8210 26.9489 0.00000 1.00000 -26.9489 - 13.8395 31.2366 0.00000 1.00000 -31.2366 - 13.8580 31.3496 0.00000 1.00000 -31.3496 - 13.8765 27.4511 0.00000 1.00000 -27.4511 - 13.8950 20.4697 0.00000 1.00000 -20.4697 - 13.9135 11.8582 0.00000 1.00000 -11.8582 - 13.9320 3.23523 0.00000 1.00000 -3.23523 - 13.9505 -3.99882 0.00000 1.00000 3.99882 - 13.9690 -8.96984 0.00000 1.00000 8.96984 - 13.9875 -11.4848 0.00000 1.00000 11.4848 - 14.0060 -11.9967 0.00000 1.00000 11.9967 - 14.0245 -11.3970 0.00000 1.00000 11.3970 - 14.0430 -10.7008 0.00000 1.00000 10.7008 - 14.0615 -10.7168 0.00000 1.00000 10.7168 - 14.0800 -11.7936 0.00000 1.00000 11.7936 - 14.0985 -13.7115 0.00000 1.00000 13.7115 - 14.1170 -15.7457 0.00000 1.00000 15.7457 - 14.1355 -16.8835 0.00000 1.00000 16.8835 - 14.1540 -16.1342 0.00000 1.00000 16.1342 - 14.1725 -12.8466 0.00000 1.00000 12.8466 - 14.1910 -6.94542 0.00000 1.00000 6.94542 - 14.2095 0.982134 0.00000 1.00000 -0.982134 - 14.2280 9.77953 0.00000 1.00000 -9.77953 - 14.2465 17.9729 0.00000 1.00000 -17.9729 - 14.2650 24.1178 0.00000 1.00000 -24.1178 - 14.2835 27.1485 0.00000 1.00000 -27.1485 - 14.3020 26.6355 0.00000 1.00000 -26.6355 - 14.3205 22.8839 0.00000 1.00000 -22.8839 - 14.3390 16.8479 0.00000 1.00000 -16.8479 - 14.3575 9.88786 0.00000 1.00000 -9.88786 - 14.3760 3.43554 0.00000 1.00000 -3.43554 - 14.3945 -1.34253 0.00000 1.00000 1.34253 - 14.4130 -3.79922 0.00000 1.00000 3.79922 - 14.4315 -3.91650 0.00000 1.00000 3.91650 - 14.4500 -2.25034 0.00000 1.00000 2.25034 - 14.4685 0.265934 0.00000 1.00000 -0.265934 - 14.4870 2.60091 0.00000 1.00000 -2.60091 - 14.5055 3.90902 0.00000 1.00000 -3.90902 - 14.5240 3.74411 0.00000 1.00000 -3.74411 - 14.5425 2.15013 0.00000 1.00000 -2.15013 - 14.5610 -0.388481 0.00000 1.00000 0.388481 - 14.5795 -3.11515 0.00000 1.00000 3.11515 - 14.5980 -5.23631 0.00000 1.00000 5.23631 - 14.6165 -6.15513 0.00000 1.00000 6.15513 - 14.6350 -5.63898 0.00000 1.00000 5.63898 - 14.6535 -3.87566 0.00000 1.00000 3.87566 - 14.6720 -1.40645 0.00000 1.00000 1.40645 - 14.6905 1.04029 0.00000 1.00000 -1.04029 - 14.7090 2.76304 0.00000 1.00000 -2.76304 - 14.7275 3.28473 0.00000 1.00000 -3.28473 - 14.7460 2.47788 0.00000 1.00000 -2.47788 - 14.7645 0.584519 0.00000 1.00000 -0.584519 - 14.7830 -1.87052 0.00000 1.00000 1.87052 - 14.8015 -4.24417 0.00000 1.00000 4.24417 - 14.8200 -5.96765 0.00000 1.00000 5.96765 - 14.8385 -6.70965 0.00000 1.00000 6.70965 - 14.8570 -6.46211 0.00000 1.00000 6.46211 - 14.8755 -5.52356 0.00000 1.00000 5.52356 - 14.8940 -4.38544 0.00000 1.00000 4.38544 - 14.9125 -3.55512 0.00000 1.00000 3.55512 - 14.9310 -3.36898 0.00000 1.00000 3.36898 - 14.9495 -3.85281 0.00000 1.00000 3.85281 - 14.9680 -4.67590 0.00000 1.00000 4.67590 - 14.9865 -5.21922 0.00000 1.00000 5.21922 - 15.0050 -4.74479 0.00000 1.00000 4.74479 - 15.0235 -2.62144 0.00000 1.00000 2.62144 - 15.0420 1.45687 0.00000 1.00000 -1.45687 - 15.0605 7.32500 0.00000 1.00000 -7.32500 - 15.0790 14.3193 0.00000 1.00000 -14.3193 - 15.0975 21.3835 0.00000 1.00000 -21.3835 - 15.1160 27.2852 0.00000 1.00000 -27.2852 - 15.1345 30.8902 0.00000 1.00000 -30.8902 - 15.1530 31.4245 0.00000 1.00000 -31.4245 - 15.1715 28.6588 0.00000 1.00000 -28.6588 - 15.1900 22.9682 0.00000 1.00000 -22.9682 - 15.2085 15.2541 0.00000 1.00000 -15.2541 - 15.2270 6.74712 0.00000 1.00000 -6.74712 - 15.2455 -1.25964 0.00000 1.00000 1.25964 - 15.2640 -7.68049 0.00000 1.00000 7.68049 - 15.2825 -11.8442 0.00000 1.00000 11.8442 - 15.3010 -13.5919 0.00000 1.00000 13.5919 - 15.3195 -13.2493 0.00000 1.00000 13.2493 - 15.3380 -11.4916 0.00000 1.00000 11.4916 - 15.3565 -9.14144 0.00000 1.00000 9.14144 - 15.3750 -6.95504 0.00000 1.00000 6.95504 - 15.3935 -5.44896 0.00000 1.00000 5.44896 - 15.4120 -4.80772 0.00000 1.00000 4.80772 - 15.4305 -4.88897 0.00000 1.00000 4.88897 - 15.4490 -5.31706 0.00000 1.00000 5.31706 - 15.4675 -5.63285 0.00000 1.00000 5.63285 - 15.4860 -5.45462 0.00000 1.00000 5.45462 - 15.5045 -4.60459 0.00000 1.00000 4.60459 - 15.5230 -3.16776 0.00000 1.00000 3.16776 - 15.5415 -1.46992 0.00000 1.00000 1.46992 - 15.5600 0.0157586 0.00000 1.00000 -0.0157586 - 15.5785 0.806047 0.00000 1.00000 -0.806047 - 15.5970 0.550242 0.00000 1.00000 -0.550242 - 15.6155 -0.861348 0.00000 1.00000 0.861348 - 15.6340 -3.25430 0.00000 1.00000 3.25430 - 15.6525 -6.20584 0.00000 1.00000 6.20584 - 15.6710 -9.14992 0.00000 1.00000 9.14992 - 15.6895 -11.5204 0.00000 1.00000 11.5204 - 15.7080 -12.8909 0.00000 1.00000 12.8909 - 15.7265 -13.0717 0.00000 1.00000 13.0717 - 15.7450 -12.1417 0.00000 1.00000 12.1417 - 15.7635 -10.4097 0.00000 1.00000 10.4097 - 15.7820 -8.32011 0.00000 1.00000 8.32011 - 15.8005 -6.33136 0.00000 1.00000 6.33136 - 15.8190 -4.80087 0.00000 1.00000 4.80087 - 15.8375 -3.90675 0.00000 1.00000 3.90675 - 15.8560 -3.62474 0.00000 1.00000 3.62474 - 15.8745 -3.76225 0.00000 1.00000 3.76225 - 15.8930 -4.03596 0.00000 1.00000 4.03596 - 15.9115 -4.16761 0.00000 1.00000 4.16761 - 15.9300 -3.96959 0.00000 1.00000 3.96959 - 15.9485 -3.39629 0.00000 1.00000 3.39629 - 15.9670 -2.54969 0.00000 1.00000 2.54969 - 15.9855 -1.64188 0.00000 1.00000 1.64188 - 16.0040 -0.928772 0.00000 1.00000 0.928772 - 16.0225 -0.634845 0.00000 1.00000 0.634845 - 16.0410 -0.888145 0.00000 1.00000 0.888145 - 16.0595 -1.67980 0.00000 1.00000 1.67980 - 16.0780 -2.85514 0.00000 1.00000 2.85514 - 16.0965 -4.13661 0.00000 1.00000 4.13661 - 16.1150 -5.17310 0.00000 1.00000 5.17310 - 16.1335 -5.60636 0.00000 1.00000 5.60636 - 16.1520 -5.14159 0.00000 1.00000 5.14159 - 16.1705 -3.60734 0.00000 1.00000 3.60734 - 16.1890 -0.992023 0.00000 1.00000 0.992023 - 16.2075 2.54958 0.00000 1.00000 -2.54958 - 16.2260 6.71807 0.00000 1.00000 -6.71807 - 16.2445 11.1120 0.00000 1.00000 -11.1120 - 16.2630 15.2812 0.00000 1.00000 -15.2812 - 16.2815 18.7822 0.00000 1.00000 -18.7822 - 16.3000 21.2269 0.00000 1.00000 -21.2269 - 16.3185 22.3212 0.00000 1.00000 -22.3212 - 16.3370 21.8912 0.00000 1.00000 -21.8912 - 16.3555 19.8991 0.00000 1.00000 -19.8991 - 16.3740 16.4493 0.00000 1.00000 -16.4493 - 16.3925 11.7863 0.00000 1.00000 -11.7863 - 16.4110 6.28331 0.00000 1.00000 -6.28331 - 16.4295 0.418687 0.00000 1.00000 -0.418687 - 16.4480 -5.25963 0.00000 1.00000 5.25963 - 16.4665 -10.1842 0.00000 1.00000 10.1842 - 16.4850 -13.8295 0.00000 1.00000 13.8295 - 16.5035 -15.7785 0.00000 1.00000 15.7785 - 16.5220 -15.7830 0.00000 1.00000 15.7830 - 16.5405 -13.8070 0.00000 1.00000 13.8070 - 16.5590 -10.0391 0.00000 1.00000 10.0391 - 16.5775 -4.87264 0.00000 1.00000 4.87264 - 16.5960 1.14589 0.00000 1.00000 -1.14589 - 16.6145 7.38649 0.00000 1.00000 -7.38649 - 16.6330 13.2091 0.00000 1.00000 -13.2091 - 16.6515 18.0296 0.00000 1.00000 -18.0296 - 16.6700 21.3708 0.00000 1.00000 -21.3708 - 16.6885 22.8991 0.00000 1.00000 -22.8991 - 16.7070 22.4456 0.00000 1.00000 -22.4456 - 16.7255 20.0158 0.00000 1.00000 -20.0158 - 16.7440 15.7881 0.00000 1.00000 -15.7881 - 16.7625 10.1035 0.00000 1.00000 -10.1035 - 16.7810 3.44424 0.00000 1.00000 -3.44424 - 16.7995 -3.59847 0.00000 1.00000 3.59847 - 16.8180 -10.3717 0.00000 1.00000 10.3717 - 16.8365 -16.2205 0.00000 1.00000 16.2205 - 16.8550 -20.5580 0.00000 1.00000 20.5580 - 16.8735 -22.9372 0.00000 1.00000 22.9372 - 16.8920 -23.1129 0.00000 1.00000 23.1129 - 16.9105 -21.0837 0.00000 1.00000 21.0837 - 16.9290 -17.1032 0.00000 1.00000 17.1032 - 16.9475 -11.6563 0.00000 1.00000 11.6563 - 16.9660 -5.39998 0.00000 1.00000 5.39998 - 16.9845 0.923758 0.00000 1.00000 -0.923758 - 17.0030 6.59122 0.00000 1.00000 -6.59122 - 17.0215 10.9979 0.00000 1.00000 -10.9979 - 17.0400 13.7383 0.00000 1.00000 -13.7383 - 17.0585 14.6477 0.00000 1.00000 -14.6477 - 17.0770 13.7998 0.00000 1.00000 -13.7998 - 17.0955 11.4638 0.00000 1.00000 -11.4638 - 17.1140 8.03578 0.00000 1.00000 -8.03578 - 17.1325 3.96378 0.00000 1.00000 -3.96378 - 17.1510 -0.316698 0.00000 1.00000 0.316698 - 17.1695 -4.42438 0.00000 1.00000 4.42438 - 17.1880 -8.04681 0.00000 1.00000 8.04681 - 17.2065 -10.9324 0.00000 1.00000 10.9324 - 17.2250 -12.8725 0.00000 1.00000 12.8725 - 17.2435 -13.6898 0.00000 1.00000 13.6898 - 17.2620 -13.2456 0.00000 1.00000 13.2456 - 17.2805 -11.4675 0.00000 1.00000 11.4675 - 17.2990 -8.39144 0.00000 1.00000 8.39144 - 17.3175 -4.20001 0.00000 1.00000 4.20001 - 17.3360 0.758004 0.00000 1.00000 -0.758004 - 17.3545 5.98116 0.00000 1.00000 -5.98116 - 17.3730 10.8661 0.00000 1.00000 -10.8661 - 17.3915 14.7906 0.00000 1.00000 -14.7906 - 17.4100 17.2137 0.00000 1.00000 -17.2137 - 17.4285 17.7745 0.00000 1.00000 -17.7745 - 17.4470 16.3661 0.00000 1.00000 -16.3661 - 17.4655 13.1690 0.00000 1.00000 -13.1690 - 17.4840 8.63053 0.00000 1.00000 -8.63053 - 17.5025 3.39246 0.00000 1.00000 -3.39246 - 17.5210 -1.82203 0.00000 1.00000 1.82203 - 17.5395 -6.33848 0.00000 1.00000 6.33848 - 17.5580 -9.64981 0.00000 1.00000 9.64981 - 17.5765 -11.4978 0.00000 1.00000 11.4978 - 17.5950 -11.9009 0.00000 1.00000 11.9009 - 17.6135 -11.1239 0.00000 1.00000 11.1239 - 17.6320 -9.59944 0.00000 1.00000 9.59944 - 17.6505 -7.81972 0.00000 1.00000 7.81972 - 17.6690 -6.22442 0.00000 1.00000 6.22442 - 17.6875 -5.11122 0.00000 1.00000 5.11122 - 17.7060 -4.58875 0.00000 1.00000 4.58875 - 17.7245 -4.58029 0.00000 1.00000 4.58029 - 17.7430 -4.87225 0.00000 1.00000 4.87225 - 17.7615 -5.18968 0.00000 1.00000 5.18968 - 17.7800 -5.27616 0.00000 1.00000 5.27616 - 17.7985 -4.95771 0.00000 1.00000 4.95771 - 17.8170 -4.17763 0.00000 1.00000 4.17763 - 17.8355 -2.99861 0.00000 1.00000 2.99861 - 17.8540 -1.57655 0.00000 1.00000 1.57655 - 17.8725 -0.115674 0.00000 1.00000 0.115674 - 17.8910 1.18232 0.00000 1.00000 -1.18232 - 17.9095 2.16253 0.00000 1.00000 -2.16253 - 17.9280 2.74507 0.00000 1.00000 -2.74507 - 17.9465 2.93310 0.00000 1.00000 -2.93310 - 17.9650 2.80225 0.00000 1.00000 -2.80225 - 17.9835 2.47685 0.00000 1.00000 -2.47685 - 18.0020 2.09940 0.00000 1.00000 -2.09940 - 18.0205 1.79907 0.00000 1.00000 -1.79907 - 18.0390 1.66403 0.00000 1.00000 -1.66403 - 18.0575 1.72260 0.00000 1.00000 -1.72260 - 18.0760 1.93703 0.00000 1.00000 -1.93703 - 18.0945 2.21113 0.00000 1.00000 -2.21113 - 18.1130 2.40837 0.00000 1.00000 -2.40837 - 18.1315 2.37442 0.00000 1.00000 -2.37442 - 18.1500 1.95988 0.00000 1.00000 -1.95988 - 18.1685 1.04724 0.00000 1.00000 -1.04724 - 18.1870 -0.426523 0.00000 1.00000 0.426523 - 18.2055 -2.45315 0.00000 1.00000 2.45315 - 18.2240 -4.90773 0.00000 1.00000 4.90773 - 18.2425 -7.52944 0.00000 1.00000 7.52944 - 18.2610 -9.92715 0.00000 1.00000 9.92715 - 18.2795 -11.6174 0.00000 1.00000 11.6174 - 18.2980 -12.0956 0.00000 1.00000 12.0956 - 18.3165 -10.9327 0.00000 1.00000 10.9327 - 18.3350 -7.88331 0.00000 1.00000 7.88331 - 18.3535 -2.98071 0.00000 1.00000 2.98071 - 18.3720 3.40650 0.00000 1.00000 -3.40650 - 18.3905 10.5811 0.00000 1.00000 -10.5811 - 18.4090 17.5968 0.00000 1.00000 -17.5968 - 18.4275 23.4036 0.00000 1.00000 -23.4036 - 18.4460 27.0310 0.00000 1.00000 -27.0310 - 18.4645 27.7731 0.00000 1.00000 -27.7731 - 18.4830 25.3345 0.00000 1.00000 -25.3345 - 18.5015 19.9052 0.00000 1.00000 -19.9052 - 18.5200 12.1472 0.00000 1.00000 -12.1472 - 18.5385 3.09099 0.00000 1.00000 -3.09099 - 18.5570 -6.03798 0.00000 1.00000 6.03798 - 18.5755 -14.0281 0.00000 1.00000 14.0281 - 18.5940 -19.8843 0.00000 1.00000 19.8843 - 18.6125 -22.9844 0.00000 1.00000 22.9844 - 18.6310 -23.1597 0.00000 1.00000 23.1597 - 18.6495 -20.6881 0.00000 1.00000 20.6881 - 18.6680 -16.2075 0.00000 1.00000 16.2075 - 18.6865 -10.5714 0.00000 1.00000 10.5714 - 18.7050 -4.68098 0.00000 1.00000 4.68098 - 18.7235 0.671251 0.00000 1.00000 -0.671251 - 18.7420 4.91529 0.00000 1.00000 -4.91529 - 18.7605 7.75797 0.00000 1.00000 -7.75797 - 18.7790 9.17588 0.00000 1.00000 -9.17588 - 18.7975 9.35965 0.00000 1.00000 -9.35965 - 18.8160 8.63035 0.00000 1.00000 -8.63035 - 18.8345 7.35145 0.00000 1.00000 -7.35145 - 18.8530 5.85510 0.00000 1.00000 -5.85510 - 18.8715 4.39513 0.00000 1.00000 -4.39513 - 18.8900 3.13002 0.00000 1.00000 -3.13002 - 18.9085 2.13168 0.00000 1.00000 -2.13168 - 18.9270 1.40976 0.00000 1.00000 -1.40976 - 18.9455 0.939913 0.00000 1.00000 -0.939913 - 18.9640 0.686429 0.00000 1.00000 -0.686429 - 18.9825 0.614229 0.00000 1.00000 -0.614229 - 19.0010 0.690570 0.00000 1.00000 -0.690570 - 19.0195 0.880032 0.00000 1.00000 -0.880032 - 19.0380 1.13788 0.00000 1.00000 -1.13788 - 19.0565 1.40627 0.00000 1.00000 -1.40627 - 19.0750 1.61604 0.00000 1.00000 -1.61604 - 19.0935 1.69418 0.00000 1.00000 -1.69418 - 19.1120 1.57467 0.00000 1.00000 -1.57467 - 19.1305 1.20912 0.00000 1.00000 -1.20912 - 19.1490 0.574418 0.00000 1.00000 -0.574418 - 19.1675 -0.322868 0.00000 1.00000 0.322868 - 19.1860 -1.44364 0.00000 1.00000 1.44364 - 19.2045 -2.71278 0.00000 1.00000 2.71278 - 19.2230 -4.01492 0.00000 1.00000 4.01492 - 19.2415 -5.19189 0.00000 1.00000 5.19189 - 19.2600 -6.04623 0.00000 1.00000 6.04623 - 19.2785 -6.35560 0.00000 1.00000 6.35560 - 19.2970 -5.90135 0.00000 1.00000 5.90135 - 19.3155 -4.51168 0.00000 1.00000 4.51168 - 19.3340 -2.11474 0.00000 1.00000 2.11474 - 19.3525 1.20914 0.00000 1.00000 -1.20914 - 19.3710 5.19105 0.00000 1.00000 -5.19105 - 19.3895 9.36912 0.00000 1.00000 -9.36912 - 19.4080 13.1271 0.00000 1.00000 -13.1271 - 19.4265 15.7779 0.00000 1.00000 -15.7779 - 19.4450 16.6827 0.00000 1.00000 -16.6827 - 19.4635 15.3867 0.00000 1.00000 -15.3867 - 19.4820 11.7418 0.00000 1.00000 -11.7418 - 19.5005 5.98757 0.00000 1.00000 -5.98757 - 19.5190 -1.23710 0.00000 1.00000 1.23710 - 19.5375 -8.96359 0.00000 1.00000 8.96359 - 19.5560 -16.0382 0.00000 1.00000 16.0382 - 19.5745 -21.3164 0.00000 1.00000 21.3164 - 19.5930 -23.8699 0.00000 1.00000 23.8699 - 19.6115 -23.1644 0.00000 1.00000 23.1644 - 19.6300 -19.1740 0.00000 1.00000 19.1740 - 19.6485 -12.4057 0.00000 1.00000 12.4057 - 19.6670 -3.82669 0.00000 1.00000 3.82669 - 19.6855 5.29471 0.00000 1.00000 -5.29471 - 19.7040 13.6058 0.00000 1.00000 -13.6058 - 19.7225 19.9014 0.00000 1.00000 -19.9014 - 19.7410 23.3260 0.00000 1.00000 -23.3260 - 19.7595 23.5068 0.00000 1.00000 -23.5068 - 19.7780 20.5929 0.00000 1.00000 -20.5929 - 19.7965 15.1973 0.00000 1.00000 -15.1973 - 19.8150 8.25741 0.00000 1.00000 -8.25741 - 19.8335 0.846490 0.00000 1.00000 -0.846490 - 19.8520 -6.02165 0.00000 1.00000 6.02165 - 19.8705 -11.5565 0.00000 1.00000 11.5565 - 19.8890 -15.2939 0.00000 1.00000 15.2939 - 19.9075 -17.1257 0.00000 1.00000 17.1257 - 19.9260 -17.2573 0.00000 1.00000 17.2573 - 19.9445 -16.1119 0.00000 1.00000 16.1119 - 19.9630 -14.2055 0.00000 1.00000 14.2055 - 19.9815 -12.0275 0.00000 1.00000 12.0275 - 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/diffpy/pdffit2/tests/testdata/badNi.stru b/diffpy/pdffit2/tests/testdata/badNi.stru deleted file mode 100644 index d0b980cb..00000000 --- a/diffpy/pdffit2/tests/testdata/badNi.stru +++ /dev/null @@ -1,32 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru b/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru deleted file mode 100644 index 089db0da..00000000 --- a/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru +++ /dev/null @@ -1,33 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 0.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/noLattice.stru b/diffpy/pdffit2/tests/testdata/noLattice.stru deleted file mode 100644 index 4f8e7212..00000000 --- a/diffpy/pdffit2/tests/testdata/noLattice.stru +++ /dev/null @@ -1,32 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, -3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/version.py b/diffpy/pdffit2/version.py deleted file mode 100644 index 0e60302c..00000000 --- a/diffpy/pdffit2/version.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -""" -Definition of __version__, __date__, __timestamp__, __git_commit__. - -Notes ------ -Variable `__gitsha__` is deprecated as of version 1.2. -Use `__git_commit__` instead. -""" - -__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] - -import os.path - -from pkg_resources import resource_filename - -# obtain version information from the version.cfg file -cp = dict(version="", date="", commit="", timestamp="0") -fcfg = resource_filename(__name__, "version.cfg") -if not os.path.isfile(fcfg): # pragma: no cover - from warnings import warn - - warn('Package metadata not found, execute "./setup.py egg_info".') - fcfg = os.devnull -with open(fcfg) as fp: - kwords = [[w.strip() for w in line.split(" = ", 1)] for line in fp if line[:1].isalpha() and " = " in line] -assert all(w[0] in cp for w in kwords), "received unrecognized keyword" -cp.update(kwords) - -__version__ = cp["version"] -__date__ = cp["date"] -__git_commit__ = cp["commit"] -__timestamp__ = int(cp["timestamp"]) - -# TODO remove deprecated __gitsha__ in version 1.3. -__gitsha__ = __git_commit__ - -del cp, fcfg, fp, kwords - -# End of file diff --git a/libpdffit2/Atom.cc b/libpdffit2/Atom.cc deleted file mode 100644 index aa2e66f2..00000000 --- a/libpdffit2/Atom.cc +++ /dev/null @@ -1,104 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class Atom -* -* Comments: -* -***********************************************************************/ - -#include - -#include "Atom.h" -#include "MathUtils.h" -#include "LocalPeriodicTable.h" - -using namespace std; - -// class data - private - - -Atom::AtomFormat Atom::streamformat = Atom::DISCUS; - - -// public class methods - - -void Atom::setDiscusFormat() -{ - Atom::streamformat = DISCUS; -} - - -void Atom::setPdffitFormat() -{ - Atom::streamformat = PDFFIT; -} - - -// private methods - - -istream& Atom::read_discus_atom(istream& in) -{ - double B; - string symbol; - const double fac = 1.0 / (8.0*M_PI*M_PI); - in >> symbol >> pos[0] >> pos[1] >> pos[2] >> B; - if (!in) return in; - // here we read successfully - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - atom_type = lpt->lookup(symbol); - fill_n(u, 3, fac*B); - fill_n(u+3, 3, 0.0); - occ = 1.0; - docc = 0.0; - fill_n(dpos, 3, 0.0); - fill_n(du, 6, 0.0); - return in; -} - - -istream& Atom::read_pdffit_atom(istream& in) -{ - string symbol; - in >> symbol >> pos[0] >> pos[1] >> pos[2] >> occ >> - dpos[0] >> dpos[1] >> dpos[2] >> docc >> - u[0] >> u[1] >> u[2] >> - du[0] >> du[1] >> du[2] >> - u[3] >> u[4] >> u[5] >> - du[3] >> du[4] >> du[5]; - if (!in) return in; - // here we read successfully - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - atom_type = lpt->lookup(symbol); - return in; -} - - -// non-member operators - - -istream& operator>>(istream& in, Atom& a) -{ - switch (Atom::streamformat) - { - case Atom::DISCUS: return a.read_discus_atom(in); - case Atom::PDFFIT: return a.read_pdffit_atom(in); - }; - return in; -} - - -// End of file diff --git a/libpdffit2/Atom.h b/libpdffit2/Atom.h deleted file mode 100644 index 11955036..00000000 --- a/libpdffit2/Atom.h +++ /dev/null @@ -1,70 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class Atom -* -* Comments: -* -***********************************************************************/ - -#ifndef ATOM_H_INCLUDED -#define ATOM_H_INCLUDED - -#include -#include "AtomType.h" - -class PdfFit; -class DataSet; -class Phase; - -class Atom -{ - // friends who need to touch offset - friend class PdfFit; - friend class DataSet; - friend class Phase; - friend std::istream& operator>>(std::istream& in, Atom& a); - - public: - - // class methods - static void setDiscusFormat(); - static void setPdffitFormat(); - - // data - const AtomType* atom_type; - double weight; // normalized scattering factor - double pos[3], dpos[3]; - double u[6], du[6]; - double occ, docc; - - private: - - // types and class data - enum AtomFormat { DISCUS, PDFFIT }; - static AtomFormat streamformat; - - // data - int offset; - - // methods - std::istream& read_discus_atom(std::istream& in); - std::istream& read_pdffit_atom(std::istream& in); -}; - -// non-member operators - -std::istream& operator>>(std::istream& in, Atom& a); - -#endif // ATOM_H_INCLUDED diff --git a/libpdffit2/AtomType.h b/libpdffit2/AtomType.h deleted file mode 100644 index 4c002e8d..00000000 --- a/libpdffit2/AtomType.h +++ /dev/null @@ -1,76 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class AtomType -* -* Comments: storage of element properties like name, symbol, -* atomic mass or scattering power -* -***********************************************************************/ - -#ifndef ATOMTYPE_H_INCLUDED -#define ATOMTYPE_H_INCLUDED - -#include -#include -#include - -class AtomType -{ - public: - // Data - std::string symbol; // element symbol - std::string name; // element name - bool isotope; // flag for isotopes - int z; // atomic number - double M; // atomic mass - int charge; // total charge in e - double radius; // ionic radius - double xsf; // x-ray scattering factor - double nsf; // neutron scattering factor - - // Constructor - AtomType() - { - z = 0; - M = 0.0; - isotope = false; - charge = 0; - radius = 0.0; - xsf = 0.0; - nsf = 0.0; - } - - // Methods - double sf(char scattering_type) const - { - switch (scattering_type) - { - case 'x': - case 'X': - return xsf; - case 'n': - case 'N': - return nsf; - default: - std::ostringstream emsg; - emsg << "Invalid scattering type '" << - scattering_type << "'"; - throw std::runtime_error(emsg.str()); - } - return 0.0; - } -}; - -#endif // ATOMTYPE_H_INCLUDED diff --git a/libpdffit2/LocalPeriodicTable.cc b/libpdffit2/LocalPeriodicTable.cc deleted file mode 100644 index 482f2f10..00000000 --- a/libpdffit2/LocalPeriodicTable.cc +++ /dev/null @@ -1,147 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2008 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class LocalPeriodicTable -* -* Comments: Light-weight class which allows redefinitions of scattering -* factors. This class throws ValueError for unknown elements. -* -***********************************************************************/ - -#include -#include "LocalPeriodicTable.h" -#include "exceptions.h" - -using namespace std; - - -// public class methods - - -const LocalPeriodicTable* LocalPeriodicTable::instance() -{ - static unique_ptr the_table(new LocalPeriodicTable()); - return the_table.get(); -} - - -// constructor - - -LocalPeriodicTable::LocalPeriodicTable() -{ - // private data - this->_periodic_table = PeriodicTable::instance(); -} - - -// public methods - - -const AtomType* LocalPeriodicTable::name(const string& nm) const -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->name(nm); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - const AtomType* atp = local_symbol(atp0->symbol); - return atp; -} - - -const AtomType* LocalPeriodicTable::symbol(const string& smbl) const -{ - const AtomType* atp = local_symbol(smbl); - return atp; -} - - -const AtomType* LocalPeriodicTable::lookup(const string& pat) const -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->lookup(pat); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - const AtomType* atp = local_symbol(atp0->symbol); - return atp; -} - - -bool LocalPeriodicTable::has(const string& pat) const -{ - return this->_periodic_table->has(pat); -} - - -void LocalPeriodicTable::reset(const string& smbl) -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->symbol(smbl); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - // overwrite with default only when smbl is in the local table - if (this->_local_table.count(smbl)) - { - this->_local_table[smbl] = *atp0; - } -} - - -void LocalPeriodicTable::setXsf(const string& smbl, double xsf) -{ - AtomType* atp = this->local_symbol(smbl); - atp->xsf = xsf; -} - - -void LocalPeriodicTable::setNsf(const string& smbl, double nsf) -{ - AtomType* atp = this->local_symbol(smbl); - atp->nsf = nsf; -} - - -// private methods - - -AtomType* LocalPeriodicTable::local_symbol(const string& smbl) const -{ - map::iterator atplocal; - atplocal = this->_local_table.find(smbl); - if (atplocal == this->_local_table.end()) - { - const AtomType* atp0; - try { - atp0 = this->_periodic_table->symbol(smbl); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - atplocal = this->_local_table.insert(make_pair(smbl, *atp0)).first; - } - AtomType* atp = &(atplocal->second); - return atp; -} - - -// End of file diff --git a/libpdffit2/LocalPeriodicTable.h b/libpdffit2/LocalPeriodicTable.h deleted file mode 100644 index 551faee5..00000000 --- a/libpdffit2/LocalPeriodicTable.h +++ /dev/null @@ -1,63 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2008 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class LocalPeriodicTable -* -* Comments: Light-weight class which allows redefinitions of scattering -* factors. It keeps a local copy of each looked up species, -* which can be redefined. -* This class also throws ValueError for unknown elements. -* -***********************************************************************/ - -#ifndef LOCALPERIODICTABLE_H_INCLUDED -#define LOCALPERIODICTABLE_H_INCLUDED - -#include -#include -#include "PeriodicTable.h" - -class LocalPeriodicTable -{ - public: - - // class methods - - // common instance for clients that do not need to own one - static const LocalPeriodicTable* instance(); - - // constructor - LocalPeriodicTable(); - - // methods - const AtomType* name(const std::string& nm) const; - const AtomType* symbol(const std::string& smbl) const; - const AtomType* lookup(const std::string& pat) const; - bool has(const std::string& pat) const; - void reset(const std::string& smbl); - void setXsf(const std::string& smbl, double xsf); - void setNsf(const std::string& smbl, double nsf); - - private: - - // data - PeriodicTable* _periodic_table; - mutable std::map _local_table; - - // methods - AtomType* local_symbol(const std::string& smbl) const; - -}; - -#endif // LOCALPERIODICTABLE_H_INCLUDED diff --git a/libpdffit2/MathUtils.h b/libpdffit2/MathUtils.h deleted file mode 100644 index 21240276..00000000 --- a/libpdffit2/MathUtils.h +++ /dev/null @@ -1,94 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Math functions and numerical constants for pdffit2 and formula parser. -* -* Comments: -* -***********************************************************************/ - -#ifndef MATHUTILS_H_INCLUDED -#define MATHUTILS_H_INCLUDED - -#include -#include - -// numerical constants -const double rad = M_PI/180.0; -const double double_eps = (1.0 + sqrt(std::numeric_limits().epsilon())) - 1.0; -const double double_max = std::numeric_limits().max(); -const double deltar_tol = 1.0e-3; - -// MS compatibility fix - define functions not provided by MSVC cmath -#ifdef _MSC_VER -#include - -#if _MSC_VER < 1800 // log2 has been available since MSVC 2013 -inline double log2(double x) { return log(x)/log(2.0); } -#endif - -inline int isnan(double x) { return _isnan(x); } -inline double round(double x) { return (x < 0) ? ceil(x - 0.5) : floor(x + 0.5); } - -#endif // _MSC_VER - -// nearest integer -inline int nint(const double x) -{ - return (int) round(x); -} - -// math functions and derivatives used in formula parser - -inline double neg(double x) { return -x; } -inline double dneg(double x) { return -1.0; } - -inline double sqr(double x) { return x*x; } -inline double dsqr(double x) { return 2.0*x; } - -inline double cube(double x) { return x*x*x; } -inline double dcube(double x) { return 3.0*sqr(x); } - -inline double dsqrt(double x) { return 0.5/sqrt(x); } - -inline double dexp(double x) { return exp(x); } -inline double dlog(double x) { return 1.0/x; } - -inline double sind(double x) { return sin(rad*x); } -inline double dsind(double x) { return rad*cos(rad*x); } - -inline double cosd(double x) { return cos(rad*x); } -inline double dcosd(double x) { return -rad*sin(rad*x); } - -inline double tand(double x) { return tan(rad*x); } -inline double dtand(double x) { return rad/sqr(cosd(x)); } - -inline double dsin(double x) { return cos(x); } -inline double dcos(double x) { return -sin(x); } -inline double dtan(double x) { return 1.0/sqr(cos(x)); } - -inline double dasin(double x) { return 1.0/sqrt(1.0 - x*x); } -inline double dacos(double x) { return -1.0/sqrt(1.0 - x*x); } -inline double datan(double x) { return 1/(1+sqr(x)); } - -inline double asind(double x) { return asin(x)/rad; } -inline double dasind(double x) { return dasin(x)/rad; } - -inline double acosd(double x) { return acos(x)/rad; } -inline double dacosd(double x) { return dacos(x)/rad; } - -inline double atand(double x) { return atan(x)/rad; } -inline double datand(double x) { return datan(x)/rad; } - -#endif // MATHUTILS_H_INCLUDED diff --git a/libpdffit2/OutputStreams.cc b/libpdffit2/OutputStreams.cc deleted file mode 100644 index 6bacc8c1..00000000 --- a/libpdffit2/OutputStreams.cc +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Custom output and error streams. -* -***********************************************************************/ - -#include "OutputStreams.h" - -std::ostream* NS_PDFFIT2::pout = &std::cout; -std::ostream* NS_PDFFIT2::perr = &std::cerr; - -// End of file diff --git a/libpdffit2/OutputStreams.h b/libpdffit2/OutputStreams.h deleted file mode 100644 index d269b6b3..00000000 --- a/libpdffit2/OutputStreams.h +++ /dev/null @@ -1,31 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Custom output and error streams. -* -***********************************************************************/ - -#ifndef OUTPUTSTREAMS_H_INCLUDED -#define OUTPUTSTREAMS_H_INCLUDED - -#include - -namespace NS_PDFFIT2 { - -extern std::ostream* pout; -extern std::ostream* perr; - -} - -#endif // OUTPUTSTREAMS_H_INCLUDED diff --git a/libpdffit2/PairDistance.h b/libpdffit2/PairDistance.h deleted file mode 100644 index 92c375f3..00000000 --- a/libpdffit2/PairDistance.h +++ /dev/null @@ -1,42 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Simple struct for pair distance and indices of atoms in the pair -* -***********************************************************************/ - -#ifndef PAIRDISTANCE_H_INCLUDED -#define PAIRDISTANCE_H_INCLUDED - -struct PairDistance -{ - // Data members - double dij; // distance - double ddij; // standard deviation - int i; // first index based from 1 - int j; // second index based from 1 - - // Constructor - PairDistance() : dij(0.0), ddij(0.0), i(0), j(0) - { } - -}; - -// Comparison operator -inline bool operator<(const PairDistance& pd0, const PairDistance& pd1) -{ - return (pd0.dij < pd1.dij); -} - -#endif // PAIRDISTANCE_H_INCLUDED diff --git a/libpdffit2/PeriodicTable.cc b/libpdffit2/PeriodicTable.cc deleted file mode 100644 index dd1b4481..00000000 --- a/libpdffit2/PeriodicTable.cc +++ /dev/null @@ -1,3459 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PeriodicTable -* -* Comments: singleton class, use PeriodicTable::instance() -* for its pointer -* -***********************************************************************/ - -#include -#include -#include - -// MS compatibility fix -#include - -#include "PeriodicTable.h" - -using namespace std; - -//////////////////////////////////////////////////////////////////////// -// helper function -//////////////////////////////////////////////////////////////////////// -namespace { - -inline bool isalphachar(const char& c) -{ - return isalpha(c); -} - -} // namespace - -//////////////////////////////////////////////////////////////////////// -// PeriodicTable definitions -//////////////////////////////////////////////////////////////////////// - -PeriodicTable::PeriodicTable() -{ - init(); -} - -PeriodicTable::~PeriodicTable() -{ - clear(); -} - -AtomType* PeriodicTable::name(const string& s) -{ - map::iterator ii; - ii = name_index.find(s); - if (ii == name_index.end()) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -AtomType* PeriodicTable::symbol(const string& s) -{ - map::iterator ii; - ii = symbol_index.find(s); - if (ii == symbol_index.end()) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -AtomType* PeriodicTable::lookup(string s) -{ - // force standard case - string::iterator sii = find_if(s.begin(), s.end(), isalphachar); - if (sii != s.end()) - { - *sii = toupper(*sii); - for (sii++; sii != s.end(); ++sii) *sii = tolower(*sii); - } - map::iterator ii; - ii = symbol_index.find(s); - if ( ii == symbol_index.end() && - (ii = name_index.find(s)) == name_index.end() ) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -bool PeriodicTable::has(const std::string& s) -{ - bool rv; - try - { - lookup(s); - rv = true; - } - catch(runtime_error) - { - rv = false; - } - return rv; -} - -void PeriodicTable::defAtomType(const AtomType& atp) -{ - // check if already defined - if (symbol_index.count(atp.symbol)) - { - ostringstream emsg; - emsg << "Element symbol '" << atp.symbol - << "' already defined."; - throw runtime_error(emsg.str()); - } - if (name_index.count(atp.name)) - { - ostringstream emsg; - emsg << "Element name '" << atp.name - << "' already defined."; - throw runtime_error(emsg.str()); - } - // all should be fine here - pt_backup.push_back(new AtomType(atp)); - AtomType* newatp = new AtomType(atp); - pt_public.push_back(newatp); - symbol_index[newatp->symbol] = newatp; - name_index[newatp->name] = newatp; -} - -void PeriodicTable::deleteAtomType(const AtomType* atp) -{ - deque::iterator ii; - ii = find(pt_public.begin(), pt_public.end(), atp); - if (ii == pt_public.end()) return; - // here we need to free and remove atp related data - symbol_index.erase(atp->symbol); - name_index.erase(atp->name); - size_t idx = ii - pt_public.begin(); - delete pt_public[idx]; pt_public.erase(pt_public.begin() + idx); - delete pt_backup[idx]; pt_backup.erase(pt_backup.begin() + idx); -} - -void PeriodicTable::reset(AtomType* atp) -{ - deque::iterator ii; - if (!count(pt_backup.begin(), pt_backup.end(), atp)) - { - ostringstream emsg; - emsg << "Element '" << atp->symbol << "' is not defined."; - throw runtime_error(emsg.str()); - } - size_t idx = ii - pt_backup.begin(); - *(pt_public[idx]) = *(pt_backup[idx]); -} - -void PeriodicTable::resetAll() -{ - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - **iipub = **iibak; - } -} - -void PeriodicTable::init() -{ - // load element data to pt_backup - fill_pt_backup(); - // make public copy and initialize lookup maps - pt_public.resize(pt_backup.size()); - // fill in lookup map - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - *iipub = new AtomType(**iibak); - symbol_index[(*iipub)->symbol] = *iipub; - name_index[(*iipub)->name] = *iipub; - } - // add standard symbols for deuterium and tritium - symbol_index["2-H"] = lookup("D"); - symbol_index["3-H"] = lookup("T"); -} - -void PeriodicTable::clear() -{ - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - delete *iipub; *iipub = NULL; - delete *iibak; *iibak = NULL; - } - pt_public.clear(); - pt_backup.clear(); -} - -void PeriodicTable::fill_pt_backup() -{ - // Refs: - // 1. Albert-Jose Dianoux, Gerry Lander, Neutron Data Booklet, - // Second Edition, ILL 2003 - // 2. ionic radii: http://www.fhi-berlin.mpg.de/th/balsac/balm.47.html - AtomType* atp; - AtomType* itp; - // hydrogen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "H"; - atp->name = "Hydrogen"; - atp->z = 1; - atp->M = 1.007947; - atp->radius = 0.4350; - atp->xsf = 1.0; - atp->nsf = -3.7409; - // isotopes - // 1-hydrogen - itp = new AtomType(*atp); - itp->symbol = "1-H"; - itp->name = "1-Hydrogen"; - itp->isotope = true; - itp->M = 1.0078250321; - itp->nsf = -3.7423; - pt_backup.push_back(itp); - // deuterium - itp = new AtomType(*atp); - itp->symbol = "D"; - itp->name = "Deuterium"; - itp->isotope = true; - itp->M = 2.0141017780; - itp->nsf = 6.674; - pt_backup.push_back(itp); - // tritium - itp = new AtomType(*atp); - itp->symbol = "T"; - itp->name = "Tritium"; - itp->isotope = true; - itp->M = 3.0160492675; - itp->nsf = 4.792; - pt_backup.push_back(itp); - } - // helium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "He"; - atp->name = "Helium"; - atp->z = 2; - atp->M = 4.0026022; - atp->radius = 1.4000; - atp->xsf = 2.0; - atp->nsf = 3.263; - // isotopes - // 3-helium - itp = new AtomType(*atp); - itp->symbol = "3-He"; - itp->name = "3-Helium"; - itp->isotope = true; - itp->M = 3.0160293097; - itp->nsf = 5.74; - pt_backup.push_back(itp); - // 4-helium - itp = new AtomType(*atp); - itp->symbol = "4-He"; - itp->name = "4-Helium"; - itp->isotope = true; - itp->M = 4.0026032497; - itp->nsf = 3.26; - pt_backup.push_back(itp); - } - // lithium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Li"; - atp->name = "Lithium"; - atp->z = 3; - atp->M = 6.9412; - atp->radius = 1.5199; - atp->xsf = 3.0; - atp->nsf = -1.903; - // isotopes - // 6-lithium - itp = new AtomType(*atp); - itp->symbol = "6-Li"; - itp->name = "6-Lithium"; - itp->isotope = true; - itp->M = 6.0151223; - itp->nsf = 2.0; - pt_backup.push_back(itp); - // 7-lithium - itp = new AtomType(*atp); - itp->symbol = "7-Li"; - itp->name = "7-Lithium"; - itp->isotope = true; - itp->M = 7.0160040; - itp->nsf = -2.22; - pt_backup.push_back(itp); - } - // beryllium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Be"; - atp->name = "Beryllium"; - atp->z = 4; - atp->M = 9.0121823; - atp->radius = 1.1430; - atp->xsf = 4.0; - atp->nsf = 7.791; - } - // boron - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "B"; - atp->name = "Boron"; - atp->z = 5; - atp->M = 10.8117; - atp->radius = 0.9750; - atp->xsf = 5.0; - atp->nsf = 5.304; - // isotopes - // 10-boron - itp = new AtomType(*atp); - itp->symbol = "10-B"; - itp->name = "10-Boron"; - itp->isotope = true; - itp->M = 10.0129370; - itp->nsf = -0.2; - pt_backup.push_back(itp); - // 11-boron - itp = new AtomType(*atp); - itp->symbol = "11-B"; - itp->name = "11-Boron"; - itp->isotope = true; - itp->M = 11.0093055; - itp->nsf = 6.65; - pt_backup.push_back(itp); - } - // carbon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "C"; - atp->name = "Carbon"; - atp->z = 6; - atp->M = 12.01078; - atp->radius = 0.6550; - atp->xsf = 6.0; - atp->nsf = 6.648413; - // isotopes - // 12-carbon - itp = new AtomType(*atp); - itp->symbol = "12-C"; - itp->name = "12-Carbon"; - itp->isotope = true; - itp->M = 12.0; - itp->nsf = 6.6535; - pt_backup.push_back(itp); - // 13-carbon - itp = new AtomType(*atp); - itp->symbol = "13-C"; - itp->name = "13-Carbon"; - itp->isotope = true; - itp->M = 13.0033548378; - itp->nsf = 6.19; - pt_backup.push_back(itp); - } - // nitrogen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "N"; - atp->name = "Nitrogen"; - atp->z = 7; - atp->M = 14.00672; - atp->radius = 0.7500; - atp->xsf = 7.0; - atp->nsf = 9.36; - // isotopes - // 14-nitrogen - itp = new AtomType(*atp); - itp->symbol = "14-N"; - itp->name = "14-Nitrogen"; - itp->isotope = true; - itp->M = 14.0030740052; - itp->nsf = 9.37; - pt_backup.push_back(itp); - // 15-nitrogen - itp = new AtomType(*atp); - itp->symbol = "15-N"; - itp->name = "15-Nitrogen"; - itp->isotope = true; - itp->M = 15.0001088984; - itp->nsf = 6.44; - pt_backup.push_back(itp); - } - // oxygen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "O"; - atp->name = "Oxygen"; - atp->z = 8; - atp->M = 15.99943; - atp->radius = 0.7300; - atp->xsf = 8.0; - atp->nsf = 5.8054; - // isotopes - // 16-oxygen - itp = new AtomType(*atp); - itp->symbol = "16-O"; - itp->name = "16-Oxygen"; - itp->isotope = true; - itp->M = 15.9949146221; - itp->nsf = 5.805; - pt_backup.push_back(itp); - // 17-oxygen - itp = new AtomType(*atp); - itp->symbol = "17-O"; - itp->name = "17-Oxygen"; - itp->isotope = true; - itp->M = 16.99913150; - itp->nsf = 5.6; - pt_backup.push_back(itp); - // 18-oxygen - itp = new AtomType(*atp); - itp->symbol = "18-O"; - itp->name = "18-Oxygen"; - itp->isotope = true; - itp->M = 17.9991604; - itp->nsf = 5.84; - pt_backup.push_back(itp); - } - // fluorine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "F"; - atp->name = "Fluorine"; - atp->z = 9; - atp->M = 18.99840325; - atp->radius = 0.7200; - atp->xsf = 9.0; - atp->nsf = 5.65412; - } - // neon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ne"; - atp->name = "Neon"; - atp->z = 10; - atp->M = 20.17976; - atp->radius = 1.6000; - atp->xsf = 10.0; - atp->nsf = 4.5666; - // isotopes - // 20-neon - itp = new AtomType(*atp); - itp->symbol = "20-Ne"; - itp->name = "20-Neon"; - itp->isotope = true; - itp->M = 19.9924401759; - itp->nsf = 4.631; - pt_backup.push_back(itp); - // 21-neon - itp = new AtomType(*atp); - itp->symbol = "21-Ne"; - itp->name = "21-Neon"; - itp->isotope = true; - itp->M = 20.99384674; - itp->nsf = 6.66; - pt_backup.push_back(itp); - // 22-neon - itp = new AtomType(*atp); - itp->symbol = "22-Ne"; - itp->name = "22-Neon"; - itp->isotope = true; - itp->M = 21.99138551; - itp->nsf = 3.87; - pt_backup.push_back(itp); - } - // sodium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Na"; - atp->name = "Sodium"; - atp->z = 11; - atp->M = 22.9897702; - atp->radius = 1.8579; - atp->xsf = 11.0; - atp->nsf = 3.632; - } - // magnesium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mg"; - atp->name = "Magnesium"; - atp->z = 12; - atp->M = 24.30506; - atp->radius = 1.6047; - atp->xsf = 12.0; - atp->nsf = 5.3754; - // isotopes - // 24-magnesium - itp = new AtomType(*atp); - itp->symbol = "24-Mg"; - itp->name = "24-Magnesium"; - itp->isotope = true; - itp->M = 23.98504190; - itp->nsf = 5.49; - pt_backup.push_back(itp); - // 25-magnesium - itp = new AtomType(*atp); - itp->symbol = "25-Mg"; - itp->name = "25-Magnesium"; - itp->isotope = true; - itp->M = 24.98583702; - itp->nsf = 3.62; - pt_backup.push_back(itp); - // 26-magnesium - itp = new AtomType(*atp); - itp->symbol = "26-Mg"; - itp->name = "26-Magnesium"; - itp->isotope = true; - itp->M = 25.98259304; - itp->nsf = 4.89; - pt_backup.push_back(itp); - } - // aluminium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Al"; - atp->name = "Aluminium"; - atp->z = 13; - atp->M = 26.9815382; - atp->radius = 1.4318; - atp->xsf = 13.0; - atp->nsf = 3.4495; - } - // silicon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Si"; - atp->name = "Silicon"; - atp->z = 14; - atp->M = 28.08553; - atp->radius = 1.1758; - atp->xsf = 14.0; - atp->nsf = 4.15071; - // isotopes - // 28-silicon - itp = new AtomType(*atp); - itp->symbol = "28-Si"; - itp->name = "28-Silicon"; - itp->isotope = true; - itp->M = 27.9769265327; - itp->nsf = 4.106; - pt_backup.push_back(itp); - // 29-silicon - itp = new AtomType(*atp); - itp->symbol = "29-Si"; - itp->name = "29-Silicon"; - itp->isotope = true; - itp->M = 28.97649472; - itp->nsf = 4.7; - pt_backup.push_back(itp); - // 30-silicon - itp = new AtomType(*atp); - itp->symbol = "30-Si"; - itp->name = "30-Silicon"; - itp->isotope = true; - itp->M = 29.97377022; - itp->nsf = 4.58; - pt_backup.push_back(itp); - } - // phosphorus - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "P"; - atp->name = "Phosphorus"; - atp->z = 15; - atp->M = 30.9737612; - atp->radius = 1.0600; - atp->xsf = 15.0; - atp->nsf = 5.131; - } - // sulfur - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "S"; - atp->name = "Sulfur"; - atp->z = 16; - atp->M = 32.0655; - atp->radius = 1.0200; - atp->xsf = 16.0; - atp->nsf = 2.8471; - // isotopes - // 32-sulfur - itp = new AtomType(*atp); - itp->symbol = "32-S"; - itp->name = "32-Sulfur"; - itp->isotope = true; - itp->M = 31.97207069; - itp->nsf = 2.804; - pt_backup.push_back(itp); - // 33-sulfur - itp = new AtomType(*atp); - itp->symbol = "33-S"; - itp->name = "33-Sulfur"; - itp->isotope = true; - itp->M = 32.97145850; - itp->nsf = 4.74; - pt_backup.push_back(itp); - // 34-sulfur - itp = new AtomType(*atp); - itp->symbol = "34-S"; - itp->name = "34-Sulfur"; - itp->isotope = true; - itp->M = 33.96786683; - itp->nsf = 3.48; - pt_backup.push_back(itp); - // 36-sulfur - itp = new AtomType(*atp); - itp->symbol = "36-S"; - itp->name = "36-Sulfur"; - itp->isotope = true; - itp->M = 35.96708088; - itp->nsf = 3.0; - pt_backup.push_back(itp); - } - // chlorine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cl"; - atp->name = "Chlorine"; - atp->z = 17; - atp->M = 35.4532; - atp->radius = 0.9900; - atp->xsf = 17.0; - atp->nsf = 9.57928; - // isotopes - // 35-chlorine - itp = new AtomType(*atp); - itp->symbol = "35-Cl"; - itp->name = "35-Chlorine"; - itp->isotope = true; - itp->M = 34.96885271; - itp->nsf = 11.7; - pt_backup.push_back(itp); - // 37-chlorine - itp = new AtomType(*atp); - itp->symbol = "37-Cl"; - itp->name = "37-Chlorine"; - itp->isotope = true; - itp->M = 36.96590260; - itp->nsf = 3.08; - pt_backup.push_back(itp); - } - // argon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ar"; - atp->name = "Argon"; - atp->z = 18; - atp->M = 39.9481; - atp->radius = 1.9000; - atp->xsf = 18.0; - atp->nsf = 1.9096; - // isotopes - // 36-argon - itp = new AtomType(*atp); - itp->symbol = "36-Ar"; - itp->name = "36-Argon"; - itp->isotope = true; - itp->M = 35.96754628; - itp->nsf = 24.9; - pt_backup.push_back(itp); - // 38-argon - itp = new AtomType(*atp); - itp->symbol = "38-Ar"; - itp->name = "38-Argon"; - itp->isotope = true; - itp->M = 37.9627322; - itp->nsf = 3.5; - pt_backup.push_back(itp); - // 40-argon - itp = new AtomType(*atp); - itp->symbol = "40-Ar"; - itp->name = "40-Argon"; - itp->isotope = true; - itp->M = 39.962383123; - itp->nsf = 1.7; - pt_backup.push_back(itp); - } - // potassium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "K"; - atp->name = "Potassium"; - atp->z = 19; - atp->M = 39.09831; - atp->radius = 2.2620; - atp->xsf = 19.0; - atp->nsf = 3.672; - // isotopes - // 39-potassium - itp = new AtomType(*atp); - itp->symbol = "39-K"; - itp->name = "39-Potassium"; - itp->isotope = true; - itp->M = 38.9637069; - itp->nsf = 3.79; - pt_backup.push_back(itp); - // 40-potassium - itp = new AtomType(*atp); - itp->symbol = "40-K"; - itp->name = "40-Potassium"; - itp->isotope = true; - itp->M = 39.96399867; - itp->nsf = 3.1; - pt_backup.push_back(itp); - // 41-potassium - itp = new AtomType(*atp); - itp->symbol = "41-K"; - itp->name = "41-Potassium"; - itp->isotope = true; - itp->M = 40.96182597; - itp->nsf = 2.69; - pt_backup.push_back(itp); - } - // calcium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ca"; - atp->name = "Calcium"; - atp->z = 20; - atp->M = 40.0784; - atp->radius = 1.9758; - atp->xsf = 20.0; - atp->nsf = 4.702; - // isotopes - // 40-calcium - itp = new AtomType(*atp); - itp->symbol = "40-Ca"; - itp->name = "40-Calcium"; - itp->isotope = true; - itp->M = 39.9625912; - itp->nsf = 4.78; - pt_backup.push_back(itp); - // 42-calcium - itp = new AtomType(*atp); - itp->symbol = "42-Ca"; - itp->name = "42-Calcium"; - itp->isotope = true; - itp->M = 41.9586183; - itp->nsf = 3.36; - pt_backup.push_back(itp); - // 43-calcium - itp = new AtomType(*atp); - itp->symbol = "43-Ca"; - itp->name = "43-Calcium"; - itp->isotope = true; - itp->M = 42.9587668; - itp->nsf = -1.56; - pt_backup.push_back(itp); - // 44-calcium - itp = new AtomType(*atp); - itp->symbol = "44-Ca"; - itp->name = "44-Calcium"; - itp->isotope = true; - itp->M = 43.9554811; - itp->nsf = 1.42; - pt_backup.push_back(itp); - // 46-calcium - itp = new AtomType(*atp); - itp->symbol = "46-Ca"; - itp->name = "46-Calcium"; - itp->isotope = true; - itp->M = 45.9536928; - itp->nsf = 3.55; - pt_backup.push_back(itp); - // 48-calcium - itp = new AtomType(*atp); - itp->symbol = "48-Ca"; - itp->name = "48-Calcium"; - itp->isotope = true; - itp->M = 47.952534; - itp->nsf = 0.39; - pt_backup.push_back(itp); - } - // scandium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sc"; - atp->name = "Scandium"; - atp->z = 21; - atp->M = 44.9559108; - atp->radius = 1.6545; - atp->xsf = 21.0; - atp->nsf = 12.11; - } - // titanium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ti"; - atp->name = "Titanium"; - atp->z = 22; - atp->M = 47.8671; - atp->radius = 1.4755; - atp->xsf = 22.0; - atp->nsf = -3.37013; - // isotopes - // 46-titanium - itp = new AtomType(*atp); - itp->symbol = "46-Ti"; - itp->name = "46-Titanium"; - itp->isotope = true; - itp->M = 45.9526295; - itp->nsf = 4.72; - pt_backup.push_back(itp); - // 47-titanium - itp = new AtomType(*atp); - itp->symbol = "47-Ti"; - itp->name = "47-Titanium"; - itp->isotope = true; - itp->M = 46.9517638; - itp->nsf = 3.53; - pt_backup.push_back(itp); - // 48-titanium - itp = new AtomType(*atp); - itp->symbol = "48-Ti"; - itp->name = "48-Titanium"; - itp->isotope = true; - itp->M = 47.9479471; - itp->nsf = -5.86; - pt_backup.push_back(itp); - // 49-titanium - itp = new AtomType(*atp); - itp->symbol = "49-Ti"; - itp->name = "49-Titanium"; - itp->isotope = true; - itp->M = 48.9478708; - itp->nsf = 0.98; - pt_backup.push_back(itp); - // 50-titanium - itp = new AtomType(*atp); - itp->symbol = "50-Ti"; - itp->name = "50-Titanium"; - itp->isotope = true; - itp->M = 49.9447921; - itp->nsf = 5.88; - pt_backup.push_back(itp); - } - // vanadium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "V"; - atp->name = "Vanadium"; - atp->z = 23; - atp->M = 50.94151; - atp->radius = 1.3090; - atp->xsf = 23.0; - atp->nsf = -0.44314; - // isotopes - // 50-vanadium - itp = new AtomType(*atp); - itp->symbol = "50-V"; - itp->name = "50-Vanadium"; - itp->isotope = true; - itp->M = 49.9471628; - itp->nsf = 7.6; - pt_backup.push_back(itp); - // 51-vanadium - itp = new AtomType(*atp); - itp->symbol = "51-V"; - itp->name = "51-Vanadium"; - itp->isotope = true; - itp->M = 50.9439637; - itp->nsf = -0.402; - pt_backup.push_back(itp); - } - // chromium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cr"; - atp->name = "Chromium"; - atp->z = 24; - atp->M = 51.99616; - atp->radius = 1.2490; - atp->xsf = 24.0; - atp->nsf = 3.6357; - // isotopes - // 50-chromium - itp = new AtomType(*atp); - itp->symbol = "50-Cr"; - itp->name = "50-Chromium"; - itp->isotope = true; - itp->M = 49.9460496; - itp->nsf = -4.50; - pt_backup.push_back(itp); - // 52-chromium - itp = new AtomType(*atp); - itp->symbol = "52-Cr"; - itp->name = "52-Chromium"; - itp->isotope = true; - itp->M = 51.9405119; - itp->nsf = 4.914; - pt_backup.push_back(itp); - // 0-chromium - itp = new AtomType(*atp); - itp->symbol = "53-Cr"; - itp->name = "53-Chromium"; - itp->isotope = true; - itp->M = 52.9406538; - itp->nsf = -4.20; - pt_backup.push_back(itp); - // 54-chromium - itp = new AtomType(*atp); - itp->symbol = "54-Cr"; - itp->name = "54-Chromium"; - itp->isotope = true; - itp->M = 53.9388849; - itp->nsf = 4.55; - pt_backup.push_back(itp); - } - // manganese - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mn"; - atp->name = "Manganese"; - atp->z = 25; - atp->M = 54.9380499; - atp->radius = 1.3500; - atp->xsf = 25.0; - atp->nsf = -3.75018; - } - // iron - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fe"; - atp->name = "Iron"; - atp->z = 26; - atp->M = 55.8452; - atp->radius = 1.2411; - atp->xsf = 26.0; - atp->nsf = 9.452; - // isotopes - // 54-iron - itp = new AtomType(*atp); - itp->symbol = "54-Fe"; - itp->name = "54-Iron"; - itp->isotope = true; - itp->M = 53.9396148; - itp->nsf = 4.2; - pt_backup.push_back(itp); - // 56-iron - itp = new AtomType(*atp); - itp->symbol = "56-Fe"; - itp->name = "56-Iron"; - itp->isotope = true; - itp->M = 55.9349421; - itp->nsf = 10.1; - pt_backup.push_back(itp); - // 57-iron - itp = new AtomType(*atp); - itp->symbol = "57-Fe"; - itp->name = "57-Iron"; - itp->isotope = true; - itp->M = 56.9353987; - itp->nsf = 2.3; - pt_backup.push_back(itp); - // 58-iron - itp = new AtomType(*atp); - itp->symbol = "58-Fe"; - itp->name = "58-Iron"; - itp->isotope = true; - itp->M = 57.9332805; - itp->nsf = 15; - pt_backup.push_back(itp); - } - // cobalt - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Co"; - atp->name = "Cobalt"; - atp->z = 27; - atp->M = 58.9332009; - atp->radius = 1.2535; - atp->xsf = 27.0; - atp->nsf = 2.492; - } - // nickel - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ni"; - atp->name = "Nickel"; - atp->z = 28; - atp->M = 58.69342; - atp->radius = 1.2460; - atp->xsf = 28.0; - atp->nsf = 10.31; - // isotopes - // 58-nickel - itp = new AtomType(*atp); - itp->symbol = "58-Ni"; - itp->name = "58-Nickel"; - itp->isotope = true; - itp->M = 57.9353479; - itp->nsf = 14.4; - pt_backup.push_back(itp); - // 60-nickel - itp = new AtomType(*atp); - itp->symbol = "60-Ni"; - itp->name = "60-Nickel"; - itp->isotope = true; - itp->M = 59.9307906; - itp->nsf = 2.8; - pt_backup.push_back(itp); - // 61-nickel - itp = new AtomType(*atp); - itp->symbol = "61-Ni"; - itp->name = "61-Nickel"; - itp->isotope = true; - itp->M = 60.9310604; - itp->nsf = 7.60; - pt_backup.push_back(itp); - // 62-nickel - itp = new AtomType(*atp); - itp->symbol = "62-Ni"; - itp->name = "62-Nickel"; - itp->isotope = true; - itp->M = 61.9283488; - itp->nsf = -8.7; - pt_backup.push_back(itp); - // 64-nickel - itp = new AtomType(*atp); - itp->symbol = "64-Ni"; - itp->name = "64-Nickel"; - itp->isotope = true; - itp->M = 63.9279696; - itp->nsf = -0.37; - pt_backup.push_back(itp); - } - // copper - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cu"; - atp->name = "Copper"; - atp->z = 29; - atp->M = 63.5463; - atp->radius = 1.2780; - atp->xsf = 29.0; - atp->nsf = 7.7184; - // isotopes - // 63-copper - itp = new AtomType(*atp); - itp->symbol = "63-Cu"; - itp->name = "63-Copper"; - itp->isotope = true; - itp->M = 62.9296011; - itp->nsf = 6.477; - pt_backup.push_back(itp); - // 65-copper - itp = new AtomType(*atp); - itp->symbol = "65-Cu"; - itp->name = "65-Copper"; - itp->isotope = true; - itp->M = 64.9277937; - itp->nsf = 10.204; - pt_backup.push_back(itp); - } - // zinc - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Zn"; - atp->name = "Zinc"; - atp->z = 30; - atp->M = 65.4094; - atp->radius = 1.3325; - atp->xsf = 30.0; - atp->nsf = 5.6805; - // isotopes - // 64-zinc - itp = new AtomType(*atp); - itp->symbol = "64-Zn"; - itp->name = "64-Zinc"; - itp->isotope = true; - itp->M = 63.9291466; - itp->nsf = 5.23; - pt_backup.push_back(itp); - // 66-zinc - itp = new AtomType(*atp); - itp->symbol = "66-Zn"; - itp->name = "66-Zinc"; - itp->isotope = true; - itp->M = 65.9260368; - itp->nsf = 5.98; - pt_backup.push_back(itp); - // 67-zinc - itp = new AtomType(*atp); - itp->symbol = "67-Zn"; - itp->name = "67-Zinc"; - itp->isotope = true; - itp->M = 66.9271309; - itp->nsf = 7.58; - pt_backup.push_back(itp); - // 68-zinc - itp = new AtomType(*atp); - itp->symbol = "68-Zn"; - itp->name = "68-Zinc"; - itp->isotope = true; - itp->M = 67.9248476; - itp->nsf = 6.04; - pt_backup.push_back(itp); - // 70-zinc - itp = new AtomType(*atp); - itp->symbol = "70-Zn"; - itp->name = "70-Zinc"; - itp->isotope = true; - itp->M = 69.925325; - itp->nsf = 6.9; - pt_backup.push_back(itp); - } - // gallium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ga"; - atp->name = "Gallium"; - atp->z = 31; - atp->M = 69.7231; - atp->radius = 1.3501; - atp->xsf = 31.0; - atp->nsf = 7.2882; - // isotopes - // 69-gallium - itp = new AtomType(*atp); - itp->symbol = "69-Ga"; - itp->name = "69-Gallium"; - itp->isotope = true; - itp->M = 68.925581; - itp->nsf = 8.043; - pt_backup.push_back(itp); - // 71-gallium - itp = new AtomType(*atp); - itp->symbol = "71-Ga"; - itp->name = "71-Gallium"; - itp->isotope = true; - itp->M = 70.9247050; - itp->nsf = 6.170; - pt_backup.push_back(itp); - } - // germanium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ge"; - atp->name = "Germanium"; - atp->z = 32; - atp->M = 72.641; - atp->radius = 1.2248; - atp->xsf = 32.0; - atp->nsf = 8.18520; - // isotopes - // 70-germanium - itp = new AtomType(*atp); - itp->symbol = "70-Ge"; - itp->name = "70-Germanium"; - itp->isotope = true; - itp->M = 69.9242504; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 72-germanium - itp = new AtomType(*atp); - itp->symbol = "72-Ge"; - itp->name = "72-Germanium"; - itp->isotope = true; - itp->M = 71.9220762; - itp->nsf = 8.51; - pt_backup.push_back(itp); - // 73-germanium - itp = new AtomType(*atp); - itp->symbol = "73-Ge"; - itp->name = "73-Germanium"; - itp->isotope = true; - itp->M = 72.9234594; - itp->nsf = 5.02; - pt_backup.push_back(itp); - // 74-germanium - itp = new AtomType(*atp); - itp->symbol = "74-Ge"; - itp->name = "74-Germanium"; - itp->isotope = true; - itp->M = 73.9211782; - itp->nsf = 7.58; - pt_backup.push_back(itp); - // 76-germanium - itp = new AtomType(*atp); - itp->symbol = "76-Ge"; - itp->name = "76-Germanium"; - itp->isotope = true; - itp->M = 75.9214027; - itp->nsf = 8.2; - pt_backup.push_back(itp); - } - // arsenic - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "As"; - atp->name = "Arsenic"; - atp->z = 33; - atp->M = 74.921602; - atp->radius = 1.2000; - atp->xsf = 33.0; - atp->nsf = 6.581; - } - // selenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Se"; - atp->name = "Selenium"; - atp->z = 34; - atp->M = 78.963; - atp->radius = 1.1600; - atp->xsf = 34.0; - atp->nsf = 7.9709; - // isotopes - // 74-selenium - itp = new AtomType(*atp); - itp->symbol = "74-Se"; - itp->name = "74-Selenium"; - itp->isotope = true; - itp->M = 73.9224766; - itp->nsf = 0.8; - pt_backup.push_back(itp); - // 76-selenium - itp = new AtomType(*atp); - itp->symbol = "76-Se"; - itp->name = "76-Selenium"; - itp->isotope = true; - itp->M = 75.9192141; - itp->nsf = 12.2; - pt_backup.push_back(itp); - // 77-selenium - itp = new AtomType(*atp); - itp->symbol = "77-Se"; - itp->name = "77-Selenium"; - itp->isotope = true; - itp->M = 76.9199146; - itp->nsf = 8.25; - pt_backup.push_back(itp); - // 78-selenium - itp = new AtomType(*atp); - itp->symbol = "78-Se"; - itp->name = "78-Selenium"; - itp->isotope = true; - itp->M = 77.9173095; - itp->nsf = 8.24; - pt_backup.push_back(itp); - // 80-selenium - itp = new AtomType(*atp); - itp->symbol = "80-Se"; - itp->name = "80-Selenium"; - itp->isotope = true; - itp->M = 79.9165218; - itp->nsf = 7.48; - pt_backup.push_back(itp); - // 82-selenium - itp = new AtomType(*atp); - itp->symbol = "82-Se"; - itp->name = "82-Selenium"; - itp->isotope = true; - itp->M = 81.9167000; - itp->nsf = 6.34; - pt_backup.push_back(itp); - } - // bromine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Br"; - atp->name = "Bromine"; - atp->z = 35; - atp->M = 79.9041; - atp->radius = 1.1400; - atp->xsf = 35.0; - atp->nsf = 6.792; - // isotopes - // 79-bromine - itp = new AtomType(*atp); - itp->symbol = "79-Br"; - itp->name = "79-Bromine"; - itp->isotope = true; - itp->M = 78.9183376; - itp->nsf = 6.79; - pt_backup.push_back(itp); - // 81-bromine - itp = new AtomType(*atp); - itp->symbol = "81-Br"; - itp->name = "81-Bromine"; - itp->isotope = true; - itp->M = 80.916291; - itp->nsf = 6.78; - pt_backup.push_back(itp); - } - // krypton - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Kr"; - atp->name = "Krypton"; - atp->z = 36; - atp->M = 83.7982; - atp->radius = 2.0000; - atp->xsf = 36.0; - atp->nsf = 7.812; - // isotopes - // 86-krypton - itp = new AtomType(*atp); - itp->symbol = "86-Kr"; - itp->name = "86-Krypton"; - itp->isotope = true; - itp->M = 85.9106103; - itp->nsf = 8.07; - pt_backup.push_back(itp); - } - // rubidium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rb"; - atp->name = "Rubidium"; - atp->z = 37; - atp->M = 85.46783; - atp->radius = 2.4700; - atp->xsf = 37.0; - atp->nsf = 7.082; - // isotopes - // 85-rubidium - itp = new AtomType(*atp); - itp->symbol = "85-Rb"; - itp->name = "85-Rubidium"; - itp->isotope = true; - itp->M = 84.9117893; - itp->nsf = 7.07; - pt_backup.push_back(itp); - // 87-rubidium - itp = new AtomType(*atp); - itp->symbol = "87-Rb"; - itp->name = "87-Rubidium"; - itp->isotope = true; - itp->M = 86.9091835; - itp->nsf = 7.27; - pt_backup.push_back(itp); - } - // strontium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sr"; - atp->name = "Strontium"; - atp->z = 38; - atp->M = 87.621; - atp->radius = 2.1513; - atp->xsf = 38.0; - atp->nsf = 7.022; - // isotopes - // 84-strontium - itp = new AtomType(*atp); - itp->symbol = "84-Sr"; - itp->name = "84-Strontium"; - itp->isotope = true; - itp->M = 83.913425; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 86-strontium - itp = new AtomType(*atp); - itp->symbol = "86-Sr"; - itp->name = "86-Strontium"; - itp->isotope = true; - itp->M = 85.9092624; - itp->nsf = 5.68; - pt_backup.push_back(itp); - // 87-strontium - itp = new AtomType(*atp); - itp->symbol = "87-Sr"; - itp->name = "87-Strontium"; - itp->isotope = true; - itp->M = 86.9088793; - itp->nsf = 7.41; - pt_backup.push_back(itp); - // 88-strontium - itp = new AtomType(*atp); - itp->symbol = "88-Sr"; - itp->name = "88-Strontium"; - itp->isotope = true; - itp->M = 87.9056143; - itp->nsf = 7.16; - pt_backup.push_back(itp); - } - // yttrium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Y"; - atp->name = "Yttrium"; - atp->z = 39; - atp->M = 88.905852; - atp->radius = 1.8237; - atp->xsf = 39.0; - atp->nsf = 7.752; - } - // zirconium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Zr"; - atp->name = "Zirconium"; - atp->z = 40; - atp->M = 91.2242; - atp->radius = 1.6156; - atp->xsf = 40.0; - atp->nsf = 7.163; - // isotopes - // 90-zirconium - itp = new AtomType(*atp); - itp->symbol = "90-Zr"; - itp->name = "90-Zirconium"; - itp->isotope = true; - itp->M = 89.9047037; - itp->nsf = 6.5; - pt_backup.push_back(itp); - // 91-zirconium - itp = new AtomType(*atp); - itp->symbol = "91-Zr"; - itp->name = "91-Zirconium"; - itp->isotope = true; - itp->M = 90.9056450; - itp->nsf = 8.8; - pt_backup.push_back(itp); - // 92-zirconium - itp = new AtomType(*atp); - itp->symbol = "92-Zr"; - itp->name = "92-Zirconium"; - itp->isotope = true; - itp->M = 91.9050401; - itp->nsf = 7.5; - pt_backup.push_back(itp); - // 94-zirconium - itp = new AtomType(*atp); - itp->symbol = "94-Zr"; - itp->name = "94-Zirconium"; - itp->isotope = true; - itp->M = 93.9063158; - itp->nsf = 8.3; - pt_backup.push_back(itp); - // 96-zirconium - itp = new AtomType(*atp); - itp->symbol = "96-Zr"; - itp->name = "96-Zirconium"; - itp->isotope = true; - itp->M = 95.908276; - itp->nsf = 5.5; - pt_backup.push_back(itp); - } - // niobium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Nb"; - atp->name = "Niobium"; - atp->z = 41; - atp->M = 92.906382; - atp->radius = 1.4318; - atp->xsf = 41.0; - atp->nsf = 7.0543; - } - // molybdenum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mo"; - atp->name = "Molybdenum"; - atp->z = 42; - atp->M = 95.942; - atp->radius = 1.3626; - atp->xsf = 42.0; - atp->nsf = 6.71520; - // isotopes - // 92-molybdenum - itp = new AtomType(*atp); - itp->symbol = "92-Mo"; - itp->name = "92-Molybdenum"; - itp->isotope = true; - itp->M = 91.906810; - itp->nsf = 6.93; - pt_backup.push_back(itp); - // 94-molybdenum - itp = new AtomType(*atp); - itp->symbol = "94-Mo"; - itp->name = "94-Molybdenum"; - itp->isotope = true; - itp->M = 93.9050876; - itp->nsf = 6.82; - pt_backup.push_back(itp); - // 95-molybdenum - itp = new AtomType(*atp); - itp->symbol = "95-Mo"; - itp->name = "95-Molybdenum"; - itp->isotope = true; - itp->M = 94.9058415; - itp->nsf = 6.93; - pt_backup.push_back(itp); - // 96-molybdenum - itp = new AtomType(*atp); - itp->symbol = "96-Mo"; - itp->name = "96-Molybdenum"; - itp->isotope = true; - itp->M = 95.9046789; - itp->nsf = 6.22; - pt_backup.push_back(itp); - // 97-molybdenum - itp = new AtomType(*atp); - itp->symbol = "97-Mo"; - itp->name = "97-Molybdenum"; - itp->isotope = true; - itp->M = 96.9060210; - itp->nsf = 7.26; - pt_backup.push_back(itp); - // 98-molybdenum - itp = new AtomType(*atp); - itp->symbol = "98-Mo"; - itp->name = "98-Molybdenum"; - itp->isotope = true; - itp->M = 97.9054078; - itp->nsf = 6.60; - pt_backup.push_back(itp); - // 100-molybdenum - itp = new AtomType(*atp); - itp->symbol = "100-Mo"; - itp->name = "100-Molybdenum"; - itp->isotope = true; - itp->M = 99.907477; - itp->nsf = 6.75; - pt_backup.push_back(itp); - } - // technetium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tc"; - atp->name = "Technetium"; - atp->z = 43; - atp->M = 98.0; - atp->radius = 1.3675; - atp->xsf = 43.0; - atp->nsf = 6.83; - } - // ruthenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ru"; - atp->name = "Ruthenium"; - atp->z = 44; - atp->M = 101.072; - atp->radius = 1.3529; - atp->xsf = 44.0; - atp->nsf = 7.022; - } - // rhodium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rh"; - atp->name = "Rhodium"; - atp->z = 45; - atp->M = 102.905502; - atp->radius = 1.3450; - atp->xsf = 45.0; - atp->nsf = 5.904; - } - // palladium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pd"; - atp->name = "Palladium"; - atp->z = 46; - atp->M = 106.421; - atp->radius = 1.3755; - atp->xsf = 46.0; - atp->nsf = 5.916; - // isotopes - // 102-palladium - itp = new AtomType(*atp); - itp->symbol = "102-Pd"; - itp->name = "102-Palladium"; - itp->isotope = true; - itp->M = 101.905608; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 104-palladium - itp = new AtomType(*atp); - itp->symbol = "104-Pd"; - itp->name = "104-Palladium"; - itp->isotope = true; - itp->M = 103.904035; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 105-palladium - itp = new AtomType(*atp); - itp->symbol = "105-Pd"; - itp->name = "105-Palladium"; - itp->isotope = true; - itp->M = 104.905084; - itp->nsf = 5.5; - pt_backup.push_back(itp); - // 106-palladium - itp = new AtomType(*atp); - itp->symbol = "106-Pd"; - itp->name = "106-Palladium"; - itp->isotope = true; - itp->M = 105.903483; - itp->nsf = 6.4; - pt_backup.push_back(itp); - // 108-palladium - itp = new AtomType(*atp); - itp->symbol = "108-Pd"; - itp->name = "108-Palladium"; - itp->isotope = true; - itp->M = 107.903894; - itp->nsf = 4.1; - pt_backup.push_back(itp); - // 110-palladium - itp = new AtomType(*atp); - itp->symbol = "110-Pd"; - itp->name = "110-Palladium"; - itp->isotope = true; - itp->M = 109.905152; - itp->nsf = 7.7; - pt_backup.push_back(itp); - } - // silver - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ag"; - atp->name = "Silver"; - atp->z = 47; - atp->M = 107.86822; - atp->radius = 1.4447; - atp->xsf = 47.0; - atp->nsf = 5.9227; - // isotopes - // 107-silver - itp = new AtomType(*atp); - itp->symbol = "107-Ag"; - itp->name = "107-Silver"; - itp->isotope = true; - itp->M = 106.905093; - itp->nsf = 7.555; - pt_backup.push_back(itp); - // 109-silver - itp = new AtomType(*atp); - itp->symbol = "109-Ag"; - itp->name = "109-Silver"; - itp->isotope = true; - itp->M = 108.904756; - itp->nsf = 4.165; - pt_backup.push_back(itp); - } - // cadmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cd"; - atp->name = "Cadmium"; - atp->z = 48; - atp->M = 112.4118; - atp->radius = 1.4894; - atp->xsf = 48.0; - atp->nsf = 4.835; - // isotopes - // 106-cadmium - itp = new AtomType(*atp); - itp->symbol = "106-Cd"; - itp->name = "106-Cadmium"; - itp->isotope = true; - itp->M = 105.906458; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 108-cadmium - itp = new AtomType(*atp); - itp->symbol = "108-Cd"; - itp->name = "108-Cadmium"; - itp->isotope = true; - itp->M = 107.904183; - itp->nsf = 5.31; - pt_backup.push_back(itp); - // 110-cadmium - itp = new AtomType(*atp); - itp->symbol = "110-Cd"; - itp->name = "110-Cadmium"; - itp->isotope = true; - itp->M = 109.903006; - itp->nsf = 5.78; - pt_backup.push_back(itp); - // 111-cadmium - itp = new AtomType(*atp); - itp->symbol = "111-Cd"; - itp->name = "111-Cadmium"; - itp->isotope = true; - itp->M = 110.904182; - itp->nsf = 6.47; - pt_backup.push_back(itp); - // 112-cadmium - itp = new AtomType(*atp); - itp->symbol = "112-Cd"; - itp->name = "112-Cadmium"; - itp->isotope = true; - itp->M = 111.9027572; - itp->nsf = 6.34; - pt_backup.push_back(itp); - // 113-cadmium - itp = new AtomType(*atp); - itp->symbol = "113-Cd"; - itp->name = "113-Cadmium"; - itp->isotope = true; - itp->M = 112.9044009; - itp->nsf = -8.0; - pt_backup.push_back(itp); - // 114-cadmium - itp = new AtomType(*atp); - itp->symbol = "114-Cd"; - itp->name = "114-Cadmium"; - itp->isotope = true; - itp->M = 113.9033581; - itp->nsf = 7.48; - pt_backup.push_back(itp); - // 116-cadmium - itp = new AtomType(*atp); - itp->symbol = "116-Cd"; - itp->name = "116-Cadmium"; - itp->isotope = true; - itp->M = 115.904755; - itp->nsf = 6.26; - pt_backup.push_back(itp); - } - // indium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "In"; - atp->name = "Indium"; - atp->z = 49; - atp->M = 114.8183; - atp->radius = 1.6662; - atp->xsf = 49.0; - atp->nsf = 4.0652; - // isotopes - // 113-indium - itp = new AtomType(*atp); - itp->symbol = "113-In"; - itp->name = "113-Indium"; - itp->isotope = true; - itp->M = 112.904061; - itp->nsf = 5.39; - pt_backup.push_back(itp); - // 115-indium - itp = new AtomType(*atp); - itp->symbol = "115-In"; - itp->name = "115-Indium"; - itp->isotope = true; - itp->M = 114.903878; - itp->nsf = 4.00; - pt_backup.push_back(itp); - } - // tin - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sn"; - atp->name = "Tin"; - atp->z = 50; - atp->M = 118.7107; - atp->radius = 1.5375; - atp->xsf = 50.0; - atp->nsf = 6.2252; - // isotopes - // 112-tin - itp = new AtomType(*atp); - itp->symbol = "112-Sn"; - itp->name = "112-Tin"; - itp->isotope = true; - itp->M = 111.904821; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 114-tin - itp = new AtomType(*atp); - itp->symbol = "114-Sn"; - itp->name = "114-Tin"; - itp->isotope = true; - itp->M = 113.902782; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 115-tin - itp = new AtomType(*atp); - itp->symbol = "115-Sn"; - itp->name = "115-Tin"; - itp->isotope = true; - itp->M = 114.903346; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 116-tin - itp = new AtomType(*atp); - itp->symbol = "116-Sn"; - itp->name = "116-Tin"; - itp->isotope = true; - itp->M = 115.901744; - itp->nsf = 6.1; - pt_backup.push_back(itp); - // 117-tin - itp = new AtomType(*atp); - itp->symbol = "117-Sn"; - itp->name = "117-Tin"; - itp->isotope = true; - itp->M = 116.902954; - itp->nsf = 6.59; - pt_backup.push_back(itp); - // 118-tin - itp = new AtomType(*atp); - itp->symbol = "118-Sn"; - itp->name = "118-Tin"; - itp->isotope = true; - itp->M = 117.901606; - itp->nsf = 6.23; - pt_backup.push_back(itp); - // 119-tin - itp = new AtomType(*atp); - itp->symbol = "119-Sn"; - itp->name = "119-Tin"; - itp->isotope = true; - itp->M = 118.903309; - itp->nsf = 6.28; - pt_backup.push_back(itp); - // 120-tin - itp = new AtomType(*atp); - itp->symbol = "120-Sn"; - itp->name = "120-Tin"; - itp->isotope = true; - itp->M = 119.9021966; - itp->nsf = 6.67; - pt_backup.push_back(itp); - // 122-tin - itp = new AtomType(*atp); - itp->symbol = "122-Sn"; - itp->name = "122-Tin"; - itp->isotope = true; - itp->M = 121.9034401; - itp->nsf = 5.93; - pt_backup.push_back(itp); - // 124-tin - itp = new AtomType(*atp); - itp->symbol = "124-Sn"; - itp->name = "124-Tin"; - itp->isotope = true; - itp->M = 123.9052746; - itp->nsf = 6.15; - pt_backup.push_back(itp); - } - // antimony - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sb"; - atp->name = "Antimony"; - atp->z = 51; - atp->M = 121.7601; - atp->radius = 1.4000; - atp->xsf = 51.0; - atp->nsf = 5.573; - // isotopes - // 121-antimony - itp = new AtomType(*atp); - itp->symbol = "121-Sb"; - itp->name = "121-Antimony"; - itp->isotope = true; - itp->M = 120.9038180; - itp->nsf = 5.71; - pt_backup.push_back(itp); - // 123-antimony - itp = new AtomType(*atp); - itp->symbol = "123-Sb"; - itp->name = "123-Antimony"; - itp->isotope = true; - itp->M = 122.9042157; - itp->nsf = 5.38; - pt_backup.push_back(itp); - } - // tellurium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Te"; - atp->name = "Tellurium"; - atp->z = 52; - atp->M = 127.603; - atp->radius = 1.3600; - atp->xsf = 52.0; - atp->nsf = 5.682; - // isotopes - // 120-tellurium - itp = new AtomType(*atp); - itp->symbol = "120-Te"; - itp->name = "120-Tellurium"; - itp->isotope = true; - itp->M = 119.904020; - itp->nsf = 5.3; - pt_backup.push_back(itp); - // 122-tellurium - itp = new AtomType(*atp); - itp->symbol = "122-Te"; - itp->name = "122-Tellurium"; - itp->isotope = true; - itp->M = 121.9030471; - itp->nsf = 3.8; - pt_backup.push_back(itp); - // 123-tellurium - itp = new AtomType(*atp); - itp->symbol = "123-Te"; - itp->name = "123-Tellurium"; - itp->isotope = true; - itp->M = 122.9042730; - itp->nsf = -0.05; - pt_backup.push_back(itp); - // 124-tellurium - itp = new AtomType(*atp); - itp->symbol = "124-Te"; - itp->name = "124-Tellurium"; - itp->isotope = true; - itp->M = 123.9028195; - itp->nsf = 7.95; - pt_backup.push_back(itp); - // 125-tellurium - itp = new AtomType(*atp); - itp->symbol = "125-Te"; - itp->name = "125-Tellurium"; - itp->isotope = true; - itp->M = 124.9044247; - itp->nsf = 5.01; - pt_backup.push_back(itp); - // 126-tellurium - itp = new AtomType(*atp); - itp->symbol = "126-Te"; - itp->name = "126-Tellurium"; - itp->isotope = true; - itp->M = 125.9033055; - itp->nsf = 5.55; - pt_backup.push_back(itp); - // 128-tellurium - itp = new AtomType(*atp); - itp->symbol = "128-Te"; - itp->name = "128-Tellurium"; - itp->isotope = true; - itp->M = 127.9044614; - itp->nsf = 5.88; - pt_backup.push_back(itp); - // 130-tellurium - itp = new AtomType(*atp); - itp->symbol = "130-Te"; - itp->name = "130-Tellurium"; - itp->isotope = true; - itp->M = 129.9062228; - itp->nsf = 6.01; - pt_backup.push_back(itp); - } - // iodine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "I"; - atp->name = "Iodine"; - atp->z = 53; - atp->M = 126.904473; - atp->radius = 1.3300; - atp->xsf = 53.0; - atp->nsf = 5.282; - } - // xenon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Xe"; - atp->name = "Xenon"; - atp->z = 54; - atp->M = 131.2936; - atp->radius = 2.2000; - atp->xsf = 54.0; - atp->nsf = 4.694; - } - // cesium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cs"; - atp->name = "Cesium"; - atp->z = 55; - atp->M = 132.905452; - atp->radius = 2.6325; - atp->xsf = 55.0; - atp->nsf = 5.422; - } - // barium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ba"; - atp->name = "Barium"; - atp->z = 56; - atp->M = 137.3277; - atp->radius = 2.1705; - atp->xsf = 56.0; - atp->nsf = 5.073; - // isotopes - // 130-barium - itp = new AtomType(*atp); - itp->symbol = "130-Ba"; - itp->name = "130-Barium"; - itp->isotope = true; - itp->M = 129.906310; - itp->nsf = -3.6; - pt_backup.push_back(itp); - // 132-barium - itp = new AtomType(*atp); - itp->symbol = "132-Ba"; - itp->name = "132-Barium"; - itp->isotope = true; - itp->M = 131.905056; - itp->nsf = 7.8; - pt_backup.push_back(itp); - // 134-barium - itp = new AtomType(*atp); - itp->symbol = "134-Ba"; - itp->name = "134-Barium"; - itp->isotope = true; - itp->M = 133.904503; - itp->nsf = 5.7; - pt_backup.push_back(itp); - // 135-barium - itp = new AtomType(*atp); - itp->symbol = "135-Ba"; - itp->name = "135-Barium"; - itp->isotope = true; - itp->M = 134.905683; - itp->nsf = 4.66; - pt_backup.push_back(itp); - // 136-barium - itp = new AtomType(*atp); - itp->symbol = "136-Ba"; - itp->name = "136-Barium"; - itp->isotope = true; - itp->M = 135.904570; - itp->nsf = 4.90; - pt_backup.push_back(itp); - // 137-barium - itp = new AtomType(*atp); - itp->symbol = "137-Ba"; - itp->name = "137-Barium"; - itp->isotope = true; - itp->M = 136.905821; - itp->nsf = 6.82; - pt_backup.push_back(itp); - // 138-barium - itp = new AtomType(*atp); - itp->symbol = "138-Ba"; - itp->name = "138-Barium"; - itp->isotope = true; - itp->M = 137.905241; - itp->nsf = 4.83; - pt_backup.push_back(itp); - } - // lanthanum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "La"; - atp->name = "Lanthanum"; - atp->z = 57; - atp->M = 138.90552; - atp->radius = 1.8725; - atp->xsf = 57.0; - atp->nsf = 8.244; - // isotopes - // 138-lanthanum - itp = new AtomType(*atp); - itp->symbol = "138-La"; - itp->name = "138-Lanthanum"; - itp->isotope = true; - itp->M = 137.907107; - itp->nsf = 8.0; - pt_backup.push_back(itp); - // 139-lanthanum - itp = new AtomType(*atp); - itp->symbol = "139-La"; - itp->name = "139-Lanthanum"; - itp->isotope = true; - itp->M = 138.906348; - itp->nsf = 8.24; - pt_backup.push_back(itp); - } - // cerium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ce"; - atp->name = "Cerium"; - atp->z = 58; - atp->M = 140.1161; - atp->radius = 1.8243; - atp->xsf = 58.0; - atp->nsf = 4.842; - // isotopes - // 136-cerium - itp = new AtomType(*atp); - itp->symbol = "136-Ce"; - itp->name = "136-Cerium"; - itp->isotope = true; - itp->M = 135.907140; - itp->nsf = 5.76; - pt_backup.push_back(itp); - // 138-cerium - itp = new AtomType(*atp); - itp->symbol = "138-Ce"; - itp->name = "138-Cerium"; - itp->isotope = true; - itp->M = 137.905986; - itp->nsf = 6.65; - pt_backup.push_back(itp); - // 140-cerium - itp = new AtomType(*atp); - itp->symbol = "140-Ce"; - itp->name = "140-Cerium"; - itp->isotope = true; - itp->M = 139.905434; - itp->nsf = 4.81; - pt_backup.push_back(itp); - // 142-cerium - itp = new AtomType(*atp); - itp->symbol = "142-Ce"; - itp->name = "142-Cerium"; - itp->isotope = true; - itp->M = 141.909240; - itp->nsf = 4.72; - pt_backup.push_back(itp); - } - // praseodymium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pr"; - atp->name = "Praseodymium"; - atp->z = 59; - atp->M = 140.907652; - atp->radius = 1.8362; - atp->xsf = 59.0; - atp->nsf = 4.585; - } - // neodymium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Nd"; - atp->name = "Neodymium"; - atp->z = 60; - atp->M = 144.243; - atp->radius = 1.8295; - atp->xsf = 60.0; - atp->nsf = 7.695; - // isotopes - // 142-neodymium - itp = new AtomType(*atp); - itp->symbol = "142-Nd"; - itp->name = "142-Neodymium"; - itp->isotope = true; - itp->M = 141.907719; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 143-neodymium - itp = new AtomType(*atp); - itp->symbol = "143-Nd"; - itp->name = "143-Neodymium"; - itp->isotope = true; - itp->M = 142.909810; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 144-neodymium - itp = new AtomType(*atp); - itp->symbol = "144-Nd"; - itp->name = "144-Neodymium"; - itp->isotope = true; - itp->M = 143.910083; - itp->nsf = 2.8; - pt_backup.push_back(itp); - // 145-neodymium - itp = new AtomType(*atp); - itp->symbol = "145-Nd"; - itp->name = "145-Neodymium"; - itp->isotope = true; - itp->M = 144.912569; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 146-neodymium - itp = new AtomType(*atp); - itp->symbol = "146-Nd"; - itp->name = "146-Neodymium"; - itp->isotope = true; - itp->M = 145.913112; - itp->nsf = 8.7; - pt_backup.push_back(itp); - // 148-neodymium - itp = new AtomType(*atp); - itp->symbol = "148-Nd"; - itp->name = "148-Neodymium"; - itp->isotope = true; - itp->M = 147.916889; - itp->nsf = 5.7; - pt_backup.push_back(itp); - // 150-neodymium - itp = new AtomType(*atp); - itp->symbol = "150-Nd"; - itp->name = "150-Neodymium"; - itp->isotope = true; - itp->M = 149.920887; - itp->nsf = 5.28; - pt_backup.push_back(itp); - } - // promethium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pm"; - atp->name = "Promethium"; - atp->z = 61; - atp->M = 145.0; - atp->radius = 1.8090; - atp->xsf = 61.0; - atp->nsf = 12.64; - } - // samarium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sm"; - atp->name = "Samarium"; - atp->z = 62; - atp->M = 150.363; - atp->radius = 1.8040; - atp->xsf = 62.0; - atp->nsf = 0.005; - // isotopes - // 144-samarium - itp = new AtomType(*atp); - itp->symbol = "144-Sm"; - itp->name = "144-Samarium"; - itp->isotope = true; - itp->M = 143.911995; - itp->nsf = -3.0; - pt_backup.push_back(itp); - // 147-samarium - itp = new AtomType(*atp); - itp->symbol = "147-Sm"; - itp->name = "147-Samarium"; - itp->isotope = true; - itp->M = 146.914893; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 148-samarium - itp = new AtomType(*atp); - itp->symbol = "148-Sm"; - itp->name = "148-Samarium"; - itp->isotope = true; - itp->M = 147.914818; - itp->nsf = -3.0; - pt_backup.push_back(itp); - // 149-samarium - itp = new AtomType(*atp); - itp->symbol = "149-Sm"; - itp->name = "149-Samarium"; - itp->isotope = true; - itp->M = 148.917180; - itp->nsf = 18.7; - pt_backup.push_back(itp); - // 150-samarium - itp = new AtomType(*atp); - itp->symbol = "150-Sm"; - itp->name = "150-Samarium"; - itp->isotope = true; - itp->M = 149.917271; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 152-samarium - itp = new AtomType(*atp); - itp->symbol = "152-Sm"; - itp->name = "152-Samarium"; - itp->isotope = true; - itp->M = 151.919728; - itp->nsf = -5.0; - pt_backup.push_back(itp); - // 154-samarium - itp = new AtomType(*atp); - itp->symbol = "154-Sm"; - itp->name = "154-Samarium"; - itp->isotope = true; - itp->M = 153.922205; - itp->nsf = 8.0; - pt_backup.push_back(itp); - } - // europium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Eu"; - atp->name = "Europium"; - atp->z = 63; - atp->M = 151.9641; - atp->radius = 1.9840; - atp->xsf = 63.0; - atp->nsf = 5.33; - // isotopes - // 153-europium - itp = new AtomType(*atp); - itp->symbol = "153-Eu"; - itp->name = "153-Europium"; - itp->isotope = true; - itp->M = 152.921226; - itp->nsf = 8.22; - pt_backup.push_back(itp); - } - // gadolinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Gd"; - atp->name = "Gadolinium"; - atp->z = 64; - atp->M = 157.253; - atp->radius = 1.8180; - atp->xsf = 64.0; - atp->nsf = 9.52; - // isotopes - // 152-gadolinium - itp = new AtomType(*atp); - itp->symbol = "152-Gd"; - itp->name = "152-Gadolinium"; - itp->isotope = true; - itp->M = 151.919788; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 154-gadolinium - itp = new AtomType(*atp); - itp->symbol = "154-Gd"; - itp->name = "154-Gadolinium"; - itp->isotope = true; - itp->M = 153.920862; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 155-gadolinium - itp = new AtomType(*atp); - itp->symbol = "155-Gd"; - itp->name = "155-Gadolinium"; - itp->isotope = true; - itp->M = 154.922619; - itp->nsf = 13.8; - pt_backup.push_back(itp); - // 156-gadolinium - itp = new AtomType(*atp); - itp->symbol = "156-Gd"; - itp->name = "156-Gadolinium"; - itp->isotope = true; - itp->M = 155.922120; - itp->nsf = 6.3; - pt_backup.push_back(itp); - // 157-gadolinium - itp = new AtomType(*atp); - itp->symbol = "157-Gd"; - itp->name = "157-Gadolinium"; - itp->isotope = true; - itp->M = 156.923957; - itp->nsf = 4.0; - pt_backup.push_back(itp); - // 158-gadolinium - itp = new AtomType(*atp); - itp->symbol = "158-Gd"; - itp->name = "158-Gadolinium"; - itp->isotope = true; - itp->M = 157.924101; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 160-gadolinium - itp = new AtomType(*atp); - itp->symbol = "160-Gd"; - itp->name = "160-Gadolinium"; - itp->isotope = true; - itp->M = 159.927051; - itp->nsf = 9.15; - pt_backup.push_back(itp); - } - // terbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tb"; - atp->name = "Terbium"; - atp->z = 65; - atp->M = 158.925342; - atp->radius = 1.8005; - atp->xsf = 65.0; - atp->nsf = 7.342; - } - // dysprosium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Dy"; - atp->name = "Dysprosium"; - atp->z = 66; - atp->M = 162.5001; - atp->radius = 1.7951; - atp->xsf = 66.0; - atp->nsf = 16.93; - // isotopes - // 156-dysprosium - itp = new AtomType(*atp); - itp->symbol = "156-Dy"; - itp->name = "156-Dysprosium"; - itp->isotope = true; - itp->M = 155.924278; - itp->nsf = 6.1; - pt_backup.push_back(itp); - // 158-dysprosium - itp = new AtomType(*atp); - itp->symbol = "158-Dy"; - itp->name = "158-Dysprosium"; - itp->isotope = true; - itp->M = 157.924405; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 160-dysprosium - itp = new AtomType(*atp); - itp->symbol = "160-Dy"; - itp->name = "160-Dysprosium"; - itp->isotope = true; - itp->M = 159.925194; - itp->nsf = 6.7; - pt_backup.push_back(itp); - // 161-dysprosium - itp = new AtomType(*atp); - itp->symbol = "161-Dy"; - itp->name = "161-Dysprosium"; - itp->isotope = true; - itp->M = 160.926930; - itp->nsf = 10.3; - pt_backup.push_back(itp); - // 162-dysprosium - itp = new AtomType(*atp); - itp->symbol = "162-Dy"; - itp->name = "162-Dysprosium"; - itp->isotope = true; - itp->M = 161.926795; - itp->nsf = -1.4; - pt_backup.push_back(itp); - // 163-dysprosium - itp = new AtomType(*atp); - itp->symbol = "163-Dy"; - itp->name = "163-Dysprosium"; - itp->isotope = true; - itp->M = 162.928728; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 164-dysprosium - itp = new AtomType(*atp); - itp->symbol = "164-Dy"; - itp->name = "164-Dysprosium"; - itp->isotope = true; - itp->M = 163.929171; - itp->nsf = 49.4; - pt_backup.push_back(itp); - } - // holmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ho"; - atp->name = "Holmium"; - atp->z = 67; - atp->M = 164.930322; - atp->radius = 1.7886; - atp->xsf = 67.0; - atp->nsf = 8.443; - } - // erbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Er"; - atp->name = "Erbium"; - atp->z = 68; - atp->M = 167.2593; - atp->radius = 1.7794; - atp->xsf = 68.0; - atp->nsf = 7.792; - // isotopes - // 162-erbium - itp = new AtomType(*atp); - itp->symbol = "162-Er"; - itp->name = "162-Erbium"; - itp->isotope = true; - itp->M = 161.928775; - itp->nsf = 9.01; - pt_backup.push_back(itp); - // 164-erbium - itp = new AtomType(*atp); - itp->symbol = "164-Er"; - itp->name = "164-Erbium"; - itp->isotope = true; - itp->M = 163.929197; - itp->nsf = 7.95; - pt_backup.push_back(itp); - // 166-erbium - itp = new AtomType(*atp); - itp->symbol = "166-Er"; - itp->name = "166-Erbium"; - itp->isotope = true; - itp->M = 165.930290; - itp->nsf = 10.51; - pt_backup.push_back(itp); - // 167-erbium - itp = new AtomType(*atp); - itp->symbol = "167-Er"; - itp->name = "167-Erbium"; - itp->isotope = true; - itp->M = 166.932045; - itp->nsf = 3.06; - pt_backup.push_back(itp); - // 168-erbium - itp = new AtomType(*atp); - itp->symbol = "168-Er"; - itp->name = "168-Erbium"; - itp->isotope = true; - itp->M = 167.932368; - itp->nsf = 7.43; - pt_backup.push_back(itp); - // 170-erbium - itp = new AtomType(*atp); - itp->symbol = "170-Er"; - itp->name = "170-Erbium"; - itp->isotope = true; - itp->M = 169.935460; - itp->nsf = 9.61; - pt_backup.push_back(itp); - } - // thulium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tm"; - atp->name = "Thulium"; - atp->z = 69; - atp->M = 168.934212; - atp->radius = 1.7687; - atp->xsf = 69.0; - atp->nsf = 7.073; - } - // ytterbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Yb"; - atp->name = "Ytterbium"; - atp->z = 70; - atp->M = 173.043; - atp->radius = 1.9396; - atp->xsf = 70.0; - atp->nsf = 12.413; - // isotopes - // 168-ytterbium - itp = new AtomType(*atp); - itp->symbol = "168-Yb"; - itp->name = "168-Ytterbium"; - itp->isotope = true; - itp->M = 167.933894; - itp->nsf = -4.07; - pt_backup.push_back(itp); - // 170-ytterbium - itp = new AtomType(*atp); - itp->symbol = "170-Yb"; - itp->name = "170-Ytterbium"; - itp->isotope = true; - itp->M = 169.934759; - itp->nsf = 6.8; - pt_backup.push_back(itp); - // 171-ytterbium - itp = new AtomType(*atp); - itp->symbol = "171-Yb"; - itp->name = "171-Ytterbium"; - itp->isotope = true; - itp->M = 170.936322; - itp->nsf = 9.7; - pt_backup.push_back(itp); - // 172-ytterbium - itp = new AtomType(*atp); - itp->symbol = "172-Yb"; - itp->name = "172-Ytterbium"; - itp->isotope = true; - itp->M = 171.9363777; - itp->nsf = 9.5; - pt_backup.push_back(itp); - // 173-ytterbium - itp = new AtomType(*atp); - itp->symbol = "173-Yb"; - itp->name = "173-Ytterbium"; - itp->isotope = true; - itp->M = 172.9382068; - itp->nsf = 9.56; - pt_backup.push_back(itp); - // 174-ytterbium - itp = new AtomType(*atp); - itp->symbol = "174-Yb"; - itp->name = "174-Ytterbium"; - itp->isotope = true; - itp->M = 173.9388581; - itp->nsf = 19.2; - pt_backup.push_back(itp); - // 176-ytterbium - itp = new AtomType(*atp); - itp->symbol = "176-Yb"; - itp->name = "176-Ytterbium"; - itp->isotope = true; - itp->M = 175.942568; - itp->nsf = 8.7; - pt_backup.push_back(itp); - } - // lutetium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Lu"; - atp->name = "Lutetium"; - atp->z = 71; - atp->M = 174.9671; - atp->radius = 1.7515; - atp->xsf = 71.0; - atp->nsf = 7.213; - // isotopes - // 175-lutetium - itp = new AtomType(*atp); - itp->symbol = "175-Lu"; - itp->name = "175-Lutetium"; - itp->isotope = true; - itp->M = 174.9407679; - itp->nsf = 7.28; - pt_backup.push_back(itp); - // 176-lutetium - itp = new AtomType(*atp); - itp->symbol = "176-Lu"; - itp->name = "176-Lutetium"; - itp->isotope = true; - itp->M = 175.9426824; - itp->nsf = 6.1; - pt_backup.push_back(itp); - } - // hafnium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hf"; - atp->name = "Hafnium"; - atp->z = 72; - atp->M = 178.492; - atp->radius = 1.5973; - atp->xsf = 72.0; - atp->nsf = 7.7714; - // isotopes - // 174-hafnium - itp = new AtomType(*atp); - itp->symbol = "174-Hf"; - itp->name = "174-Hafnium"; - itp->isotope = true; - itp->M = 173.940040; - itp->nsf = 10.9; - pt_backup.push_back(itp); - // 176-hafnium - itp = new AtomType(*atp); - itp->symbol = "176-Hf"; - itp->name = "176-Hafnium"; - itp->isotope = true; - itp->M = 175.9414018; - itp->nsf = 6.61; - pt_backup.push_back(itp); - // 177-hafnium - itp = new AtomType(*atp); - itp->symbol = "177-Hf"; - itp->name = "177-Hafnium"; - itp->isotope = true; - itp->M = 176.9432200; - itp->nsf = 0.8; - pt_backup.push_back(itp); - // 178-hafnium - itp = new AtomType(*atp); - itp->symbol = "178-Hf"; - itp->name = "178-Hafnium"; - itp->isotope = true; - itp->M = 177.9436977; - itp->nsf = 5.9; - pt_backup.push_back(itp); - // 179-hafnium - itp = new AtomType(*atp); - itp->symbol = "179-Hf"; - itp->name = "179-Hafnium"; - itp->isotope = true; - itp->M = 178.9458151; - itp->nsf = 7.46; - pt_backup.push_back(itp); - // 180-hafnium - itp = new AtomType(*atp); - itp->symbol = "180-Hf"; - itp->name = "180-Hafnium"; - itp->isotope = true; - itp->M = 179.9465488; - itp->nsf = 13.2; - pt_backup.push_back(itp); - } - // tantalum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ta"; - atp->name = "Tantalum"; - atp->z = 73; - atp->M = 180.94791; - atp->radius = 1.4280; - atp->xsf = 73.0; - atp->nsf = 6.917; - // isotopes - // 180-tantalum - itp = new AtomType(*atp); - itp->symbol = "180-Ta"; - itp->name = "180-Tantalum"; - itp->isotope = true; - itp->M = 179.947466; - itp->nsf = 7.0; - pt_backup.push_back(itp); - // 181-tantalum - itp = new AtomType(*atp); - itp->symbol = "181-Ta"; - itp->name = "181-Tantalum"; - itp->isotope = true; - itp->M = 180.947996; - itp->nsf = 6.91; - pt_backup.push_back(itp); - } - // tungsten - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "W"; - atp->name = "Tungsten"; - atp->z = 74; - atp->M = 183.841; - atp->radius = 1.3705; - atp->xsf = 74.0; - atp->nsf = 4.75518; - // isotopes - // 180-tungsten - itp = new AtomType(*atp); - itp->symbol = "180-W"; - itp->name = "180-Tungsten"; - itp->isotope = true; - itp->M = 179.946706; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 182-tungsten - itp = new AtomType(*atp); - itp->symbol = "182-W"; - itp->name = "182-Tungsten"; - itp->isotope = true; - itp->M = 181.948206; - itp->nsf = 7.04; - pt_backup.push_back(itp); - // 183-tungsten - itp = new AtomType(*atp); - itp->symbol = "183-W"; - itp->name = "183-Tungsten"; - itp->isotope = true; - itp->M = 182.9502245; - itp->nsf = 6.59; - pt_backup.push_back(itp); - // 184-tungsten - itp = new AtomType(*atp); - itp->symbol = "184-W"; - itp->name = "184-Tungsten"; - itp->isotope = true; - itp->M = 183.9509326; - itp->nsf = 7.55; - pt_backup.push_back(itp); - // 186-tungsten - itp = new AtomType(*atp); - itp->symbol = "186-W"; - itp->name = "186-Tungsten"; - itp->isotope = true; - itp->M = 185.954362; - itp->nsf = -0.73; - pt_backup.push_back(itp); - } - // rhenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Re"; - atp->name = "Rhenium"; - atp->z = 75; - atp->M = 186.2071; - atp->radius = 1.3800; - atp->xsf = 75.0; - atp->nsf = 9.22; - // isotopes - // 185-rhenium - itp = new AtomType(*atp); - itp->symbol = "185-Re"; - itp->name = "185-Rhenium"; - itp->isotope = true; - itp->M = 184.9529557; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 187-rhenium - itp = new AtomType(*atp); - itp->symbol = "187-Re"; - itp->name = "187-Rhenium"; - itp->isotope = true; - itp->M = 186.9557508; - itp->nsf = 9.3; - pt_backup.push_back(itp); - } - // osmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Os"; - atp->name = "Osmium"; - atp->z = 76; - atp->M = 190.233; - atp->radius = 1.3676; - atp->xsf = 76.0; - atp->nsf = 10.72; - // isotopes - // 184-osmium - itp = new AtomType(*atp); - itp->symbol = "184-Os"; - itp->name = "184-Osmium"; - itp->isotope = true; - itp->M = 183.952491; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 186-osmium - itp = new AtomType(*atp); - itp->symbol = "186-Os"; - itp->name = "186-Osmium"; - itp->isotope = true; - itp->M = 185.953838; - itp->nsf = 12.0; - pt_backup.push_back(itp); - // 187-osmium - itp = new AtomType(*atp); - itp->symbol = "187-Os"; - itp->name = "187-Osmium"; - itp->isotope = true; - itp->M = 186.9557479; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 188-osmium - itp = new AtomType(*atp); - itp->symbol = "188-Os"; - itp->name = "188-Osmium"; - itp->isotope = true; - itp->M = 187.9558360; - itp->nsf = 7.8; - pt_backup.push_back(itp); - // 189-osmium - itp = new AtomType(*atp); - itp->symbol = "189-Os"; - itp->name = "189-Osmium"; - itp->isotope = true; - itp->M = 188.9581449; - itp->nsf = 11.0; - pt_backup.push_back(itp); - // 190-osmium - itp = new AtomType(*atp); - itp->symbol = "190-Os"; - itp->name = "190-Osmium"; - itp->isotope = true; - itp->M = 189.958445; - itp->nsf = 11.4; - pt_backup.push_back(itp); - // 192-osmium - itp = new AtomType(*atp); - itp->symbol = "192-Os"; - itp->name = "192-Osmium"; - itp->isotope = true; - itp->M = 191.961479; - itp->nsf = 11.9; - pt_backup.push_back(itp); - } - // iridium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ir"; - atp->name = "Iridium"; - atp->z = 77; - atp->M = 192.2173; - atp->radius = 1.3573; - atp->xsf = 77.0; - atp->nsf = 10.63; - } - // platinum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pt"; - atp->name = "Platinum"; - atp->z = 78; - atp->M = 195.0782; - atp->radius = 1.3873; - atp->xsf = 78.0; - atp->nsf = 9.601; - // isotopes - // 190-platinum - itp = new AtomType(*atp); - itp->symbol = "190-Pt"; - itp->name = "190-Platinum"; - itp->isotope = true; - itp->M = 189.959930; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 192-platinum - itp = new AtomType(*atp); - itp->symbol = "192-Pt"; - itp->name = "192-Platinum"; - itp->isotope = true; - itp->M = 191.961035; - itp->nsf = 9.9; - pt_backup.push_back(itp); - // 194-platinum - itp = new AtomType(*atp); - itp->symbol = "194-Pt"; - itp->name = "194-Platinum"; - itp->isotope = true; - itp->M = 193.962664; - itp->nsf = 10.55; - pt_backup.push_back(itp); - // 195-platinum - itp = new AtomType(*atp); - itp->symbol = "195-Pt"; - itp->name = "195-Platinum"; - itp->isotope = true; - itp->M = 194.964774; - itp->nsf = 8.91; - pt_backup.push_back(itp); - // 196-platinum - itp = new AtomType(*atp); - itp->symbol = "196-Pt"; - itp->name = "196-Platinum"; - itp->isotope = true; - itp->M = 195.964935; - itp->nsf = 9.89; - pt_backup.push_back(itp); - // 198-platinum - itp = new AtomType(*atp); - itp->symbol = "198-Pt"; - itp->name = "198-Platinum"; - itp->isotope = true; - itp->M = 197.967876; - itp->nsf = 7.8; - pt_backup.push_back(itp); - } - // gold - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Au"; - atp->name = "Gold"; - atp->z = 79; - atp->M = 196.966552; - atp->radius = 1.4419; - atp->xsf = 79.0; - atp->nsf = 7.907; - } - // mercury - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hg"; - atp->name = "Mercury"; - atp->z = 80; - atp->M = 200.592; - atp->radius = 1.5025; - atp->xsf = 80.0; - atp->nsf = 12.59545; - // isotopes - // 196-mercury - itp = new AtomType(*atp); - itp->symbol = "196-Hg"; - itp->name = "196-Mercury"; - itp->isotope = true; - itp->M = 195.965815; - itp->nsf = 30.3; - pt_backup.push_back(itp); - // 199-mercury - itp = new AtomType(*atp); - itp->symbol = "199-Hg"; - itp->name = "199-Mercury"; - itp->isotope = true; - itp->M = 198.968262; - itp->nsf = 16.9; - pt_backup.push_back(itp); - // 202-mercury - itp = new AtomType(*atp); - itp->symbol = "202-Hg"; - itp->name = "202-Mercury"; - itp->isotope = true; - itp->M = 201.970626; - itp->nsf = 11.002; - pt_backup.push_back(itp); - } - // thallium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tl"; - atp->name = "Thallium"; - atp->z = 81; - atp->M = 204.38332; - atp->radius = 1.7283; - atp->xsf = 81.0; - atp->nsf = 8.7765; - // isotopes - // 203-thalium - itp = new AtomType(*atp); - itp->symbol = "203-Tl"; - itp->name = "203-Thallium"; - itp->isotope = true; - itp->M = 202.972329; - itp->nsf = 8.51; - pt_backup.push_back(itp); - // 205-thalium - itp = new AtomType(*atp); - itp->symbol = "205-Tl"; - itp->name = "205-Thallium"; - itp->isotope = true; - itp->M = 204.974412; - itp->nsf = 8.87; - pt_backup.push_back(itp); - } - // lead - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pb"; - atp->name = "Lead"; - atp->z = 82; - atp->M = 207.21; - atp->radius = 1.7501; - atp->xsf = 82.0; - atp->nsf = 9.4012; - // isotopes - // 204-lead - itp = new AtomType(*atp); - itp->symbol = "204-Pb"; - itp->name = "204-Lead"; - itp->isotope = true; - itp->M = 203.973029; - itp->nsf = 10.893; - pt_backup.push_back(itp); - // 206-lead - itp = new AtomType(*atp); - itp->symbol = "206-Pb"; - itp->name = "206-Lead"; - itp->isotope = true; - itp->M = 205.974449; - itp->nsf = 9.2221; - pt_backup.push_back(itp); - // 207-lead - itp = new AtomType(*atp); - itp->symbol = "207-Pb"; - itp->name = "207-Lead"; - itp->isotope = true; - itp->M = 206.975881; - itp->nsf = 9.286; - pt_backup.push_back(itp); - // 208-lead - itp = new AtomType(*atp); - itp->symbol = "208-Pb"; - itp->name = "208-Lead"; - itp->isotope = true; - itp->M = 207.976636; - itp->nsf = 9.494; - pt_backup.push_back(itp); - } - // bismuth - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bi"; - atp->name = "Bismuth"; - atp->z = 83; - atp->M = 208.980382; - atp->radius = 1.4600; - atp->xsf = 83.0; - atp->nsf = 8.5322; - } - // polonium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Po"; - atp->name = "Polonium"; - atp->z = 84; - atp->M = 209.0; - atp->radius = 1.4600; - atp->xsf = 84.0; - atp->nsf = 0.0; - } - // astatine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "At"; - atp->name = "Astatine"; - atp->z = 85; - atp->M = 210.0; - atp->radius = 1.4500; - atp->xsf = 85.0; - atp->nsf = 0.0; - } - // radon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rn"; - atp->name = "Radon"; - atp->z = 86; - atp->M = 222.0; - atp->radius = 1.4300; - atp->xsf = 86.0; - atp->nsf = 0.0; - } - // francium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fr"; - atp->name = "Francium"; - atp->z = 87; - atp->M = 223.0; - atp->radius = 2.5000; - atp->xsf = 87.0; - atp->nsf = 0.0; - } - // radium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ra"; - atp->name = "Radium"; - atp->z = 88; - atp->M = 226.0; - atp->radius = 2.1400; - atp->xsf = 88.0; - atp->nsf = 10.0; - } - // actinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ac"; - atp->name = "Actinium"; - atp->z = 89; - atp->M = 227.0; - atp->radius = 1.8775; - atp->xsf = 89.0; - atp->nsf = 0.0; - } - // thorium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Th"; - atp->name = "Thorium"; - atp->z = 90; - atp->M = 232.03811; - atp->radius = 1.7975; - atp->xsf = 90.0; - atp->nsf = 10.31; - } - // protactinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pa"; - atp->name = "Protactinium"; - atp->z = 91; - atp->M = 231.035882; - atp->radius = 1.6086; - atp->xsf = 91.0; - atp->nsf = 9.13; - } - // uranium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "U"; - atp->name = "Uranium"; - atp->z = 92; - atp->M = 238.028913; - atp->radius = 1.5683; - atp->xsf = 92.0; - atp->nsf = 8.417; - // isotopes - // 233-uranium - itp = new AtomType(*atp); - itp->symbol = "233-U"; - itp->name = "233-Uranium"; - itp->isotope = true; - itp->M = 233.039628; - itp->nsf = 10.1; - pt_backup.push_back(itp); - // 234-uranium - itp = new AtomType(*atp); - itp->symbol = "234-U"; - itp->name = "234-Uranium"; - itp->isotope = true; - itp->M = 234.0409456; - itp->nsf = 12.4; - pt_backup.push_back(itp); - // 235-uranium - itp = new AtomType(*atp); - itp->symbol = "235-U"; - itp->name = "235-Uranium"; - itp->isotope = true; - itp->M = 235.0439231; - itp->nsf = 10.50; - pt_backup.push_back(itp); - // 238-uranium - itp = new AtomType(*atp); - itp->symbol = "238-U"; - itp->name = "238-Uranium"; - itp->isotope = true; - itp->M = 238.0507826; - itp->nsf = 8.407; - pt_backup.push_back(itp); - } - // neptunium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Np"; - atp->name = "Neptunium"; - atp->z = 93; - atp->M = 237.0; - atp->radius = 1.0000; - atp->xsf = 93.0; - atp->nsf = 10.55; - } - // plutonium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pu"; - atp->name = "Plutonium"; - atp->z = 94; - atp->M = 244.0; - atp->radius = 1.0000; - atp->xsf = 94.0; - atp->nsf = 7.71; - // isotopes - // 240-plutonium - itp = new AtomType(*atp); - itp->symbol = "240-Pu"; - itp->name = "240-Plutonium"; - itp->isotope = true; - itp->M = 240.0538075; - itp->nsf = 3.5; - pt_backup.push_back(itp); - // 242-plutonium - itp = new AtomType(*atp); - itp->symbol = "242-Pu"; - itp->name = "242-Plutonium"; - itp->isotope = true; - itp->M = 242.0587368; - itp->nsf = 8.1; - pt_backup.push_back(itp); - } - // americium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Am"; - atp->name = "Americium"; - atp->z = 95; - atp->M = 243.0; - atp->radius = 1.0000; - atp->xsf = 95.0; - atp->nsf = 8.32; - } - // curium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cm"; - atp->name = "Curium"; - atp->z = 96; - atp->M = 247.0; - atp->radius = 1.0000; - atp->xsf = 96.0; - atp->nsf = 9.53; - // isotopes - // 246-curium - itp = new AtomType(*atp); - itp->symbol = "246-Cm"; - itp->name = "246-Curium"; - itp->isotope = true; - itp->M = 246.0672176; - itp->nsf = 9.3; - pt_backup.push_back(itp); - // 248-curium - itp = new AtomType(*atp); - itp->symbol = "248-Cm"; - itp->name = "248-Curium"; - itp->isotope = true; - itp->M = 248.072342; - itp->nsf = 7.7; - pt_backup.push_back(itp); - } - // berkelium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bk"; - atp->name = "Berkelium"; - atp->z = 97; - atp->M = 247.0; - atp->radius = 1.0000; - atp->xsf = 97.0; - atp->nsf = 0.0; - } - // californium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cf"; - atp->name = "Californium"; - atp->z = 98; - atp->M = 251.0; - atp->radius = 1.0000; - atp->xsf = 98.0; - atp->nsf = 0.0; - } - // einsteinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Es"; - atp->name = "Einsteinium"; - atp->z = 99; - atp->M = 252.0; - atp->radius = 1.0000; - atp->xsf = 99.0; - atp->nsf = 0.0; - } - // fermium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fm"; - atp->name = "Fermium"; - atp->z = 100; - atp->M = 257.0; - atp->radius = 1.0000; - atp->xsf = 100.0; - atp->nsf = 0.0; - } - // mendelevium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Md"; - atp->name = "Mendelevium"; - atp->z = 101; - atp->M = 258.0; - atp->radius = 1.0000; - atp->xsf = 101.0; - atp->nsf = 0.0; - } - // nobelium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "No"; - atp->name = "Nobelium"; - atp->z = 102; - atp->M = 259.0; - atp->radius = 1.0000; - atp->xsf = 102.0; - atp->nsf = 0.0; - } - // lawrencium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Lr"; - atp->name = "Lawrencium"; - atp->z = 103; - atp->M = 262.0; - atp->radius = 1.0000; - atp->xsf = 103.0; - atp->nsf = 0.0; - } - // rutherfordium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rf"; - atp->name = "Rutherfordium"; - atp->z = 104; - atp->M = 261.0; - atp->radius = 1.0000; - atp->xsf = 104.0; - atp->nsf = 0.0; - } - // dubnium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Db"; - atp->name = "Dubnium"; - atp->z = 105; - atp->M = 262.0; - atp->radius = 1.0000; - atp->xsf = 105.0; - atp->nsf = 0.0; - } - // seaborgium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sg"; - atp->name = "Seaborgium"; - atp->z = 106; - atp->M = 266.0; - atp->radius = 1.0000; - atp->xsf = 106.0; - atp->nsf = 0.0; - } - // bohrium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bh"; - atp->name = "Bohrium"; - atp->z = 107; - atp->M = 264.0; - atp->radius = 1.0000; - atp->xsf = 107.0; - atp->nsf = 0.0; - } - // hassium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hs"; - atp->name = "Hassium"; - atp->z = 108; - atp->M = 277.0; - atp->radius = 1.0000; - atp->xsf = 108.0; - atp->nsf = 0.0; - } - // meitnerium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mt"; - atp->name = "Meitnerium"; - atp->z = 109; - atp->M = 268.0; - atp->radius = 1.0000; - atp->xsf = 109.0; - atp->nsf = 0.0; - } - // darmstadtium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ds"; - atp->name = "Darmstadtium"; - atp->z = 110; - atp->M = 281.0; - atp->radius = 1.0000; - atp->xsf = 110.0; - atp->nsf = 0.0; - } - // roentgenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rg"; - atp->name = "Roentgenium"; - atp->z = 111; - atp->M = 272.0; - atp->radius = 1.0000; - atp->xsf = 111.0; - atp->nsf = 0.0; - } -} - -// End of file diff --git a/libpdffit2/PeriodicTable.h b/libpdffit2/PeriodicTable.h deleted file mode 100644 index 99949031..00000000 --- a/libpdffit2/PeriodicTable.h +++ /dev/null @@ -1,75 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PeriodicTable -* -* Comments: singleton class, use PeriodicTable::instance() -* for its pointer -* -***********************************************************************/ - -#ifndef PERIODICTABLE_H_INCLUDED -#define PERIODICTABLE_H_INCLUDED - -#include -#include -#include -#include -#include "AtomType.h" -#include "support_msvc9.h" - -// PeriodicTable -class PeriodicTable -{ - private: - - // PeriodicTable is a singleton class - PeriodicTable(); - - public: - - // Access to singleton instance - static PeriodicTable* instance() - { - static std::unique_ptr the_table(new PeriodicTable()); - return the_table.get(); - } - // Destructor - ~PeriodicTable(); - - // Methods - AtomType* name(const std::string& s); - AtomType* symbol(const std::string& s); - AtomType* lookup(std::string s); // icase lookup - bool has(const std::string& s); - void defAtomType(const AtomType& atp); - void deleteAtomType(const AtomType* atp); - void reset(AtomType* atp); // retrieve atp from pt_backup - void resetAll(); // reset all elements - - private: - - // Data Members - std::map name_index; - std::map symbol_index; - std::deque pt_public; - std::deque pt_backup; - - // Methods - void init(); - void clear(); - void fill_pt_backup(); -}; - -#endif // PERIODICTABLE_H_INCLUDED diff --git a/libpdffit2/PointsInSphere.cc b/libpdffit2/PointsInSphere.cc deleted file mode 100644 index 8e51c575..00000000 --- a/libpdffit2/PointsInSphere.cc +++ /dev/null @@ -1,243 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin -* -* Comments: sequencers for lattice points insided 3D sphere -* -***********************************************************************/ - -#include -#include "PointsInSphere.h" - -using namespace NS_POINTSINSPHERE; - -//////////////////////////////////////////////////////////////////////// -// LatticeParameters -//////////////////////////////////////////////////////////////////////// - -LatticeParameters::LatticeParameters( double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - a(_a), b(_b), c(_c), - alpha(_alpha), beta(_beta), gamma(_gamma) -{ - update(); -} - -LatticeParameters& LatticeParameters::update() -{ - ca = cosd(alpha); cb = cosd(beta); cg = cosd(gamma); - sa = sind(alpha); sb = sind(beta); sg = sind(gamma); - // Vunit is a volume of unit cell with a=b=c=1 - const double Vunit = sqrt(1.0 + 2.0*ca*cb*cg - ca*ca - cb*cb - cg*cg); - ar = sa/(a*Vunit); - br = sb/(b*Vunit); - cr = sg/(c*Vunit); - car = (cb*cg - ca)/(sb*sg); sar = sqrt(1.0 - car*car); - cbr = (ca*cg - cb)/(sa*sg); sbr = sqrt(1.0 - cbr*cbr); - cgr = (ca*cb - cg)/(sa*sb); sgr = sqrt(1.0 - cgr*cgr); - alphar = 180.0/M_PI*acos(car); - betar = 180.0/M_PI*acos(cbr); - gammar = 180.0/M_PI*acos(cgr); - return *this; -} - -LatticeParameters LatticeParameters::reciprocal() const -{ - using namespace std; - LatticeParameters rec(*this); - swap(rec.a, rec.ar); - swap(rec.b, rec.br); - swap(rec.c, rec.cr); - swap(rec.alpha, rec.alphar); - swap(rec.beta, rec.betar); - swap(rec.gamma, rec.gammar); - swap(rec.ca, rec.car); - swap(rec.cb, rec.cbr); - swap(rec.cg, rec.cgr); - swap(rec.sa, rec.sar); - swap(rec.sb, rec.sbr); - swap(rec.sg, rec.sgr); - return rec; -} - - -//////////////////////////////////////////////////////////////////////// -// PointsInSphere -//////////////////////////////////////////////////////////////////////// - -PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, - const LatticeParameters& _latpar ) : - m(mno[0]), n(mno[1]), o(mno[2]), - Rmin(_Rmin), Rmax(_Rmax), latpar(_latpar) -{ - init(); - rewind(); -} - -PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - m(mno[0]), n(mno[1]), o(mno[2]), - Rmin(_Rmin), Rmax(_Rmax), - latpar(_a, _b, _c, _alpha, _beta, _gamma) -{ - init(); - rewind(); -} - -void PointsInSphere::init() -{ - RminSquare = (Rmin < 0.0) ? -(Rmin*Rmin) : Rmin*Rmin; - RmaxSquare = (Rmax < 0.0) ? -(Rmax*Rmax) : Rmax*Rmax; - dn0dm = latpar.cgr*latpar.br/latpar.ar; - do0dm = latpar.cbr*latpar.cr/latpar.ar; - // 2D reciprocal parameters in bc plane - b2r = 1.0/(latpar.b*latpar.sa); - c2r = 1.0/(latpar.c*latpar.sa); - ca2r = -latpar.ca; - do0dn = ca2r*c2r/b2r; - // 1D reciprocal along c axis - c1r = 1.0/latpar.c; -} - -void PointsInSphere::rewind() -{ - mHalfSpan = Rmax*latpar.ar; - hi_m = int(ceil(mHalfSpan)); - m = -hi_m; - // make indices n, o invalid, reset the neares point - n = hi_n = 0; - o = hi_o = outside_o = 0; - n0plane = o0plane = o0line = 0.0; - // unset excluded zone - oExclHalfSpan = 0.0; - // get the first inside point - next_o(); -} - -void PointsInSphere::next_o() -{ - do - { - o++; - if (o < hi_o) - { - return; - } - if (hi_o != outside_o) - { - hi_o = outside_o; - o = int( ceil(o0line+oExclHalfSpan) ) - 1; - continue; - } - next_n(); - } - while (!finished()); -} - -void PointsInSphere::next_n() -{ - do - { - n++; - if (n < hi_n) - { - o0line = o0plane + (n-n0plane)*do0dn; - double RlineSquare = RplaneSquare - pow((n-n0plane)/b2r,2); - oHalfSpan = RlineSquare > 0.0 ? sqrt(RlineSquare)*c1r : 0.0; - // parentheses improve round-off errors around [0,0,0] - double RExclSquare = RminSquare + (RlineSquare - RmaxSquare); - oExclHalfSpan = RExclSquare > 0.0 ? sqrt(RExclSquare)*c1r : 0.0; - o = int(floor(o0line - oHalfSpan)); - outside_o = int(ceil(o0line + oHalfSpan)); - hi_o = outside_o; - if (oExclHalfSpan) - { - int hole_o = int(ceil(o0line - oExclHalfSpan)); - if (fabs(hole_o-o0line) < oExclHalfSpan) hi_o = hole_o; - } - return; - } - next_m(); - } - while (!finished()); -} - -void PointsInSphere::next_m() -{ - m++; - if (finished()) - { - return; - } - // not finished here - n0plane = m*dn0dm; - o0plane = m*do0dm; - RplaneSquare = RmaxSquare - pow(m/latpar.ar,2); - nHalfSpan = RplaneSquare > 0.0 ? sqrt(RplaneSquare)*b2r : 0.0; - n = int(floor(n0plane - nHalfSpan)); - hi_n = int(ceil(n0plane + nHalfSpan)); -} - -double PointsInSphere::r() const -{ - const double &a = latpar.a, &b = latpar.b, &c = latpar.c; - const double &ca = latpar.ca, &cb = latpar.cb, &cg = latpar.cg; - return sqrt( m*m*a*a + n*n*b*b + o*o*c*c - + 2*m*n*a*b*cg + 2*m*o*a*c*cb + 2*n*o*b*c*ca ); -} - - -//////////////////////////////////////////////////////////////////////// -// ReflectionsInQminQmax -//////////////////////////////////////////////////////////////////////// - -ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, - const LatticeParameters& _latpar ) : - Qmin(_Qmin), Qmax(_Qmax), - latpar(_latpar), - sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), - hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) -{ } - -ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - Qmin(_Qmin), Qmax(_Qmax), - latpar(_a, _b, _c, _alpha, _beta, _gamma), - sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), - hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) -{ } - - -//////////////////////////////////////////////////////////////////////// -// ReflectionsInDmaxDmin -//////////////////////////////////////////////////////////////////////// - -ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - const LatticeParameters& _latpar ) : - ReflectionsInQminQmax(2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, _latpar), - Dmax(_Dmax), Dmin(_Dmin) -{ } - -ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - ReflectionsInQminQmax( 2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, - _a, _b, _c, _alpha, _beta, _gamma ), - Dmax(_Dmax), Dmin(_Dmin) -{ } - -// End of file diff --git a/libpdffit2/PointsInSphere.h b/libpdffit2/PointsInSphere.h deleted file mode 100644 index 2c3b5d45..00000000 --- a/libpdffit2/PointsInSphere.h +++ /dev/null @@ -1,182 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin -* -* Constructors: -* -* PointsInSphere(Rmin, Rmax, a, b, c, alpha, beta, gamma) -* ReflectionsInQminQmax(Qmin, Qmax, a, b, c, alpha, beta, gamma) -* ReflectionsInDmaxDmin(Dmax, Dmin, a, b, c, alpha, beta, gamma) -* -* Examples: -* -* PointsInSphere sph(Rmin, Rmax, a, b, c, alpha, beta, gamma) -* for (sph.rewind(); !sph.finished(); sph.next()) -* { -* // lattice indices are in sph.m, sph.n, sph.o or sph.mno[3] -* // sph.r() is distance from origin, -* // where Rmin < sph.r() < Rmax -* } -* -* ReflectionsInQminQmax refl(Qmin, Qmax, a, b, c, alpha, beta, gamma) -* for (ReflectionsInQminQmax ref(Qmin, Qmax, a, b, c, alpha, beta, gamma); -* !ref.finished(); ref.next() ) -* { -* // Miller indices are in ref.h, ref.k, ref.l or ref.hkl[3] -* // ref.Q() is magnitude of Q vector -* // ref.d() is lattice plane spacing -* } -* -* Tip: add epsilon to Rmax to avoid roundoff issues -* -***********************************************************************/ - -#ifndef POINTSINSPHERE_H_INCLUDED -#define POINTSINSPHERE_H_INCLUDED - -#include - - -namespace NS_POINTSINSPHERE { - -class LatticeParameters -{ -public: - LatticeParameters( double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - // calculate all properties from current lattice parameters - LatticeParameters& update(); - // return a reciprocal of this lattice - LatticeParameters reciprocal() const; - // input arguments - double a, b, c, alpha, beta, gamma; - // cosines and sines of direct lattice angles - double ca, cb, cg, sa, sb, sg; - // reciprocal lattice and its cosines and sines - double ar, br, cr, alphar, betar, gammar; - double car, cbr, cgr, sar, sbr, sgr; -private: - // helper functions - inline double cosd(double x) { return cos(M_PI/180.0*x); } - inline double sind(double x) { return sin(M_PI/180.0*x); } -}; - -class PointsInSphere -{ -public: - PointsInSphere( double _Rmin, double _Rmax, - const LatticeParameters& _latpar ); - PointsInSphere( double _Rmin, double _Rmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - void rewind(); - inline void next() - { - next_o(); - } - inline bool finished() - { - return !(m < hi_m); - } - // mno array and m, n, o aliases are supposed to be read only - int mno[3]; - int &m, &n, &o; - double r() const; - // input arguments - const double Rmin, Rmax; - const LatticeParameters latpar; -private: - // loop advance functions - void next_m(); - void next_n(); - void next_o(); - void init(); - // calculated constants set by init() - double RminSquare, RmaxSquare; - // 2D reciprocal parameters and cosine in bc plane - double b2r, c2r, ca2r; - // reciprocal c - double c1r; - // offset of the nearest point to [0,0,0] - double dn0dm, do0dm, do0dn; - // loop variables - double n0plane, o0plane, o0line; - double mHalfSpan, nHalfSpan, oHalfSpan; - // o indices excluded due to Rmin - double oExclHalfSpan; - int hi_m, hi_n, hi_o, outside_o; - double RplaneSquare; -}; - -class ReflectionsInQminQmax -{ -public: - ReflectionsInQminQmax( double _Qmin, double _Qmax, - const LatticeParameters& _latpar ); - ReflectionsInQminQmax( double _Qmin, double _Qmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - inline void rewind() - { - sph.rewind(); - } - inline void next() - { - sph.next(); - } - inline bool finished() - { - return sph.finished(); - } - // input arguments - const double Qmin, Qmax; - const LatticeParameters latpar; -private: - // sph must be initialized before hkl and h, k, l - PointsInSphere sph; -public: - // hkl array and h, k, l aliases are supposed to be read only - int *hkl; - int &h, &k, &l; - inline double Q() const - { - return 2.0*M_PI*sph.r(); - } - inline double d() const - { - return 1.0/sph.r(); - } -}; - -class ReflectionsInDmaxDmin : ReflectionsInQminQmax -{ -public: - ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - const LatticeParameters& _latpar ); - ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - // input arguments - const double Dmax, Dmin; -}; - - -} // namespace NS_POINTSINSPHERE - -using NS_POINTSINSPHERE::PointsInSphere; -using NS_POINTSINSPHERE::ReflectionsInQminQmax; -using NS_POINTSINSPHERE::ReflectionsInDmaxDmin; - -#endif // POINTSINSPHERE_H_INCLUDED diff --git a/libpdffit2/ShapeFactors.h b/libpdffit2/ShapeFactors.h deleted file mode 100644 index 031efe66..00000000 --- a/libpdffit2/ShapeFactors.h +++ /dev/null @@ -1,43 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PDF corrections due to particle shape. -* -* Comments: -* PDF correction for spherical particles obtained from -* R.C. Howell et al, Phys. Rev. B 73, 094107 (2006) -* http://link.aps.org/abstract/PRB/v73/e094107 -* -***********************************************************************/ - -#ifndef SHAPEFACTORS_H_INCLUDED -#define SHAPEFACTORS_H_INCLUDED - -#include - -// envelope function for spherical nanoparticle with diameter d -inline double sphereEnvelope(double r, double d) -{ - double rdratio = r/d; - return (rdratio < 1.0) ? (1.0 - 1.5*rdratio + 0.5*pow(rdratio, 3)) : 0.0; -} - -// derivative of sphereEnvelope by diameter d -inline double dsphereEnvelope(double r, double d) -{ - double rdratio = r/d; - return (rdratio < 1.0) ? (1.5*rdratio/d - 1.5*pow(rdratio, 3)/d) : 0.0; -} - -#endif // SHAPEFACTORS_H_INCLUDED diff --git a/libpdffit2/StringUtils.cc b/libpdffit2/StringUtils.cc deleted file mode 100644 index 73fc04da..00000000 --- a/libpdffit2/StringUtils.cc +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities for string formatting. -* -***********************************************************************/ - -#include -#include - -#include "StringUtils.h" -#include "MathUtils.h" - -using namespace std; - -// return an uppercase copy of string s -string toupper(string s) -{ - for (string::iterator ii = s.begin(); ii != s.end(); ++ii) - { - *ii = toupper(*ii); - } - return s; -} - -// class FormatValueWithStd -string FormatValueWithStd::operator() (double x, double dx) -{ - ostringstream out(f_leading_blank ? " " : "", ios_base::app); - out << x << setprecision(f_std_precision); - // do not write dx when it is too small - if (dx > fabs(x)*1e-8) out << " (" << dx << ')'; - else if (std::isnan(dx)) out << " (NaN)"; - // left-pad string to the width - string rv = out.str(); - int rvlen = rv.size(); - // pad or prepend blanks as necessary - if (rvlen < f_width) - { - size_t nblanks = f_width - rvlen; - if (f_left) rv.append(nblanks, ' '); - else rv.insert(0, nblanks, ' '); - } - return rv; -} - -// End of file diff --git a/libpdffit2/StringUtils.h b/libpdffit2/StringUtils.h deleted file mode 100644 index edb74a96..00000000 --- a/libpdffit2/StringUtils.h +++ /dev/null @@ -1,71 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities for string formatting. -* -***********************************************************************/ - -#ifndef STRINGUTILS_H_INCLUDED -#define STRINGUTILS_H_INCLUDED - -#include - -std::string toupper(std::string s); - -class FormatValueWithStd -{ - private: - - // Data members - int f_width; - bool f_left; - bool f_leading_blank; - int f_std_precision; - - public: - - // Constructor: - FormatValueWithStd() - { - f_width = 0; - f_left = false; - f_leading_blank = false; - f_std_precision = 2; - } - - // Methods: - std::string operator() (double x, double dx); - inline FormatValueWithStd& width(int w) - { - f_width = w; - return *this; - } - inline FormatValueWithStd& left() - { - f_left = true; - return *this; - } - inline FormatValueWithStd& right() - { - f_left = false; - return *this; - } - inline FormatValueWithStd& leading_blank(bool flag) - { - f_leading_blank = flag; - return *this; - } -}; - -#endif // STRINGUTILS_H_INCLUDED diff --git a/libpdffit2/exceptions.h b/libpdffit2/exceptions.h deleted file mode 100644 index 738ce1a6..00000000 --- a/libpdffit2/exceptions.h +++ /dev/null @@ -1,95 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions used in pdffit2. -* -* Comments: -* -***********************************************************************/ - -#ifndef EXCEPTIONS_H_INCLUDED -#define EXCEPTIONS_H_INCLUDED - -#include -#include - -class Exception -{ - private: - std::string msg; - public: - Exception(std::string _msg) : msg(_msg) {} - std::string GetMsg() - { - return msg; - } -}; - -//specific exceptions - mimic python names -class ValueError : public Exception -{ - public: - ValueError(std::string _msg) : Exception(_msg) {} -}; - -class unassignedError : public Exception -{ - public: - unassignedError(std::string _msg) : Exception(_msg) {} -}; - -class IOError : public Exception -{ - public: - IOError(std::string _msg) : Exception(_msg) {} -}; - -class dataError : public Exception -{ - public: - dataError(std::string _msg) : Exception(_msg) {} -}; - -class structureError : public Exception -{ - public: - structureError(std::string _msg) : Exception(_msg) {} -}; - -class constraintError : public Exception -{ - public: - constraintError(std::string _msg) : Exception(_msg) {} -}; - -class calculationError : public Exception -{ - public: - calculationError(std::string _msg) : Exception(_msg) {} -}; - -class parseError : public Exception -{ - public: - parseError(std::string _msg) : Exception(_msg) {} -}; - -//This one is used internally, and should not make it to the python layer. -class vgetException : public Exception -{ - public: - vgetException(std::string _msg) : Exception(_msg) {} -}; - -#endif // EXCEPTIONS_H_INCLUDED diff --git a/libpdffit2/fit.cc b/libpdffit2/fit.cc deleted file mode 100644 index 4426aa29..00000000 --- a/libpdffit2/fit.cc +++ /dev/null @@ -1,836 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Mixed definitions of several DataSet, Fit and PdfFit methods -* -* Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "ShapeFactors.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -/************************* - Main fit routine -**************************/ -// Command called in Fortran -// Now called - -int PdfFit::refine(bool deriv, double toler) { - int finished = 0; - while( !finished ) - { - finished = refine_step(deriv, toler); - } - return 1; -} - - -// CLF Wed May 25 2005 -// Added one-step refinement so that the progress can be checked after each -// refinement step. Many parameters made into public data members of Fit. This -// function is for use in higher level refinement routines. -int PdfFit::refine_step(bool deriv, double toler) -{ - static bool fit_running = false; - const int NSTAG = 3, MINITER = 3, MAXITER = 100; - - fit_running = fit_running && (fit.iter != 0); - // If fit_running flag is down, this is the first iteration. - // If so, then set up the fit. - if(!fit_running) - { - fit.iter = 0; - fit.alambda = -1; - fit.stagnating = 0; - fit.chisq = double_max; - fit_running = true; - - *pout << - "*******************\n" << - "Starting refinement\n" << - "*******************\n"; - - for (int is=0; isiset << " Phase: "; - for (unsigned int ip=0; ippsel.size(); ip++) - if (datasets[is]->psel[ip]) *pout << phase[ip]->iphase << " "; - *pout << endl; - - } - - fit_setup(); - } - - - //------ Here starts the fitting - - // setting the offset for all refinable variables - - if( (fit.iter order = this->order_by_id(); - vector::iterator i; - int j; - for (i = order.begin(), j = 0; i != order.end(); ++i) - { - if (ip[*i]) - { - *pout << setw(4) << id[*i] << ": " << setw(9) << fixed << p[*i]; - j++; - if (j % 4) *pout << " "; - else *pout << endl; - } - } - if (j % 4) *pout << endl; - *pout << endl; - (*pout).unsetf(ios_base::fixed); -} - -/********************************************************** - Setting the offset for all refinable variables -**********************************************************/ -void PdfFit::fit_setup() -{ - // initialize the array with the addresses of refinable variable - // and initialize the offset pointers to be used in derivative routines - // also makes a vector containing the address of the error of each - // refinable variable - //int ip, ia, is, j; - int j; - - // First we make an initial fill of all constrained equations - // to detect missing parameters but mainly to detect the fixed constraints, - // i.e. constraints without parameters or with only fixed parameters - - fit.fill_variables(); - - // for each refinable variable detect the corresponding constraint - - fit.refvar.clear(); - fit.sdptr.clear(); - - for (int ip=0; ipphase[ip]; - - phase.offset = fit.refvar.size(); - - for (j=0;j<3;j++) - { - fit.refvar.push_back(fit.vfind(phase.a0[j])); - fit.sdptr.push_back(&phase.da0[j]); - } - for (j=0;j<3;j++) - { - fit.refvar.push_back(fit.vfind(phase.win[j])); - fit.sdptr.push_back(&phase.dwin[j]); - - } - fit.refvar.push_back(fit.vfind(phase.delta2)); - fit.sdptr.push_back(&phase.ddelta2); - - fit.refvar.push_back(fit.vfind(phase.delta1)); - fit.sdptr.push_back(&phase.ddelta1); - - fit.refvar.push_back(fit.vfind(phase.pscale)); - fit.sdptr.push_back(&phase.dpscale); - - fit.refvar.push_back(fit.vfind(phase.spdiameter)); - fit.sdptr.push_back(&phase.dspdiameter); - - fit.refvar.push_back(fit.vfind(phase.sratio)); - fit.sdptr.push_back(&phase.dsratio); - - for (int ia=0; iadatasets[is]; - - ds.offset = fit.refvar.size(); - - fit.refvar.push_back(fit.vfind(ds.dscale)); - fit.sdptr.push_back(&ds.ddscale); - - fit.refvar.push_back(fit.vfind(ds.qdamp)); - fit.sdptr.push_back(&ds.dqdamp); - - fit.refvar.push_back(fit.vfind(ds.qbroad)); - fit.sdptr.push_back(&ds.dqbroad); - } - - // maximum number of refinable variables - int maxvar = fit.refvar.size(); - - // fill the vector pointing from available refinable variables to - // actual constrained variables - - if (maxvar != getnpar() ) - { - throw constraintError("Parameter set but not constrained."); - } - - fit.ndof = 0; - - for (int i=0; idatasets.empty()) - { - throw unassignedError("Space for calculation must be alloc'ed first"); - } - fit_theory(false, true); - *pout << "\n================================== DONE =================================\n"; - return; -} - -/*********************************************************** - Here we calculate PDF and derivatives during LS fit - (previously known as fit_theory) -************************************************************/ -void PdfFit::fit_theory(bool ldiff, bool lout) -{ - int is, ip, ia, i; - - -// ------ First we compute all constrained equations and the PDF - - fit.fill_variables(); - - // reposition atoms in the elementary unit cells - // Check if this is the correct wayto do things - for (ip=0; ipnatoms; ia++) - { - for(i=0; i<3; i++) - { - phase[ip]->atom[ia].pos[i] = fmod(phase[ip]->atom[ia].pos[i], phase[ip]->icc[i]); - } - } - } - - for (ip=0; iplattice(); - - // determine pdf for each dataset - fit.ntot = 0; - fit.wnorm = 0.0; - - for (is=0; isdatasets[is]; - - ds.determine(ldiff, lout, fit); - - // compute variables for reduced chi-squared and Rw - fit.ntot += ds.nfmax - ds.nfmin + 1; - fit.wnorm += ds.weighedSquareObs(); - } -} - - -double PdfFit::totalWeighedSquareObs() const -{ - return fit.wnorm; -} - - -int PdfFit::totalReducedObservations() const -{ - return fit.ntot - fit.ndof; -} - - -/*********************************************************************** - This routine sets up the matrix A with the derivatives d(PDF)/dx -************************************************************************/ - -void DataSet::fit_setup_derivatives(Fit &fit) -{ - int i, j, ia, ipar, offset; - unsigned int ip; - double fac, facs, facp, ddrho; - double r, bk; - fac = facs = facp = ddrho = r = bk = 0; - - DataSet& ds = *this; - - //------ Loop over all data points - - for (i = ds.ncmin; i <= ds.ncmax; i++) - { - // --- Some common variables - - r = i*ds.deltar + ds.rmin; - - // background envelope due to Q resolution - bk = (ds.qdamp > 0.0) ? exp(-sqr(r*ds.qdamp)/2.0) : 1.0; - - - //------ ---------------------------------------------------------------- - //------ Derivatives per atom : x,y,z,u,o - //------ ---------------------------------------------------------------- - - for (ip=0; ip 0.0 && r > phase.stepcut) - { - shape_env = 0.0; - } - - facp = phase.pscale * shape_env * ds.dscale * bk; - facs = 1.0 / (phase.np*r); - fac = facs*facp; - - for (ia=0; ia, so every contribution to - // the pdf contributes to the derivatives - ds.fit_a[i][ipar] += phase.pscale * ds.dscale * - (1.0 - 2.0 * atom.weight) / phase.np * - (calc[i][ip] + - 4.0*M_PI * r * phase.rho0 * phase.dnorm * bk * shape_env); - } - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per phase : lat, delta2, pscale, spdiameter, sratio - //------ ---------------------------------------------------------------- - - // ----- ----- d/d(lat[j] for j=1,2,3) - - offset = phase.offset; - - for (j=0;j<3;j++) - { - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0/phase.a0[j]); - } - - // ----- ----- d/d(lat[4]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sina*(phase.cosa - phase.cosb*phase.cosg); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(lat[5]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sinb*(phase.cosb - phase.cosa*phase.cosg); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(lat[6]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sing*(phase.cosg - phase.cosa*phase.cosb); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(delta2[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - - // ----- ----- d/d(delta1[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - //----- ----- d/d(pscale[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = ds.calc[i][ip] * ds.dscale; - - // ----- --- d/d(spdiameter) - if ( (ipar=fit.refvar[offset++]) != -1) - { - ds.fit_a[i][ipar] = (phase.spdiameter <= 0.0) ? 0.0 : - ds.calc[i][ip] * ds.dscale * phase.pscale * - dsphereEnvelope(r, phase.spdiameter) / - ((shape_env > 0.0) ? shape_env : 1.0); - } - - // ----- ----- d/d(sratio[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per dataset : dscale, qdamp, qbroad - //------ ---------------------------------------------------------------- - - offset = ds.offset; - - // ----- --- d/d(dscale[is]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = ds.pdftot[i] / ds.dscale; - - // ----- --- d/d(qdamp[is]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - if (ds.qdamp > 0.0) - ds.fit_a[i][ipar] = -r*r * ds.qdamp * ds.pdftot[i]; - else - ds.fit_a[i][ipar] = 0; - } - - // ----- --- d/d(qbroad[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - } - -//------ Finally we need to apply Qmax cutoff on the derivatives - - if (ds.qmax > 0.0) - { - int nclen = ds.ncmax + 1 - ds.ncmin; - // matrix column is not a continuous data block, a copy is required - valarray col_ip_array(nclen); - double* col_ip = &(col_ip_array[0]); - for(ip=0; ip::iterator apos; - apos = find(var.begin(), var.end(), &a); - if (apos == var.end()) return -1; - // variable is found here, now check if it is refinable - int idx = apos - var.begin(); - return vref[idx] ? idx : -1; -} - - -void Fit::constrain(double &a, string inpform, fcon f, int ipar, FCON type) -{ - int ivar; - if ( (ivar=vfind(a)) != -1) - { - form[ivar] = inpform; - fconstraint[ivar] = f; - idef[ivar] = ipar; - ctype[ivar] = type; - vref[ivar] = true; - *pout << "Warning: replacing existing constraint\n\n"; - } - else - { - var.push_back(&a); - form.push_back(inpform); - fconstraint.push_back(f); - idef.push_back(ipar); - ctype.push_back(type); - vref.push_back(true); - } -} - - -void Fit::constrain(double &a, string inpform) -{ - constrain(a, inpform, NULL, -1, USER); -} - -void Fit::constrain(double &a, fcon f ) -{ - constrain(a, string(), f, -1, USER); -} - -// if a # is passed instead of a function, then the default function will be used -// which is just var = p[ipar] -void Fit::constrain(double &a, int ipar) -{ - constrain(a, ipar, IDENT); -} - -// if a # and the FCOMP-type are passed instead of a function, then the -// complement function will be used: -// which is just var = 1-p[ipar] -void Fit::constrain(double &a, int ipar, FCON type) -{ - if ( (type == IDENT) || (type == FCOMP) || (type == FSQR) ) - constrain(a, string(), NULL, ipar, type); - else - throw constraintError("Unknown constraint"); -} - -void Fit::fill_variables() -{ - dvdp.resize(var.size(),p.size()); - - for (unsigned int i=0; i dnumdp; - - *var[i] = parse(form[i],dnumdp); - - // store numerical derivatives - for(unsigned int iu=0; iuip[ip]; - - // calculate derivative wrt to p[ip] if parameter is free - if (this->ip[ip]) - { - dvdp[i][ip] = dnumdp[iu]; - } - } - } - else if (f) - { - //try - //{ - vector dvdp_i(dvdp.rowVector(i)); - *var[i] = f(p, dvdp_i); - copy(dvdp_i.begin(), dvdp_i.end(), dvdp[i]); - for(int ipar=0; iparip[ipar]); - } - } - else - { - int ipar = parfind(idef[i]); - - if (ipar == -1) - { - ostringstream msg; - msg << "parameter " << idef[i] << " undefined"; - throw constraintError( msg.str() ); - } - - // constraint is fixed if parameter ipar is fixed - vref[i] = this->ip[ipar]; - - if (ctype[i] == IDENT) - { - *var[i] = p[ipar]; - dvdp[i][ipar] = 1.0; - } - else if (ctype[i] == FCOMP) - { - *var[i] = 1.0 - p[ipar]; - dvdp[i][ipar] = -1.0; - } - else if (ctype[i] == FSQR) - { - *var[i] = sqr(p[ipar]); - dvdp[i][ipar] = 2.0*p[ipar]; - } - } - } -} - -int Fit::parfind(unsigned int pidx) -{ - // find the position of pidx in parameter indices vector id - // return -1 if not found - vector::iterator pos; - pos = find(id.begin(), id.end(), pidx); - if (pos == id.end()) - { - return -1; - } - return int(pos - id.begin()); -} - -void Fit::setpar(unsigned int pidx, double val) -{ - int ipar = parfind(pidx); - if (ipar != -1) - { - p[ipar] = val; - } - else - { - p.push_back(val); - ip.push_back(1); // select refinement "ON" when par gets defined - id.push_back(pidx); // store the parameter identifier - } -} - -double Fit::getpar(unsigned int pidx) -{ - int ipar = parfind(pidx); - if (ipar < 0) - { - ostringstream msg; - msg << "Parameter " << pidx << " does not exist"; - throw unassignedError( msg.str() ); - } - return p[ipar]; -} - -void Fit::fixpar(int pidx) -{ - if (pidx == ALL) - { - fill(ip.begin(), ip.end(), false); - return; - } - int ipar = parfind(pidx); - if (ipar == -1) - { - ostringstream emsg; - emsg << "Parameter " << pidx << " not defined."; - throw unassignedError(emsg.str()); - } - ip[ipar] = false; -} - -void Fit::freepar(int pidx) -{ - if (pidx == ALL) - { - fill(ip.begin(), ip.end(), true); - return; - } - int ipar = parfind(pidx); - if (ipar == -1) - { - ostringstream emsg; - emsg << "Parameter " << pidx << " not defined."; - throw unassignedError(emsg.str()); - } - ip[ipar] = true; -} - -/************************************************************************** - This routine calculates errors dx from dp ... - - The covariance of the constrained variables is given by the left and right - matrix multiplication of the dvdp matrix with the covariance matrix - (based on a Taylor expansion of each constraint around the mean parameter values). - The old Fortran program had a sqrt(sum of squares) as error. This - does not take into account parameter correlations, and implicitly considers - the parameters uncorrelated, which is an under-estimation of the parameters. -****************************************************************************/ -void PdfFit::fit_errors() -{ - int ip; - matrix dvdpt = fit.dvdp.transposed(); - - // compute the errors on the parameters as sqrt of diagonal elements of - // covariance matrix - fit.dp = fit.covar.sd(); - - // compute errors on refined variables: left and right matrix multiplication - // of covariance matrix with dvdp - fit.vcovar = fit.dvdp * fit.covar * dvdpt; - - fit.dvar = fit.vcovar.sd(); - - //for(int i=0;ilattice(); -} - -/*********************************************************************** - This routine converts the errors on the constraints to - errors on the actual pdf-paramters -************************************************************************/ - -void Fit::fill_errors() -{ - // transfers the errors on the constrained variables to the corresponding - // pdf error-variables - - int icon; - - // loop over all refinable variables and transfer the sd on any constrained - // variable into the sd on the refinable variable - for (unsigned int i=0; i= big) - { - big=fabs(a[j][k]); - irow=j; - icol=k; - } - } - } - } - } - ++(ipiv[icol]); - /*We now have the pivot element, so we interchange rows, if needed, to put the pivot - element on the diagonal. The columns are not physically interchanged, only relabeled: - indxc[i], the column of the ith pivot element, is the ith column that is reduced, while - indxr[i] is the row in which that pivot element was originally located. If indxr[i] - != indxc[i] there is an implied column interchange. With this form of bookkeeping, the - solution b's will end up in the correct order, and the inverse matrix will be scrambled - by columns.*/ - if (irow != icol) { - for (l=1;l<=n;l++) swap(a[irow][l],a[icol][l]); - for (l=1;l<=m;l++) swap(b[irow][l],b[icol][l]); - } - indxr[i]=irow; // We are now ready to divide the pivot row by the - // pivot element, located at irow and icol. - indxc[i]=icol; - - // Indices of a start at 1, make sure we don't reference invalid - // index of a. When icol is 0, all checked elements of the matrix - // a were zero and it is probably singular as well. - if (icol == 0 || a[icol][icol] == 0.0) - { - throw calculationError("Singular matrix during minimization"); - } - pivinv=1.0/a[icol][icol]; - a[icol][icol]=1.0; - for (l=1;l<=n;l++) a[icol][l] *= pivinv; - for (l=1;l<=m;l++) b[icol][l] *= pivinv; - for (ll=1;ll<=n;ll++) // Next, we reduce the rows... - if (ll != icol) { // ...except for the pivot one, of course. - dum=a[ll][icol]; - a[ll][icol]=0.0; - for (l=1;l<=n;l++) a[ll][l] -= a[icol][l]*dum; - for (l=1;l<=m;l++) b[ll][l] -= b[icol][l]*dum; - } - } - /*This is the end of the main loop over columns of the reduction. It only remains to unscram- - ble the solution in view of the column interchanges. We do this by interchanging pairs of - columns in the reverse order that the permutation was built up.*/ - for (l=n;l>=1;l--) - { - if (indxr[l] == indxc[l]) continue; - for (k=1;k<=n;k++) swap(a[k][indxr[l]],a[k][indxc[l]]); - } // And we are done. - free_ivector(ipiv,1,n); - free_ivector(indxr,1,n); - free_ivector(indxc,1,n); -} - -// End of file diff --git a/libpdffit2/matrix.h b/libpdffit2/matrix.h deleted file mode 100644 index bc80b8ca..00000000 --- a/libpdffit2/matrix.h +++ /dev/null @@ -1,239 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* template class matrix -* -* Comments: optimized from original vector of vectors -* -***********************************************************************/ - -#ifndef MATRIX_H_INCLUDED -#define MATRIX_H_INCLUDED - -#include -#include -#include - -#include "OutputStreams.h" -using NS_PDFFIT2::pout; - -template class matrix -{ - private: - - // Data Methods - T* mdata; - size_t mrows; - size_t mcols; - size_t msize; - - public: - - // Constructors - matrix() : - mdata(NULL), mrows(0), mcols(0), msize(0) - { } - matrix(const matrix& src) : - mdata(new T[src.mrows*src.mcols]), - mrows(src.mrows), mcols(src.mcols), msize(src.msize) - { - std::copy(src.mdata, src.mdata + src.msize, mdata); - } - matrix(size_t m, size_t n) : - mrows(m), mcols(n), msize(mrows*mcols) - { - mdata = new T[mrows*mcols]; - std::fill(mdata, mdata + msize, T(0)); - } - // Destructor - ~matrix() - { - delete[] mdata; - } - // Methods - matrix& operator=(const matrix& src) - { - if (this == &src) return *this; - delete[] mdata; - mdata = new T[src.msize]; - std::copy(src.mdata, src.mdata + src.msize, mdata); - mrows = src.mrows; - mcols = src.mcols; - msize = src.msize; - return *this; - } - matrix& operator=(T value) - { - std::fill_n(mdata, msize, value); - return *this; - } - void resize(size_t m, size_t n, T value=T(0)) - { - if (m == mrows && n == mcols) return; - T* resized = new T[m*n]; - std::fill(resized, resized + m*n, value); - for ( size_t i = 0, offset = 0; - i != std::min(m, mrows); ++i, offset += n ) - { - for (size_t j = 0; j != std::min(n, mcols); ++j) - { - resized[offset+j] = (*this)(i, j); - } - } - delete[] mdata; - mdata = resized; - mrows = m; - mcols = n; - msize = m*n; - } - void clear() - { - delete[] mdata; - mdata = NULL; - mrows = mcols = msize = 0; - } - std::vector rowVector(size_t i) - { - return std::vector(mdata + mcols*i, mdata + mcols*(i+1)); - } - std::vector colVector(size_t j) - { - std::vector column(mrows); - typename std::vector::iterator vii; - vii = column.begin(); - T* pt = mdata + j; - for (; vii != column.end(); ++vii, pt += mcols) *vii = *pt; - return column; - } - inline size_t getrows() - { - return mrows; - } - inline size_t getcols() - { - return mcols; - } - inline T* operator[](size_t i) - { - return mdata + mcols*i; - } - inline T& operator()(size_t i, size_t j) - { - return *(mdata + i*mcols + j); - } - matrix transposed() - { - matrix mxt(mcols, mrows); - T* pt = mxt.mdata; - for (size_t j = 0; j != mcols; ++j) - { - for (size_t i = 0; i != mrows; ++i, ++pt) - { - *pt = (*this)(i, j); - } - } - return mxt; - } - // returns standard deviation vector from covariance matrix - std::vector sd() - { - std::vector v(mcols); - if (mcols != mrows) - { - const char* emsg = "Matrix not square in "; - throw emsg; - } - typename std::vector::iterator vii; - vii = v.begin(); - for (T* pii = mdata; pii < mdata + msize; pii += mcols + 1, ++vii) - { - *vii = sqrt(*pii); - } - return v; - } - matrix operator*(matrix& B) - { - matrix& A = *this; - matrix C(A.mrows, B.mcols); - if (A.mcols != B.mrows) - { - const char* emsg = "Inconsistent matrix multiplication"; - throw emsg; - } - for (size_t i = 0; i != A.mrows; ++i) - { - for (size_t j = 0; j != B.mcols; ++j) - { - T& Cij = C(i,j); - Cij = 0; - for (size_t k = 0; k != A.mcols; ++k) - { - Cij += A(i,k)*B(k,j); - } - } - } - return C; - } - template - friend std::ostream& operator<<(std::ostream &out, matrix &mx); - void print() - { - using namespace std; - for (size_t i = 0; i != mrows; ++i) - { - *pout << i << ": "; - for (size_t j = 0; j != mcols; ++j) - { - *pout << (*this)(i,j) << " "; - } - *pout << endl; - } - } -}; - -template -std::ostream &operator<<(std::ostream &out, std::vector &v) -{ - using namespace std; - out << "("; - for (size_t i=0; i != v.size(); ++i) - { - out << v[i]; - if (i != (v.size()-1)) out << ", "; - else out << ")\n"; - } - return out; -} - -template -std::ostream& operator<<(std::ostream &out, matrix &mx) -{ - using namespace std; - out << "( "; - for (size_t i = 0; i != mx.mrows; ++i) - { - out << "("; - for (size_t j = 0; j != mx.mcols; ++j) - { - *pout << mx(i,j); - if (j != (mx.mcols-1)) *pout << ", "; - else *pout << ")"; - } - if (i != (mx.mrows-1)) *pout << ", "; - else *pout << " )\n"; - } - return out; -} - -#endif // MATRIX_H_INCLUDED diff --git a/libpdffit2/metric.cc b/libpdffit2/metric.cc deleted file mode 100644 index 5f696495..00000000 --- a/libpdffit2/metric.cc +++ /dev/null @@ -1,341 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Definitions of several Phase methods -* -* Comments: -* -***********************************************************************/ - -#include - -#include "MathUtils.h" -#include "StringUtils.h" -#include "pdffit.h" -using NS_PDFFIT2::pout; - -/********************************************************************* - Calculates lattice constants, metric and reciprocal metric - tensor, permutation tensors and unit cell volume. - It's done quite some old fashioned way, rather than calculating - the direct metric tensor and its inverse. - - This extended version calculates standard deviations as well - **********************************************************************/ -void Phase::lattice() -{ - double abscosa, abscosb, abscosg, arg, darg; - double dcosa, dcosb, dcosg, voll, dvoll; - double cos1, cos2, cosi, sin1, sin2, sini; - double dcos1, dcos2, dcosi, dsin1, dsin2, dsini; - int i, i1, i2, j, k, ncc; - - cosa = cosd(win[0]); - cosb = cosd(win[1]); - cosg = cosd(win[2]); - - sina = sind(win[0]); - sinb = sind(win[1]); - sing = sind(win[2]); - - abscosa = fabs(cosa); - abscosb = fabs(cosb); - abscosg = fabs(cosg); - - dcosa = fabs(sina*rad*dwin[0]); - dcosb = fabs(sinb*rad*dwin[1]); - dcosg = fabs(sing*rad*dwin[2]); - - voll = 1.0 - sqr(cosa) - sqr(cosb) - sqr(cosg) + 2.0*cosa*cosb*cosg; - - if (voll <= double_eps) - { - throw structureError("Unit cell volume is not positive."); - } - v = sqrt(voll)*a0[0]*a0[1]*a0[2]; - - dvoll = 2.0*(abscosa*dcosa + abscosb*dcosb + abscosg*dcosg + - dcosa*abscosb*abscosg + abscosa*dcosb*abscosg + abscosa*abscosb*dcosg); - dv = 0.5/sqrt(voll)*dvoll*a0[0]*a0[1]*a0[2] - + sqrt(voll)*(da0[0]*a0[1]*a0[2] + a0[0]*da0[1]*a0[2] + a0[0]*a0[1]*da0[2]); - - vr = 1.0/v; - dvr = 1.0/(v*v)*dv; - - //------ - calculate direct metric tensor - - tensor(gten,a0,win); - dtensor(a0,win,dgten,da0,dwin); - - //------ - calculate reciprocal lattice constants - - // WHY ARE THERE NO ABSOLUTE VALUES IN THE FOLLOWING FORMULAE FOR THE STANDARD - // DEVIATIONS?? - for (i=0; i<3; i++) // i = 0,1,2 - { - i1 = (i+1) % 3; // i1 = 1,2,0 - i2 = (i+2) % 3; // i2 = 2,0,1 - - cos1 = cosd(win[i1]); - cos2 = cosd(win[i2]); - cosi = cosd(win[i]); - sin1 = sind(win[i1]); - sin2 = sind(win[i2]); - sini = sind(win[i]); - - ar[i] = a0[i1]*a0[i2]*sini/v; - arg = (cos1*cos2-cosi)/(sin1*sin2); - wrez[i] = acosd(arg); - - dcos1 = sin1*rad*dwin[i1]; - dcos2 = sin2*rad*dwin[i2]; - dcosi = sini*rad*dwin[i]; - dsin1 = cos1*rad*dwin[i1]; - dsin2 = cos2*rad*dwin[i2]; - dsini = cosi*rad*dwin[i]; - - dar[i] = ( (da0[i1]*a0[i2] + a0[i1]*da0[i2])*sini + - a0[i1]*a0[i2]*dsini) /v + a0[i1]*a0[i2]*sini/(v*v)*dv; - darg = (dcos1*cos2 + cos1*dcos2 + dcosi)/(sin1*sin2) - + arg/sin1*dsin1 + arg/sin2*dsin2; - dwrez[i] = 1./sqrt(1-arg*arg)*darg/rad; - } - - //------ - calculate reciprocal tensor - - tensor(rten,ar,wrez); - dtensor(ar,wrez,drten,dar,dwrez); - - //------ - calculate permutation tensors - - for (i=0; i<3; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<3; k++) - { - eps(i,j,k) = 0.0; - reps(i,j,k) = 0.0; - deps(i,j,k) = 0.0; - dreps(i,j,k) = 0.0; - } - } - } - - eps(0,1,2) = v; - eps(1,2,0) = v; - eps(2,0,1) = v; - eps(0,2,1) = -v; - eps(2,1,0) = -v; - eps(1,0,2) = -v; - reps(0,1,2) = vr; - reps(1,2,0) = vr; - reps(2,0,1) = vr; - reps(0,2,1) = -vr; - reps(2,1,0) = -vr; - reps(1,0,2) = -vr; - - deps(0,1,2) = dv; - deps(1,2,0) = dv; - deps(2,0,1) = dv; - deps(0,2,1) = -dv; - deps(2,1,0) = -dv; - deps(1,0,2) = -dv; - dreps(0,1,2) = dvr; - dreps(1,2,0) = dvr; - dreps(2,0,1) = dvr; - dreps(0,2,1) = -dvr; - dreps(2,1,0) = -dvr; - dreps(1,0,2) = -dvr; - - //------ - Calculate number density - - np = 0.0; - dnp = 0.0; - - for (i=0; i -#include - -const int getNR_END() -{ - return 1; -} - -static void nrerror(char error_text[]) - /* Numerical Recipes standard error handler */ -{ - fprintf(stderr,"Numerical Recipes run-time error...\n"); - fprintf(stderr,"%s\n",error_text); - fprintf(stderr,"...now exiting to system...\n"); - exit(1); -} - -template T *_vector(long nl, long nh) - /* allocate a vector with subscript range v[nl..nh] */ -{ - T *v = NULL; - if (nl > nh) return v; - v=(T *)malloc((size_t) ((nh-nl+1+getNR_END())*sizeof(T))); - if (!v) nrerror("allocation failure in _vector()"); - return v-nl+getNR_END(); -} - -double *dvector(long nl, long nh) - /* allocate a double vector with subscript range v[nl..nh] */ -{ - return _vector(nl, nh); -} - -int *ivector(long nl, long nh) - /* allocate an int vector with subscript range v[nl..nh] */ -{ - return _vector(nl, nh); -} - -template void _free_vector(T *v, long nl, long nh) - /* free a vector allocated with vector() */ -{ - if (nl > nh) return; - free((T*) (v+nl-getNR_END())); -} - -void free_dvector(double *v, long nl, long nh) - /* free a double vector allocated with vector() */ -{ - _free_vector(v, nl, nh); -} - - -void free_ivector(int *v, long nl, long nh) - /* free an int vector allocated with ivector() */ -{ - _free_vector(v, nl, nh); -} - -template T **_matrix(long nrl, long nrh, long ncl, long nch) - /* allocate a matrix with subscript range m[nrl..nrh][ncl..nch] */ -{ - long i, nrow=nrh-nrl+1,ncol=nch-ncl+1; - T **m = NULL; - if (nrl > nrh || ncl > nch) return m; - - /* allocate pointers to rows */ - m=(T **) malloc((size_t)((nrow+getNR_END())*sizeof(T*))); - if (!m) nrerror("allocation failure 1 in matrix()"); - m += getNR_END(); - m -= nrl; - /* allocate rows and set pointers to them */ - m[nrl]=(T *) malloc((size_t)((nrow*ncol+getNR_END())*sizeof(T))); - if (!m[nrl]) nrerror("allocation failure 2 in matrix()"); - m[nrl] += getNR_END(); - m[nrl] -= ncl; - for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol; - /* return pointer to array of pointers to rows */ - return m; -} - -double **dmatrix(long nrl, long nrh, long ncl, long nch) - /* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */ -{ - return _matrix(nrl, nrh, ncl, nch); -} - -template void _free_matrix(T **m, long nrl, long nrh, long ncl, long nch) - /* free a double matrix allocated by matrix() */ -{ - if (nrl > nrh || ncl > nch) return; - free((T*) (m[nrl]+ncl-getNR_END())); - free((T**) (m+nrl-getNR_END())); -} - -void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch) - /* free a double matrix allocated by matrix() */ -{ - _free_matrix(m, nrl, nrh, ncl, nch); -} - -// End of file diff --git a/libpdffit2/nrutil.h b/libpdffit2/nrutil.h deleted file mode 100644 index ee1bd4cb..00000000 --- a/libpdffit2/nrutil.h +++ /dev/null @@ -1,34 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities from numerical recipies. -* -* Comments: -* -***********************************************************************/ - -#ifndef NRUTIL_H_INCLUDED -#define NRUTIL_H_INCLUDED - -#include - -void nrerror(char error_text[]); -int *ivector(long nl, long nh); -double *dvector(long nl, long nh); -double **dmatrix(long nrl, long nrh, long ncl, long nch); -void free_ivector(int *v, long nl, long nh); -void free_dvector(double *v, long nl, long nh); -void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch); - -#endif // NRUTIL_H_INCLUDED diff --git a/libpdffit2/output.cc b/libpdffit2/output.cc deleted file mode 100644 index 36928794..00000000 --- a/libpdffit2/output.cc +++ /dev/null @@ -1,350 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Output methods for Phase, DataSet and Fit classes -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "pdffit.h" -#include "StringUtils.h" - -/************************************************************ - * Outputs phase information for phase 'ipha' on file 'id' - * Thu Oct 13 2005 - CLF Modified code to handle - * general types of streams. - *************************************************************/ -void Phase::output(ostream &fout) -{ - FormatValueWithStd value_std; - value_std.left(); - - fout << " " << string(78,'-') << '\n' - << " PHASE " << iphase << " : " << name << '\n' - << " " << string(78,'-') << endl; - - fout << " Scale factor : " << - value_std(pscale, dpscale) << endl; - - fout << " Particle diameter : "; - if (spdiameter <= 0.0) fout << "not applied\n"; - else fout << value_std(spdiameter, dspdiameter) << " A\n"; - - fout << " Step cutoff : "; - if (stepcut <= 0.0) fout << "not applied\n"; - else fout << value_std(stepcut, 0.0) << " A\n"; - - if (corr_max > 0.0) - { - fout << " Correlation limit [A] : " << corr_max << endl; - } - - fout << " Quad. corr. factor : " - << value_std(delta2, ddelta2) << endl; - - fout << " Lin. corr. factor : " - << value_std(delta1, ddelta1) << endl; - - fout << " Low r sigma ratio : " << value_std(sratio, dsratio) << '\n' - << " R cutoff [A] : " << value_std(rcut, 0.0) << endl; - - value_std.leading_blank(true).left(); - fout << " Lattice parameters :" - << value_std.width(20)(a0[0], da0[0]) - << value_std.width(20)(a0[1], da0[1]) - << value_std.width(0)(a0[2], da0[2]) << '\n'; - - fout << " & angles :" - << value_std.width(20)(win[0], dwin[0]) - << value_std.width(20)(win[1], dwin[1]) - << value_std.width(0)(win[2], dwin[2]) << '\n'; - - fout << endl; - - fout << " Atom positions & occupancies :" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - fout << " " - << setw(4) << left << toupper(ai->atom_type->symbol) << setw(0); - value_std.width(20); - for (int i = 0; i < 3; i++) - { - fout << value_std(ai->pos[i], ai->dpos[i]); - } - fout << value_std.width(0)(ai->occ,ai->docc) << endl; - } - fout << endl; - - fout << " Anisotropic temperature factors :" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - fout << " " << setw(4) << toupper(ai->atom_type->symbol); - for (int i = 0; i < 3; i++) - { - fout << value_std.width(i == 2 ? 0 : 20)(ai->u[i], ai->du[i]); - } - fout << endl; - if ( ai->u[3] || ai->u[4] || ai->u[5]) - { - fout << " "; - for (int i = 3; i < 6; i++) - { - fout << value_std.width(i == 5 ? 0 : 20)(ai->u[i], ai->du[i]); - } - fout << endl; - } - } -} - -string DataSet::selectedAtomsString(int ip, char ijchar) -{ - if (!psel[ip]) return string(""); - if (ijchar != 'i' && ijchar != 'j') - { - ostringstream emsg; - emsg << "Invalid value of ijchar '" << ijchar << "'"; - throw ValueError(emsg.str()); - } - // build string of selected indices per each atom type - // also check if any type is selected and ignored at the same time - map selidxstr; - set ignored_types; - Phase* ph = psel[ip]; - set& ignored = ijchar == 'i' ? phase_ignore_i[ph] : phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) - { - const AtomType* atp = ph->atom[aidx].atom_type; - if (ignored.count(aidx)) ignored_types.insert(atp); - else - { - ostringstream sidx; - sidx << ' ' << aidx + 1; - selidxstr[atp] += sidx.str(); - } - } - ostringstream ssel; - for ( vector::iterator atp = ph->atom_types.begin(); - atp != ph->atom_types.end(); ++atp ) - { - if (!selidxstr.count(*atp)) continue; - ssel << " " << toupper((*atp)->symbol); - if (ignored_types.count(*atp)) ssel << selidxstr[*atp]; - } - return ssel.str(); -} - -/*********************************************************** - Outputs information about this data set - Thu Oct 13 2005 - CLF - Modified code to handle general types of - streams. -************************************************************/ -void DataSet::output(ostream& fout) -{ - FormatValueWithStd value_std; - - fout << " " << string(78,'-') << '\n' - << " DATA SET : " << iset << " (" << name << ")" << '\n' - << " " << string(78,'-') << endl; - - fout << " Data range in r [A] : " << setw(8) << left << rmin << " -> " - << setw(8) << rmax << " Step dr : " << setw(0) << deltar << endl; - - fout << " Calculated range : " << setw(8) << rcmin << " -> " - << setw(0) << rcmax << endl; - - fout << " Refinement r range : " << setw(8) << rfmin << " -> " - << setw(8) << rfmax - << " Data pts : " << setw(5) << nfmin << " -> " - << setw(0) << nfmax << endl; - - fout << - " Reduced chi squared : " << this->getdsredchisq() << '\n' << - " Rw - value : " << this->getdsrw() << '\n' << endl; - - fout << endl << " Experimental settings :" << endl; - - if (scattering_type == 'X') - fout << " Radiation : X-Rays\n"; - else - fout << " Radiation : Neutrons\n"; - - if (qmax <= 0.0) - fout << " Termination at Qmax : not applied\n"; - else - fout << " Termination at Qmax : " << qmax << " A**-1\n"; - - if (qdamp <= 0.0) - fout << " DQ dampening Qdamp : not applied\n"; - else - fout << " DQ dampening Qdamp : " << value_std(qdamp, dqdamp) << " A**-1\n"; - - if (qbroad <= 0.0) - fout << " DQ broadening Qbroad : not applied\n"; - else - fout << " DQ broadening Qbroad : " << value_std(qbroad, dqbroad) << " A**-1\n"; - - fout << " Scale factor : " << value_std(dscale, ddscale) << endl; - - fout << endl; - - fout << " Selected phases and atoms for this data set :\n"; - - for(size_t ip = 0; ip != psel.size(); ip++) - { - if (!psel[ip]) continue; - fout << " Phase " << ip+1 << " :\n"; - - fout << " Atoms (i) :"; - fout << selectedAtomsString(ip, 'i') << '\n'; - fout << " Atoms (j) :"; - fout << selectedAtomsString(ip, 'j') << '\n'; - } - fout << '\n'; - - fout << " Relative phase content in terms of\n"; - fout << " atoms unit cells mass\n"; - vector< pair > atomfractions; - vector< pair > cellfractions; - vector< pair > massfractions; - atomfractions = getAtomPhaseFractions(); - cellfractions = getCellPhaseFractions(); - massfractions = getMassPhaseFractions(); - for(size_t ip = 0; ip != psel.size(); ip++) - { - fout << " Phase " << ip + 1 << " :"; - value_std.left().width(24).leading_blank(true); - fout << value_std(atomfractions[ip].first, atomfractions[ip].second); - fout << value_std(cellfractions[ip].first, cellfractions[ip].second); - value_std.width(0); - fout << value_std(massfractions[ip].first, massfractions[ip].second); - fout << '\n'; - } - fout << endl; -} - -/************************************************* - Outputs parameter information - Thu Oct 13 2005 - CLF - Modified code to handle general types of - streams. -**************************************************/ -void Fit::output(ostream &fout) -{ - fout << " " << string(78,'-') << '\n' - << " PARAMETER INFORMATION :" << '\n' - << " " << string(78,'-') << endl; - - int npar = 0; - - for (int i=0; i order = this->order_by_id(); - vector::iterator i; - for (i = order.begin(); i != order.end(); ++i) - { - int nword = i - order.begin(); - bool lastword = (nword + 1) % 3 == 0 || nword + 1 == psize(); - double dpi = ip[*i] ? dp[*i] : 0.0; - fout << right << ' ' << setw(3) << id[*i] << setw(0) << ":" - << value_std.width(lastword ? 0 : 20)(p[*i], dpi); - fout << (lastword ? "\n" : " "); - } - - fout << " " << string(78,'-') << '\n' - << " REFINEMENT INFORMATION:\n" - << " " << string(78,'-') << endl; - - fout << " Number of iterations : " << iter << endl; - - fout << " Reduced chi squared : " << redchisq << '\n' - << " Rw - value : " << fit_rw << '\n' << endl; - - fout << " Correlations greater than 0.8 :\n\n"; - - bool lkor = false; - - for (i = order.begin(); i != order.end(); ++i) - { - if (!ip[*i]) continue; - - vector::iterator j; - for (j = i + 1; j != order.end(); ++j) - { - if (!ip[*j]) continue; - - double corr = covar[*i][*j]/dp[*i]/dp[*j]; - - if (fabs(corr) > 0.8) - { - fout << " Corr(p[" << id[*i] << "], p[" << id[*j] << "]) = " << corr << endl; - lkor = true; - } - } - } - if (!lkor) - fout << " *** none ***\n"; - } -} - - -// Parameter indices in the vector id are not ordered by default. -// Return a proper order indices for id. This method is used -// for parameters printout. -vector Fit::order_by_id() const -{ - assert(this->psize() == int(this->id.size())); - typedef pair IdIndex; - vector id_with_idx; - for (size_t i = 0; i < id.size(); ++i) - { - id_with_idx.push_back(IdIndex(id[i], i)); - } - sort(id_with_idx.begin(), id_with_idx.end()); - // build return value - vector rv; - rv.reserve(id_with_idx.size()); - vector::iterator ii; - for (ii = id_with_idx.begin(); ii != id_with_idx.end(); ++ii) - { - rv.push_back(ii->second); - } - return rv; -} - - -// End of file diff --git a/libpdffit2/parser.cc b/libpdffit2/parser.cc deleted file mode 100644 index 46a5157c..00000000 --- a/libpdffit2/parser.cc +++ /dev/null @@ -1,402 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Formula parser implemented as methods of Fit class -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "pdffit.h" - -static vector vstack; -static vector > dstack; // stack with derivative vectors -static bool deriv; - -string stackvar(int i) -{ - ostringstream expr; - expr << '#' << i; - return(expr.str()); -} - -/***************************************************************************************** - Searches for all parameters in the expression and replace them by stack pointers - *****************************************************************************************/ -string Fit::substitute_pars(string &expr) -{ - int ipos=-1, bopen, bclose; - unsigned int i; - string idexpr; - - // search the expression for the next @-sign - while((bopen=expr.find('@',ipos+1)) != (int) string::npos) - { - int id; - - istringstream inexpr(expr); - inexpr.seekg(bopen+1); - - inexpr >> id; - - if (!inexpr) - throw parseError(expr); - - bclose = inexpr.tellg(); - - // expression must be a valid parameter id - int ipar = parfind(id); - - if (ipar == -1) - { - ostringstream msg; - msg << "parameter " << id << " undefined"; - throw constraintError(msg.str()); - } - - // check if same parameter already occurred in this formula - for (i=0; i dnumdp(used.size()); - for (i=0; i()); - } - } - - return expr; // okay -} - -// get next number from expression -// only fill derivatives if that number has derivatives -double Fit::getnum(istringstream &inexpr, vector &dnumdp) -{ - double num; - char c; - int id; - map::iterator iter; - - // Various possibilities when reading the next value inside the - // unbracketted expression - - if (deriv) dnumdp.clear(); - - inexpr >> c; - - if (inexpr.eof()) - throw parseError("Error while reading value"); - - // if first character is a minus sign, call getnum again with expression stripped - // from its minus sign - if ((c=='-') || (c=='+')) - { - num = getnum(inexpr, dnumdp); - if (deriv && !dnumdp.empty() && (c=='-')) - { - for (unsigned int i=0; i check for built-in function - // read-up to next # - else if ((c>='a') && (c<='z')) - { - int start=inexpr.tellg(); - start--; - string::size_type end; - end = inexpr.str().find('#', start); - if (end == string::npos) - { - throw parseError("Error while reading builtin function arguments"); - } - - string sbuiltin = inexpr.str().substr(start,end-start); - if ((iter=builtin.find(sbuiltin)) == builtin.end()) - { - throw parseError("Unknown builtin function"); - } - - // set read pointer behind #-sign - inexpr.seekg(end+1); - - // read argument number - inexpr >> id; - if (!inexpr) - throw parseError(inexpr.str()); - num = iter->second.func(vstack[id]); - - // fill the partial derivatives if function argument had derivatives - if (deriv && !dstack[id].empty()) - { - double fder=iter->second.deriv(vstack[id]); - dnumdp = vector(used.size()); - for(unsigned int i=0; i> id; - if (!inexpr) - throw parseError(inexpr.str()); - num = vstack[id]; - if (deriv && !dstack[id].empty()) dnumdp = dstack[id]; - } - else - { - inexpr.unget(); - inexpr >> num; - - if (!inexpr) - throw parseError("Error while reading value"); - } - return num; -} - -/********************************************** - computes a basic expression without brackets - ***********************************************/ -double Fit::compute(string &expr, vector &dnumdp) -{ - ostringstream ostreamexpr; - string opstring="*/+-"; - double num1, num2, num; - vector dnum1dp, dnum2dp; - char op; // operator - - // transform string to string stream to read numbers more easily - istringstream inexpr(expr); - - // Two parsing passes are performed to ensure correct precedence of - // operators: first for * and /, then for + and - - int pass = 1; - - while(1) - { - int pos, end; - - if (deriv) dnumdp.clear(); - - pos = inexpr.tellg(); - - num1 = getnum(inexpr, dnum1dp); - - inexpr >> op; - - // check if this ends the expression - // if pass==2: expression completely parsed - // if pass==1: go to pass 2 - if (inexpr.eof()) - { - if (pass==2) - { - num = num1; - if (deriv && !dnum1dp.empty()) - dnumdp = dnum1dp; - break; - } - else - { - pass = 2; - inexpr.clear(); - inexpr.str(expr); - continue; - } - } - - if (!inexpr) - throw parseError(expr); - - if (opstring.find(op) == string::npos) - throw parseError(expr); - - // if a + or - operation is encountered in pass 1 -> look for next operation - if ( (pass==1) && ((op == '+') || op == '-') ) - { - continue; - } - - num2 = getnum(inexpr,dnum2dp); - - if (!dnum1dp.empty() || !dnum2dp.empty()) - dnumdp = vector(used.size()); - - switch (op) - { - case '+': - num = num1+num2; - - if (deriv) - { - if (!dnum1dp.empty()) dnumdp = dnum1dp; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum2dp[i]; - } - break; - - case '-': - num = num1-num2; - - if (deriv) - { - if (!dnum1dp.empty()) dnumdp = dnum1dp; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] -= dnum2dp[i]; - } - break; - - case '*': - num = num1*num2; - - if (deriv) - { - if (!dnum1dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum1dp[i]*num2; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += num1*dnum2dp[i]; - } - break; - - case '/': - num = num1/num2; - - if (deriv) - { - if (!dnum1dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum1dp[i]/num2; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] -= num1*dnum2dp[i]/sqr(num2); - } - break; - } - - end = inexpr.tellg(); - - // replace computed substring by stack pointer, and push value on the stack - expr.replace(pos,end-pos,stackvar(vstack.size())); - vstack.push_back(num); - - // store the derivatives as well. Note that the derivative vector may be empty - // if no derivatives was non-zero. - if (deriv) - dstack.push_back(dnumdp); - - inexpr.clear(); - inexpr.str(expr); - inexpr.seekg(pos); - } - - // the expression has been reduced to just one number - return num; -} - -/*************************************************************************************** - Searches the formula for bracketted expressions replace them by their numerical values - ****************************************************************************************/ - -double Fit::parse(string line, vector &dnumdp) -{ - int bopen, bclose; - string expression; - double num; - - if (line.find('#') != string::npos) - throw parseError("Illegal character in formula"); - - // the first elements on the stack will be the used parameter values - vstack.clear(); - used.clear(); - - // Search for parameters, check their existence and put on the stack - line = substitute_pars(line); - - // look for first closing bracket - while( (bclose=line.find(')')) != (int) string::npos) - { - // look for closest opening bracket in front of closing bracket - if ( (bopen=line.rfind('(',bclose-1)) == (int) string::npos) - throw parseError("Unmatched brackets in formula"); - - // isolate expression within the brackets - expression = line.substr(bopen+1,bclose-bopen-1); - - // compute isolated expression - num = compute(expression, dnumdp); - - // put the bracket-value on the stack and replace substring by stack pointer, - // and push new value on the stack - line.replace(bopen,bclose-bopen+1,stackvar(vstack.size())); - vstack.push_back(num); - - if (deriv) - dstack.push_back(dnumdp); - - } - - // After all brackets have been worked out, the final expression is evaluated - num = compute(line, dnumdp); - - return num; // okay -} - -// End of file diff --git a/libpdffit2/pdf.cc b/libpdffit2/pdf.cc deleted file mode 100644 index 0ab857b6..00000000 --- a/libpdffit2/pdf.cc +++ /dev/null @@ -1,1776 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Mixed methods for PDF calculation from PdfFit, DataSet and Phase -* -* Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. -* -***********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "PointsInSphere.h" -#include "StringUtils.h" -#include "LocalPeriodicTable.h" -#include "MathUtils.h" -#include "ShapeFactors.h" - -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -#define NEW_SHARP - -/***************************************************************** - Allocating space for dummy dataset when calculating PDF - without data -******************************************************************/ -void PdfFit::alloc(char tp, double qmax, double qdamp, double rmin, double rmax, int bin) -{ - - DataSet* pds = new DataSet(this); - int i; - if (rmax < rmin || rmin < 0 || rmax < 0) - { - throw ValueError("Check rmin, rmax"); - } - if (bin <= 1) - { - throw ValueError("bin must be > 1"); - } - if( qmax < 0.0 ) - { - throw ValueError("qmax must be >= 0"); - } - if( qdamp < 0 ) - { - throw ValueError("qdamp must be >= 0"); - } - - // 2009-03-11 PJ: Removed check if a structure has been loaded before. - // It can be now loaded after calling alloc. - - pds->iset = nset+1; - - pds->scattering_type = tp; - - pds->qmax = qmax; - pds->qdamp = qdamp; - pds->rmin = pds->rfmin = rmin; - pds->rmax = pds->rfmax = rmax; - pds->bin = bin; - pds->deltar = (rmax-rmin)/double(bin-1); - pds->name = "Dummy set"; - - pds->obs.resize(bin); - pds->wic.resize(bin); - - for (i=0; iobs[i] = 0.0; - pds->wic[i] = 1.0; - } - - *pout << " Allocated PDF data set " << pds->iset << " (r = " - << rmin << " to " << rmax << " A, " << bin << " points) ..." << endl; - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); -} - -// cut-away high Q harmonics using fast Fourier transformation -void DataSet::applyQmaxCutoff(double* y, size_t len) -{ - // pad y with the same number of zeros up to the next power of 2 - size_t padlen = 2*len; - // MS compatibility fix - padlen = (size_t) pow(2.0, ceil(log2(padlen))) ; - // ycpad is complex, so it needs to be twice as long - valarray ycpad_array(2*padlen); - double* ycpad = &(ycpad_array[0]); - fill_n(ycpad, 2*padlen, 0.0); - // copy y to real components of ycpad - for (size_t i = 0; i != len; ++i) ycpad[2*i] = y[i]; - // apply fft - int status; - status = gsl_fft_complex_radix2_forward(ycpad, 1, padlen); - if (status != GSL_SUCCESS) - { - throw calculationError("Fourier Transformation failed."); - } - // Q step for ycpad - double dQ = 2*M_PI/((padlen-1)*deltar); - // loQidx, hiQidx correspond to Qmax and -Qmax frequencies - // they need to be integer to catch cases with huge qmax/dQ - int loQidx = int( ceil(qmax/dQ) ); - int hiQidx = padlen + 1 - loQidx; - // zero high Q components in ycpad - for (int i = loQidx; i < hiQidx; ++i) - { - ycpad[2*i] = ycpad[2*i+1] = 0.0; - } - // transform back - status = gsl_fft_complex_radix2_inverse(ycpad, 1, padlen); - if (status != GSL_SUCCESS) - { - throw calculationError("Fourier Transformation failed."); - } - // copy real components - for (size_t i = 0; i != len; ++i) y[i] = ycpad[2*i]; -} - - -/***************************************************** - Calculate PDF for dataset with current structure - - In initial version: one phase -******************************************************/ - -void DataSet::determine(bool ldiff, bool lout, Fit &fit) -{ - //int kk, ibin, ip; - int ib, ie, ig; - double rmax2, rmin2, gaus, rk, rb,re, rtot, ract; - vector ppp; - double dd[3], d[3], dist2, dist, rg, r; - double sigmap, sigma, gnorm, ampl; - long totcalc=0; - - if (lout) *pout << " Calculating PDF ...\n"; - - // total # points to be fitted - nfmin = nint((rfmin-rmin)/deltar); - nfmax = nint((rfmax-rmin)/deltar); - - // extend calculation range before applying Qmax cutoff - extendCalculationRange(lout); - - rmax2 = sqr(rcmax+1.0); - rmin2 = sqr(rcmin-1.0) * ((rcmin-1.0) < 0.0 ? -1.0 : 1.0); - rmin2 = max(0.01,rmin2); - - pdftot.resize(ncmax+1); - fill(pdftot.begin(), pdftot.end(), 0.0); - calc.resize(ncmax+1,psel.size()); - ppp.resize(ncmax+1); - - if (ldiff) - { - fit_a.resize(ncmax+1, fit.varsize()); - fit_a = 0.0; - } - - // ------ Loop over all phases - - for (unsigned ip=0; ip ignore_i(phase.natoms); - valarray ignore_j(phase.natoms); - for (int aidx = 0; aidx < phase.natoms; ++aidx) - { - ignore_i[aidx] = phase_ignore_i[&phase].count(aidx); - ignore_j[aidx] = phase_ignore_j[&phase].count(aidx); - } - - // ------ Get the ratio total pairs/selected weight in structure - - rtot = 0.0; - ract = 0.0; - for (int iidx = 0; iidx < phase.natoms; ++iidx) - { - Atom& ai = phase.atom[iidx]; - for (int jidx = iidx; jidx < phase.natoms; ++jidx) - { - Atom& aj = phase.atom[jidx]; - double halfloopscale = (iidx == jidx) ? 1.0 : 2.0; - rtot += halfloopscale * ai.weight * aj.weight; - // skip ignored pair - bool skip = (ignore_i[iidx] || ignore_j[jidx]) && - (ignore_i[jidx] || ignore_j[iidx]); - if (skip) continue; - ract += halfloopscale * ai.weight * aj.weight; - } - } - phase.dnorm = ract/rtot; - - //-------------------------------------------------------------- - - fill(ppp.begin() + ncmin, ppp.begin() + ncmax + 1, 0.0); - - // calculate range for PointsInSphere sequencer - // (negative rsphmin is no problem) - double buffzone = phase.circum_diameter(); - double rsphmin = sqrt(rmin2) - buffzone; - double rsphmax = sqrt(rmax2) + buffzone; - // limit rsphmax, when stepcut has been set for the phase - if (phase.stepcut > 0.0) - { - rsphmax = min(rsphmax, phase.stepcut + buffzone); - } - PointsInSphere sph( rsphmin, rsphmax, phase.a0[0]*phase.icc[0], - phase.a0[1]*phase.icc[1], phase.a0[2]*phase.icc[2], - phase.win[0], phase.win[1], phase.win[2] ); - - // loop only over selected atom indexes - for (int iidx = 0; iidx < phase.natoms; ++iidx) - { - Atom& ai = phase.atom[iidx]; - for (int jidx = iidx; jidx < phase.natoms; ++jidx) - { - Atom& aj = phase.atom[jidx]; - - // skip ignored pair - bool skip = (ignore_i[iidx] || ignore_j[jidx]) && - (ignore_i[jidx] || ignore_j[iidx]); - if (skip) continue; - - for (sph.rewind(); !sph.finished(); sph.next()) - { - for (int i=0; i<3; i++) - { - dd[i] = ai.pos[i] - aj.pos[i] - - sph.mno[i]*phase.icc[i]; - d[i] = dd[i] * phase.a0[i]; - } - dist2 = phase.skalpro(dd,dd); - - // check if pair distance is within dataset r limits - if ((dist2 < rmin2) || (dist2 > rmax2)) continue; - - // dist is distance r_ij - dist = sqrt(dist2); - - //------ Setting up 'thermal' Gaussian - sigmap = sqrt(phase.msdAtoms(ai, aj, dd)); - // neglect unphysical summed square displacements - if (sigmap <= 0.0) continue; - - //- PDF peak width modifications - new 07/2003 - -#if defined(NEW_SHARP) - // Computation of peak sharpening sigma - // sigma = sigmap* sqrt(1 - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) - double corfact; - corfact = 1 - phase.delta2/dist2 - - phase.delta1/dist + sqr(qbroad)*dist2; - - // if sigma negative: set it back to 1e-5 just for this point - // note: derivative will be incorrect in this case - if (corfact <= 0) - { - continue; // neglect contribution - } - else - { - sigma = sigmap * sqrt(corfact); - } -#else - // Computation of peak sharpening sigma - // sigma = sqrt(sqr(sigmap) - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) - double sigma2; - sigma2 = sqr(sigmap) - phase.delta2/dist2 - - phase.delta1/dist + sqr(qbroad)*dist2; - - // if sigma2 negative: set it back to 1e-5 just for this point - // note: derivative will be incorrect in this case - if (sigma2 <= 1e-10) - { - sigma = 1e-5; // neglect contribution - } - else - { - sigma = sqrt(sigma2); - } -#endif - // apply rcut if requested - if (dist < phase.rcut) - { - sigma *= phase.sratio; - } - - // The gaus curve is computed up to distance of 5 sigma - gnorm = 1.0/(sqrt(2.0*M_PI)*sigma); - ampl = ai.occ * ai.weight * aj.occ * aj.weight; - - if (iidx != jidx) ampl += ampl; - - rb = max(rcmin, dist - 5.0*sigma); - re = min(rcmax, dist + 5.0*sigma); - if (phase.stepcut > 0.0) - { - re = min(re, phase.stepcut); - } - - ib = nint((rb-rmin)/deltar); - ie = nint((re-rmin)/deltar); - - for(ig=ib; ig<=ie; ig++) - { - totcalc++; - rk = rmin + ig*deltar; - rg = rk-dist; - gaus = gnorm * exp(-0.5*sqr(rg/sigma)); - ppp[ig] += ampl*gaus; - - // if derivative are needed - if (ldiff) - { - pdf_derivative(phase, ai, aj, rk, - sigma, sigmap, dist, d, ampl, gaus, - fit, fit_a[ig]); - } - } - } - } - } - - //------ - Convert to proper G(r) and add to total PDF - - for (int i = ncmin; i<=ncmax; i++) - { - r = i*deltar + rmin; - - calc[i][ip] = ppp[i]/phase.np/r - 4.0*M_PI*r*phase.rho0*phase.dnorm; - - // Q-resolution envelope - if (qdamp > 0.0) - { - calc[i][ip] *= exp(-sqr(r*qdamp)/2.0); - } - - // PDF envelope for spherical nano particles - if (phase.spdiameter > 0.0) - { - calc[i][ip] *= sphereEnvelope(r, phase.spdiameter); - } - - // Empirical shape step cutoff of the PDF - if (phase.stepcut > 0.0) - { - double stepfactor = (r <= phase.stepcut) ? 1.0 : 0.0; - calc[i][ip] *= stepfactor; - } - - //if ( (r <= phase.corr_max) || (phase.corr_max <= 0.0) ) - pdftot[i] += this->dscale * phase.pscale * calc[i][ip]; - } - } - - // finalize computation of derivatives if required - // this HAS to happen before the multiplication by deltar/pi and before - // the convolution to avoid "double operations" on the derivatives, - // as this will be taken care of in the derivatives. - if (ldiff) - { - fit_setup_derivatives(fit); // computes matrix dpdf/dvar - } - - //for (i=ncmin;i<=ncmax;i++) - // *pout << i << " " << pdftot[i] << endl; - - // From here on we can restrict ourselves to the range [nfmin,nfmax] - // for the outerloop - - // Apply Qmax cutoff - if (qmax > 0.0) - { - applyQmaxCutoff(&pdftot[ncmin], ncmax-ncmin+1); - } -} - -/***************************************************************** - This routine calculates the sums over 'ij' needed for the - derivatives - this is faster than doing the complete loop - in 'pdf_determine' again .. - gaus: gaus[igaus+kk] from -******************************************************************/ -void DataSet::pdf_derivative (Phase &phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl,double gaus, - Fit &fit, double* fit_a_i) -{ - double rd,dg; - rd = dg = 0.0; - double s11,s22,s33,s12,s13,s23; - double drdx, drda, phi, dsdphi, dspdx, dspda; - int ipar, i, ioffset, joffset; - - //------ Some common calculations - - s11 = atomi.u[0] + atomj.u[0]; - s22 = atomi.u[1] + atomj.u[1]; - s33 = atomi.u[2] + atomj.u[2]; - s12 = atomi.u[3] + atomj.u[3]; - s13 = atomi.u[4] + atomj.u[4]; - s23 = atomi.u[5] + atomj.u[5]; - - rd = (rk-dist)/sigma; - - if (dist < phase.rcut) - { - phi = phase.sratio; - dsdphi = sigma/phi; - } - else - { - phi = 1.0; - dsdphi = 0.0; - } - - // derivative of T_ij wrt sigma - double T = ampl*gaus; - double dTds = T/sigma*(rd*rd-1); - double dTdr = (rk-dist)/sqr(sigma)*T; - -#if defined(NEW_SHARP) - // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) - // then s = phi*sqrt(s2) - double dsds2 = sqr(phi*sigmap)/(2.0*sigma); - double dsdsp = sigma/sigmap; - double dsdr = dsds2*(2.0*phase.delta2/cube(dist) - + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); -#else - // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) - // then s = phi*sqrt(s2) - double dsds2 = sqr(phi)/(2.0*sigma); - if (sigma==1e-5) dsds2 = 0; - - double dsdsp = 2.0*sigmap*dsds2; - double dsdr = dsds2*(2.0*phase.delta2/cube(dist) - + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); -#endif - double dspdr = - sigmap/dist; - - - - /*---------------------------------------------------------------- - //------ Derivatives per atom : x,y,z,u,o - //- ------------------------------------------------------------- - - dTdx = dTds.(dsdsp.(dspdr.drdx+dspdx) + dsdr.drdx) + dTdr.drdx - */ - - ioffset = atomi.offset; - joffset = atomj.offset; - - // ----- d/dx[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[0]/dist*(d[0] + phase.cosg*d[1] + phase.cosb*d[2]); - dspdx = phase.a0[0]*(d[0]*s11 + d[1]*s12 + d[2]*s13)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/dy[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[1]/dist*(phase.cosg*d[0] + d[1] + phase.cosa*d[2]); - dspdx = phase.a0[1]*(d[0]*s12 + d[1]*s22 + d[2]*s23)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/dz[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[2]/dist*(phase.cosb*d[0] + phase.cosa*d[1] + d[2]); - dspdx = phase.a0[2]*(d[0]*s13 + d[1]*s23 + d[2]*s33)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/du[j,ip,ia] (j=11,22,33,12,13,23) - - /* - dTdu = dTds.dsdsp.dspdu - */ - - // u[0], u[1], u[2] - - double dspdu = 1/(2.0*sigmap*sqr(dist)); - - double fsimp = dTds*dsdsp*dspdu; - - for (i=0; i<3; i++) - { - dg = fsimp*sqr(d[i]); - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - //*pout << phase.a0[i] << " " << d[i] << " " << ig << " " << i << " " << fit_a_i[ipar] << endl; - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - } - - // u[3] - - dg = 2.0*fsimp*d[0]*d[1]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - // u[4] - - dg = 2.0*fsimp*d[0]*d[2]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - // u[5] - - dg = 2.0*fsimp*d[1]*d[2]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - - // ----- d/d occ[ip,ia], d/d occ[ip,ja] - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += T/atomi.occ; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += T/atomj.occ; - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per phase : lat,delta2,delta1 - //------ ---------------------------------------------------------------- - - // ----- d/d(lattice parameter a) - - ioffset = phase.offset; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (d[0] + phase.cosg*d[1] + phase.cosb*d[2])*d[0]/phase.a0[0]/dist; - dspda = (d[0]*s11 + d[1]*s12 + d[2]*s13)*d[0]/phase.a0[0]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice parameter b) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (phase.cosg*d[0] + d[1] + phase.cosa*d[2])*d[1]/phase.a0[1]/dist; - dspda = (d[0]*s12 + d[1]*s22 + d[2]*s23)*d[1]/phase.a0[1]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice parameter c) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (phase.cosb*d[0] + phase.cosa*d[1] + d[2])*d[2]/phase.a0[2]/dist; - dspda = (d[0]*s13 + d[1]*s23 + d[2]*s33)*d[2]/phase.a0[2]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - - // ----- d/d(lattice angle alpha) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sina*d[1]*d[2]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice angle beta) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sinb*d[0]*d[2]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice angle gamma) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sing*d[0]*d[1]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // Derivatives wrt the peak sharpening parameters - - // ----- d/d(delta2) - - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = -dTds*dsds2/sqr(dist); - fit_a_i[ipar] += dg; - } - - // ----- d/d(delta1) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = -dTds*dsds2/dist; - fit_a_i[ipar] += dg; - } - - // ----- d/d(pscale) - - ioffset++; - - // ----- d/d(spdiameter) - - ioffset++; - - // ----- d/d(sratio) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = dTds*dsdphi; - fit_a_i[ipar] += dg; - } - - - //------ ---------------------------------------------------------------- - //------ Derivatives per data set : dscale, qdamp, qbroad - //------ ---------------------------------------------------------------- - - ioffset = this->offset; - - // ----- d/d(dscale[is]) - - ioffset++; - - // ----- d/d(qdamp[is]) - - ioffset++; - - // ----- d/d(qbroad[ip]) - - if( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = dTds*dsds2*(2.0*qbroad*sqr(dist)); - fit_a_i[ipar] += dg; - } - -} - - -/**************************************************************** -* Calculated average atom mass in this phase -*****************************************************************/ -double Phase::averageAtomicMass() -{ - double mavg = 0.0; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - mavg += ai->occ * ai->atom_type->M; - } - mavg /= np; - return mavg; -} - -/**************************************************************** -* Calculated average scattering factor for given radiation type -*****************************************************************/ -double Phase::averageScatteringFactor(char tp) -{ - double bavg = 0.0; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - bavg += ai->occ * ai->atom_type->sf(tp); - } - bavg /= np; - return bavg; -} - -/**************************************************************** -* Update atom weights for given scattering type -*****************************************************************/ -void Phase::setup_weights(char tp) -{ - // calculate average scattering factor - double bavg = averageScatteringFactor(tp); - // get normalized weight of each atom - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - ai->weight = ai->atom_type->sf(tp) / bavg; - } -} - -/************************************************************************ -* Extend r-range by 6 ripples of sinc before applying Qmax cutoff. -* Contributions from peaks outside should be less than 1.5%. -* -* todo: should also extend by the 5*max(sigma) -************************************************************************/ -void DataSet::extendCalculationRange(bool lout) -{ - const int nripples = 6; - // initialize calculation range to fitting range - rcmin = rfmin; - rcmax = rfmax; - ncmin = nint((rcmin - rmin)/deltar); - ncmax = nint((rcmax - rmin)/deltar); - // check if Qmax cutoff is applied - if (!(0.0 < qmax)) return; - // get extension width - double rext = nripples*2*M_PI/qmax; - // FIXME - it should be possible to have rcmin smaller than rmin, - // but there is too much spaghetti that depends on it. - rcmin = max(rmin, rfmin - rext); - rcmax = rfmax + rext; - ncmin = nint((rcmin - rmin)/deltar); - ncmax = nint((rcmax - rmin)/deltar); - if (lout) - { - *pout << " Extending PDF search distance to " << - rcmin << " -> " << rcmax << " A ...\n"; - } -} - -/************************************************************************ - * Diameter of sphere that can enclose primitive cell. - * This is equal to the longest unit cell diagonal. - ************************************************************************/ -double Phase::circum_diameter() -{ - if (atom.empty()) return 0.0; - // array of all 4 diagonals - const size_t numdiags = 4; - static double ucdiagonals[numdiags][3] = { - {+1.0, +1.0, +1.0}, - {-1.0, +1.0, +1.0}, - {+1.0, -1.0, +1.0}, - {+1.0, +1.0, -1.0} - }; - double maxnorm = -1; - for (size_t idx = 0; idx != numdiags; ++idx) - { - const double* ucd = ucdiagonals[idx]; - double normucd = sqrt(skalpro(ucd, ucd)); - if (normucd > maxnorm) - { - maxnorm = normucd; - } - } - // adjust to round-off errors - const double epsilond = sqrt(numeric_limits().epsilon()); - maxnorm = maxnorm*(1.0+epsilond) + epsilond; - return maxnorm; -} - -/************************************************************************ - * combined mean square displacements of 2 atoms along lattice vector - ************************************************************************/ -double Phase::msdAtoms(const Atom& ai, const Atom& aj, double* vl) -{ - // msd = transpose(gten*vln) * ar[i]*U[i,j]*ar[j] * gten*vln - // normalize vl - double vlnorm = sqrt(skalpro(vl,vl)); - double vln[3] = { vl[0]/vlnorm, vl[1]/vlnorm, vl[2]/vlnorm }; - // combine squared atom displacements - double U[6]; - for (size_t i = 0; i != 6; ++i) - { - U[i] = ai.u[i] + aj.u[i]; - } - // Un = ar[i]*U[i,j]*ar[j] - double Un[6] = { U[0]*ar[0]*ar[0], U[1]*ar[1]*ar[1], U[2]*ar[2]*ar[2], - U[3]*ar[0]*ar[1], U[4]*ar[0]*ar[2], U[5]*ar[1]*ar[2] }; - // rhs = gten*vln - double rhs[3] = { 0.0, 0.0, 0.0 }; - for (size_t i = 0; i != 3; ++i) - { - for (size_t j = 0; j != 3; ++j) - { - rhs[i] += gten[i][j] * vln[j]; - } - } - // msd = transpose(rhs) * Un * rhs - double msd; - msd = Un[0]*rhs[0]*rhs[0] + Un[1]*rhs[1]*rhs[1] + Un[2]*rhs[2]*rhs[2] + - 2*Un[3]*rhs[0]*rhs[1] + 2*Un[4]*rhs[0]*rhs[2] + 2*Un[5]*rhs[1]*rhs[2]; - return msd; -} - -/********************************* ------- - Save fit results - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -*********************************/ -string PdfFit::save_res(string fname) -{ - //check to see if a refinement has even been done. - //after a refinement is finished, fit.iter = -1 - if(fit.iter == 0) - { - throw unassignedError("Refinement must be performed first"); - } - ofstream fout; - stringstream outfilestream; - string outfilestring = ""; - - outfilestream << " " << string(78,'=') << endl - << " PDF REFINEMENT\n" - << " Using PDFFIT version : " << PdfFit::version() << endl - << " " << string(78,'=') << endl; - - for(int ip=0; ipoutput(outfilestream); - - fit.output(outfilestream); - - outfilestream << " " << string(78,'=') << endl; - - if( fname != "" ) - { - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("Cannot create output file"); - } - - *pout << " Saving fit results to file : " << fname << endl; - - fout << outfilestream.str(); - //fout.setf(ios::showpoint); - - fout.close(); - } - - return outfilestream.str(); -} - -/************************************************* - ------- Save PDF, structure or complete result - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -**************************************************/ -string PdfFit::save_pdf(int iset, string fname) -{ - string outfilestring = ""; - - //------ - Save PDF (G(r)) - - if ( (iset < 1) || (iset > nset) ) - { - throw unassignedError("data set does not exist"); - } - else if( fname != "" ) - { - ofstream fout; - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("cannot create output file"); - } - - *pout << " Saving PDF data set " << iset << " to file : " << fname << endl; - - outfilestring = datasets[iset-1]->build_pdf_file(); - - fout << outfilestring; - fout.close(); - } - else - { - outfilestring = datasets[iset-1]->build_pdf_file(); - } - - return outfilestring; -} - - -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. -*/ -string DataSet::build_pdf_file() -{ - string blank=string(4,' '); - stringstream outfilestream; - outfilestream.setf(ios::showpoint); - - for (int i=nfmin;i<=nfmax;i++) - { - double r = i*deltar + rmin; - outfilestream << setw(12) << r << blank << setw(12) << pdftot[i] << blank << setw(12) << 0.0 - << blank << setw(12) << 1.0/sqrt(wic[i]) << blank << setw(12) - << obs[i]-pdftot[i] << endl; - } - - return outfilestream.str(); -} - -//------ - Save DIF file (Gobs-G(r)) -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file - is optional. -*/ - -string PdfFit::save_dif(int iset, string fname) -{ - - ofstream fout; - string outfilestring = ""; - - if ( (iset < 1) || (iset > nset) ) - { - throw unassignedError("Data set does not exist"); - } - else if (fname != "" ) - { - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("Cannot create output file"); - } - - *pout << " Saving difference data set " << iset << " to file : " << fname << endl; - - outfilestring = datasets[iset-1]->build_dif_file(); - - fout << outfilestring; - fout.close(); - } - else - { - outfilestring = datasets[iset-1]->build_dif_file(); - } - - return outfilestring; -} - -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the saved file. -*/ -string DataSet::build_dif_file() -{ - string blank=string(4,' '); - stringstream outfilestream; - outfilestream.setf(ios::showpoint); - - for (int i=nfmin;i<=nfmax;i++) - { - double r = i*deltar + rmin; - outfilestream << setw(12) << r << blank << setw(12) << obs[i]-pdftot[i] << endl; - } - - return outfilestream.str(); -} - -void PdfFit::selphase(int ip) -{ - if (!curset) - { - throw unassignedError("No data set selected"); - } - assert(nphase == (int)phase.size()); - if (ip == ALL) - { - curset->psel = phase; - } - else - { - // check if one-based index ip is out of bounds - if (ip < 1 || ip > nphase) - { - stringstream eout; - eout << "Phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - curset->selphase(ip - 1, phase[ip - 1]); - } -} - -void DataSet::selphase(int ip, Phase *phase) -{ - if (int(psel.size()) <= ip) - { - psel.resize(ip+1); - } - psel[ip] = phase; -} - - -vector DataSet::getcrw() const -{ - assert(mowner); - double wsqobs = mowner->totalWeighedSquareObs(); - // Get reciprocal value of wsqobs. - // Do not normalize when wsqobs is zero. - double recwsqobs = (wsqobs > 0) ? (1.0 / wsqobs) : 1.0; - vector rv = this->cumchisq; - vector::iterator xi; - for (xi = rv.begin(); xi != rv.end(); ++xi) - { - *xi = sqrt(*xi * recwsqobs); - } - return rv; -} - - -double DataSet::weighedSquareObs() const -{ - double rv = 0; - for (int i = nfmin; i <= nfmax; i++) - { - rv += wic[i] * obs[i] * obs[i]; - } - return rv; -} - - -double DataSet::getdsrw() const -{ - vector crw = this->getcrw(); - double rv = crw.empty() ? 0.0 : crw.back(); - return rv; -} - - -double DataSet::getdsredchisq() const -{ - assert(mowner); - int nredobs = mowner->totalReducedObservations(); - double c2 = this->cumchisq.empty() ? 0.0 : this->cumchisq.back(); - double rv = (nredobs > 0) ? (c2 / nredobs) : 0.0; - return rv; -} - - -void PdfFit::pdesel(int ip) -{ - if (!curset) - { - throw unassignedError("No data set selected"); - } - assert(nphase == (int)curset->psel.size()); - if (ip == ALL) - { - fill(curset->psel.begin(), curset->psel.end(), - static_cast(NULL)); - } - else - { - // check if one-based index ip is out of bounds - if (ip < 1 || ip > nphase) - { - stringstream eout; - eout << "phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - curset->psel[ip - 1] = NULL; - } -} - -// phase[ip-1] or curphase for ip == 0 -Phase* PdfFit::getphase(int ip) -{ - Phase* ph = (0 < ip && ip <= nphase) ? phase[ip-1] : curphase; - if (!ph || ip < 0 || ip > nphase) - { - throw unassignedError("Phase does not exist."); - } - return ph; -} - -void PdfFit::check_sel_args(int ip, char ijchar, int aidx1) -{ - ostringstream emsg; - if (!curset) - { - throw unassignedError("No data set selected"); - } - if (ip < 1 || ip > int(curset->psel.size())) - { - emsg << "phase " << ip << " undefined or not selected\n"; - throw unassignedError(emsg.str()); - } - if (ijchar != 'i' && ijchar != 'j') - { - ostringstream emsg; - emsg << "Invalid value of ijchar '" << ijchar << "'"; - throw ValueError(emsg.str()); - } - if (aidx1 < 1 || aidx1 > (curset->psel[ip - 1]->natoms)) - { - emsg << "invalid atom index " << aidx1 << ".\n"; - throw ValueError(emsg.str()); - } -} - -void PdfFit::selphaseForEachDataSet(Phase* ph) -{ - // find 0-based index of ph in PdfFit::phase vector - assert(count(this->phase.begin(), this->phase.end(), ph) > 0); - int phidx0 = find(this->phase.begin(), this->phase.end(), ph) - - this->phase.begin(); - vector::iterator dsi; - for (dsi = this->datasets.begin(); dsi != this->datasets.end(); ++dsi) - { - DataSet* pds = *dsi; - pds->selphase(phidx0, ph); - } -} - -void PdfFit::selectAtomType(int ip, char ijchar, char* symbol, bool select) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - const LocalPeriodicTable* lpt = ph->getPeriodicTable(); - const AtomType* atp = lpt->lookup(symbol); - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) - { - if (atp != ph->atom[aidx].atom_type) continue; - if (select) ignored.erase(aidx); - else ignored.insert(aidx); - } -} - -void PdfFit::selectAtomIndex(int ip, char ijchar, int aidx1, bool select) -{ - check_sel_args(ip, ijchar, aidx1); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - int aidx = aidx1 - 1; - if (select) ignored.erase(aidx); - else ignored.insert(aidx); -} - -void PdfFit::selectAll(int ip, char ijchar) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - ignored.clear(); -} - -void PdfFit::selectNone(int ip, char ijchar) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) ignored.insert(aidx); -} - -/***************************************** - Wed Oct 12 2005 - CLF - Reads observed PDF from arrays. -******************************************/ -int PdfFit::read_data_arrays(char tp, double qmax, double qdamp, - int length, double * r_data, double * Gr_data, double * dGr_data, string _name) -{ - DataSet* pds = new DataSet(this); - - try { - pds->read_data_arrays(nset+1, tp, qmax, qdamp, length, - r_data, Gr_data, dGr_data, _name); - } - catch(Exception e) { - delete pds; - throw; - } - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -/***************************************** - Wed Oct 12 2005 - CLF - Reads observed PDF from a c-style string. -******************************************/ - -int PdfFit::read_data_string(string& buffer, char tp, double qmax, double qdamp, string _name) -{ - DataSet* pds = new DataSet(this); - try { - pds->read_data_string(nset+1, buffer, tp, qmax, qdamp); - } - catch(Exception e) { - delete pds; - throw; - } - // automatically select existing phases and its atoms for the new dataset - for (int ip = 0; ip < nphase; ip++) pds->selphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -/***************************************** - Reads observed PDF as xy ASCII file. -******************************************/ - -int PdfFit::read_data(string datafile, char tp, double qmax, double qdamp) -{ - DataSet* pds = new DataSet(this); - try { - pds->read_data(nset+1, datafile, tp, qmax, qdamp); - } - catch(Exception e) { - delete pds; - throw; - } - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -// local helper to check for regular spacing in sequence -namespace { - -template -bool isRegular(Iterator first, Iterator last) -{ - if (last - first < 2) return true; - double dx = double( *(last-1) - *first ) / double(last - first - 1); - for (Iterator p0 = first, p1 = first + 1; p1 != last; ++p0, ++p1) - { - if (fabs(*p1 - *p0 - dx) > deltar_tol) return false; - } - return true; -} - -} // local namespace - - -/* Wed Oct 12 2005 - CLF - * Using read_data_arrays adds functionality - * to pdffit2, allowing one to read data that is alread stored as arrays. - */ -void DataSet::read_data_arrays(int _iset, char tp, double _qmax, double _qdamp, - int length, double * r_data, double * Gr_data, - double * dGr_data, string _name ) -{ - iset = _iset; - - //------ Now analyse given parameters - - //------ - get exp. method (neutron/x-ray) - - scattering_type = tp; - - //------ - get QMAX and Qdamp - - qmax = _qmax; - qdamp = _qdamp; - - //------ Finally we actually read the data - - bool lwei = true; - - /* Only really care about G(r) and dG(r), the uncertainty */ - for( int i = 0; i < length; i++ ) - { - double wic; - - if( dGr_data == NULL ) - { - wic = 1.0; - lwei = false; - } - else - { - wic = 1.0/sqrt( dGr_data[i] ); - } - - this->obs.push_back( Gr_data[i] ); - this->wic.push_back(wic); - - } - - *pout << " Reading data from arrays...\n"; - - rmin = rfmin = r_data[0]; - rmax = rfmax = r_data[length - 1]; - bin = length; - deltar = (rmax - rmin)/double(bin-1); - // check if r has equidistant spacing - if (!isRegular(r_data, r_data + length)) - { - throw dataError("Irregular spacing of r values."); - } - name = _name; - - *pout << " Read PDF data set " << iset << - " (r = " << rmin << " to " << rmax << " A, " << - bin << " points) ...\n"; - if (!lwei) this->warningOnMissingWeights(); - *pout << endl; - - return; -} - -void DataSet::read_data_stream(int _iset, istream& fdata, - char tp, double _qmax, double _qdamp, string _name) -{ - string line; - - iset = _iset; - - //------ - get exp. method (neutron/x-ray) - - scattering_type = tp; - - //------ - get QMAX and Qdamp - - qmax = _qmax; - qdamp = _qdamp; - - //------ Ignore header lines - getline(fdata, line); - if (line.compare(0, 7, "History") == 0) - { - for ( ; !fdata.eof(); getline(fdata,line)) - { - if (line[0] != '#') continue; - // get 3 words from line - string w0, w1, w2; - istringstream fline(line); - fline >> w0 >> w1 >> w2; - if ( w0.find_first_not_of('#') == string::npos && - w1 == "start" && w2 == "data" ) break; - } - } - //------ Any other header lines starting with # ? - while (line[0] == '#') getline(fdata,line); - - //------ Finally we actually read the data - - // find number of columns - int ncol = 0; - if (!line.empty()) - { - double x; - istringstream sline(line); - while (sline >> x) ++ncol; - } - - vector r_data; - bool lwei = (ncol > 2); // flag for weights defined by dGr - - while (true) - { - double ri, obs; - double val, wic; - istringstream sline(line); - - sline >> ri >> obs; - if (!sline) break; - - // Obtain weights from dGr. Use dGr values only when they are all - // positive, otherwise set all weights to 1. - wic = 1.0; - switch (ncol) - { - case 3: - if (sline >> val && val > 0.0) - { - wic = 1.0/sqr(val); - } - else - { - lwei = false; - } - break; - case 4: - // skip one value - if (sline >> val >> val && val > 0.0) - { - wic = 1.0/sqr(val); - } - else - { - lwei = false; - } - break; - } - - // copy values to data arrays - r_data.push_back(ri); - this->obs.push_back(obs); - this->wic.push_back(wic); - - if (!getline(fdata, line)) break; - } - - // make sure all wic values are one when lwei is false, because - // lwei could be reset due to zero dGr value - if (!lwei) - { - fill(this->wic.begin(), this->wic.end(), 1.0); - } - - *pout << " Reading " << ncol << " columns ...\n"; - - if (!isRegular(r_data.begin(), r_data.end())) - { - throw dataError("Irregular spacing of r values."); - } - if (this->obs.size() < 2) - { - throw dataError("Incredibly short data set."); - } - bin = this->obs.size(); - this->rmin = this->rfmin = r_data.front(); - this->rmax = this->rfmax = r_data.back(); - this->nfmin = 0; - this->nfmax = bin - 1; - this->deltar = (rmax - rmin)/double(bin-1); - this->name = _name; - - *pout << " Read PDF data set " << iset << " (r = " << rmin - << " to " << rmax << " A, " << bin << " points) ...\n"; - - if (!lwei) this->warningOnMissingWeights(); - - *pout << endl; - - return; -} - -/* Wed Oct 12 2005 - CLF - * Using read_data_string adds functionality - * to pdffit2, allowing one to read data that has already been loaded. - * - * - * Thu Nov 3 2005 - CLF - * Need to add some data checking routines! - */ -void DataSet::read_data_string(int _iset, string& buffer, char tp, double _qmax, - double _qdamp, string _name) -{ - istringstream fdata(buffer); - read_data_stream(_iset, fdata, tp, _qmax, _qdamp, _name); - return; -} - -/* Wed Oct 12 2005 - CLF - * Using read_data and the above read_data_string adds functionality - * to pdffit2, allowing one to read data that has already been loaded. - */ -void DataSet::read_data(int _iset, string pfile, char tp, double _qmax, - double _qdamp) -{ - // open and check pfile - ifstream fdata(pfile.c_str()); - if (!fdata) throw IOError("File does not exist"); - // read the data - read_data_stream(_iset, fdata, tp, _qmax, _qdamp, pfile); - return; -} - -/********************************* - Sets R-range for fitting -**********************************/ -void PdfFit::range(int is, double rmin, double rmax) -{ - if( rmin >= rmax ) - { - throw ValueError("rmin must be < rmax"); - } - if (is == ALL) - { - for(is = 0; is < nset; is++) datasets[is]->range(rmin,rmax); - } - else - { - if ( (is >= 1) && (is <= nset) ) - { - datasets[is-1]->range(rmin,rmax); - } - else - { - throw ValueError("Invalid data set number"); - } - } -} - -void DataSet::range(double rmin, double rmax) -{ - if ( (rmin >= this->rmin) && (rmin <= this->rmax) - && (rmax <= this->rmax) && (rmin < rmax) ) - { - this->rfmin = rmin; - this->rfmax = rmax; - } - else - { - throw ValueError("Range outside data set limits"); - } -} - -vector< pair > DataSet::getAtomPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - xi[ip] = ph->pscale / (bavg*bavg); - dxi[ip] = ph->dpscale / (bavg*bavg); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - -vector< pair > DataSet::getCellPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - xi[ip] = ph->pscale / (bavg*bavg * ph->np); - dxi[ip] = ph->dpscale / (bavg*bavg * ph->np); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - -vector< pair > DataSet::getMassPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - double mavg = ph->averageAtomicMass(); - xi[ip] = ph->pscale * mavg / (bavg*bavg); - dxi[ip] = ph->dpscale * mavg / (bavg*bavg); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - - -void DataSet::warningOnMissingWeights() const -{ - *pout << - " ****WARN****\n" << - " Uncertainties on G(r) were absent or unreadable in your input\n" << - " data. The program reset these uncertainties to unity. This\n" << - " does not affect at all the refined parameter values. However,\n" << - " the values of the estimated uncertainties on these refined\n" << - " parameter values are not reliable.\n" << - " ****WARN****\n"; -} - -// End of file diff --git a/libpdffit2/pdffit.cc b/libpdffit2/pdffit.cc deleted file mode 100644 index 7eaa5f49..00000000 --- a/libpdffit2/pdffit.cc +++ /dev/null @@ -1,372 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit and Fit methods for implementing PDFFIT1 interpreter commands. -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "pdffit.h" - - -// class methods - -const string& PdfFit::version(const char* ver) -{ - static unique_ptr vervalue; - static const string undefined_version = "1.0?"; - // definition of the version value. This should be only called once, - // when the pdffit2 module is initialized. We allow redefinition - // with the same version as this may happen when pdffit2 gets reloaded. - if (ver) - { - if (!vervalue.get()) - { - vervalue.reset(new string(ver)); - } - else if (*vervalue != ver) - { - ostringstream emsg; - emsg << "Invalid redefinition of PdfFit::version."; - throw invalid_argument(emsg.str()); - } - } - // take care of return value rv. - const string& rv = vervalue.get() ? *vervalue : undefined_version; - return rv; -} - - -// constructor and destructor - - -PdfFit::PdfFit() -{ - reset(); - init(); -} - - -PdfFit::~PdfFit() -{ - reset(); -} - - -/********************************************************** - resets the data sets and crystal structures to empty -***********************************************************/ - -void PdfFit::reset() -{ - //------ Data sets - - vector::iterator dsi = this->datasets.begin(); - for (; dsi != this->datasets.end(); ++dsi) delete *dsi; - this->datasets.clear(); - this->nset = 0; - this->curset = NULL; - - //------ Structure - - vector::iterator phi = this->phase.begin(); - for (; phi != this->phase.end(); ++phi) delete *phi; - this->phase.clear(); - this->nphase = 0; - this->curphase = NULL; - this->total = 0; - - // ------ Fit - - this->fit.reset(); -} - -void Fit::reset() -{ - // reset all data members to initial values - alambda = chisq = ochisq = fit_rw = redchisq = wnorm = 1.0; - stagnating = ntot = ndof = 1; - iter = 0; - // clean all arrays - p.clear(); - dp.clear(); - id.clear(); - ip.clear(); - covar.clear(); - alpha.clear(); - var.clear(); - dvar.clear(); - vref.clear(); - vcovar.clear(); - fconstraint.clear(); - form.clear(); - idef.clear(); - ctype.clear(); - used.clear(); - dvdp.clear(); - sdptr.clear(); - refvar.clear(); -} - - -void Fit::init_builtins() -{ - typedef pair entry; - builtin.insert(entry("-",Builtin(neg,dneg))); - builtin.insert(entry("sin",Builtin(sin,dsin))); - builtin.insert(entry("cos",Builtin(cos,dcos))); - builtin.insert(entry("tan",Builtin(tan,dtan))); - builtin.insert(entry("sind",Builtin(sind,dsind))); - builtin.insert(entry("cosd",Builtin(cosd,dcosd))); - builtin.insert(entry("tand",Builtin(tand,dtand))); - builtin.insert(entry("asin",Builtin(asin,dasin))); - builtin.insert(entry("acos",Builtin(acos,dacos))); - builtin.insert(entry("atan",Builtin(atan,datan))); - builtin.insert(entry("asind",Builtin(asind,dasind))); - builtin.insert(entry("acosd",Builtin(acosd,dacosd))); - builtin.insert(entry("atand",Builtin(atand,datand))); - builtin.insert(entry("exp",Builtin(exp,dexp))); - builtin.insert(entry("log",Builtin(log,dlog))); - builtin.insert(entry("sqr",Builtin(sqr,dsqr))); - builtin.insert(entry("cube",Builtin(cube,dcube))); - builtin.insert(entry("sqrt",Builtin(sqrt,dsqrt))); -} - -/* - Initialization routine -*/ -void PdfFit::init() // called setup in Fortran program -{ - fit.init_builtins(); -} - -void PdfFit::setphase(int ip) -{ - if ((ip<1) || (ip > nphase)) - { - stringstream eout; - eout << "Warning: phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - - Phase &phase=*this->phase[ip-1]; - - curphase = &phase; - - lat.resize(6); - lat[0].setptr(&phase.a0[0]); - lat[1].setptr(&phase.a0[1]); - lat[2].setptr(&phase.a0[2]); - lat[3].setptr(&phase.win[0]); - lat[4].setptr(&phase.win[1]); - lat[5].setptr(&phase.win[2]); - - pscale.setptr(&phase.pscale); - spdiameter.setptr(&phase.spdiameter); - stepcut.setptr(&phase.stepcut); - delta2.setptr(&phase.delta2); - delta1.setptr(&phase.delta1); - sratio.setptr(&phase.sratio); - rcut.setptr(&phase.rcut); - - x.resize(phase.natoms); - y.resize(phase.natoms); - z.resize(phase.natoms); - u11.resize(phase.natoms); - u22.resize(phase.natoms); - u33.resize(phase.natoms); - u12.resize(phase.natoms); - u13.resize(phase.natoms); - u23.resize(phase.natoms); - occ.resize(phase.natoms); - - for(int ia=0; ia nset)) - { - stringstream eout; - eout << "Warning: set " << is << " undefined"; - throw unassignedError(eout.str()); - } - - DataSet* pds = this->datasets[is-1]; - - curset = pds; - - dscale.setptr( &(pds->dscale) ); - qdamp.setptr( &(pds->qdamp) ); - qbroad.setptr( &(pds->qbroad) ); -} - - -const vector& DataSet::getpdf_obs() -{ - return this->obs; -} - - -const vector& DataSet::getpdf_fit() -{ - if (this->pdftot.empty()) - { - size_t n = this->obs.size(); - this->pdftot.assign(n, 0.0); - } - return this->pdftot; -} - - -vector PdfFit::getpdf_obs() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->getpdf_obs(); -} - -vector PdfFit::getpdf_fit() -{ - if (!curset) - { - throw unassignedError("No fit data"); - } - return curset->getpdf_fit(); -} - -int PdfFit::getnfmin() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->nfmin; -} - -int PdfFit::getnfmax() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->nfmax; -} - -double PdfFit::getdeltar() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->deltar; -} - -double PdfFit::getrmin() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->rmin; -} - -double PdfFit::getrmax() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->rmax; -} - -vector PdfFit::getcrw() const -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->getcrw(); -} - -map > PdfFit::getPhaseFractions() -{ - if (!curset) - { - const char* emsg = "Dataset not defined, unknown scattering type"; - throw unassignedError(emsg); - } - map > rv; - vector< pair > atomfractions; - vector< pair > cellfractions; - vector< pair > massfractions; - atomfractions = curset->getAtomPhaseFractions(); - cellfractions = curset->getCellPhaseFractions(); - massfractions = curset->getMassPhaseFractions(); - size_t n = atomfractions.size(); - for (size_t i = 0; i != n; ++i) - { - rv["atom"].push_back(atomfractions[i].first); - rv["stdatom"].push_back(atomfractions[i].second); - rv["cell"].push_back(cellfractions[i].first); - rv["stdcell"].push_back(cellfractions[i].second); - rv["mass"].push_back(massfractions[i].first); - rv["stdmass"].push_back(massfractions[i].second); - } - return rv; -} - -double PdfFit::get_scat(char tp, string smbpat) -{ - double rv; - const LocalPeriodicTable* lpt = this->curphase ? - this->curphase->getPeriodicTable() : - LocalPeriodicTable::instance(); - const AtomType* atp = lpt->lookup(smbpat); - try { - rv = atp->sf(tp); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - return rv; -} - -// End of file diff --git a/libpdffit2/pdffit.h b/libpdffit2/pdffit.h deleted file mode 100644 index a4b030ac..00000000 --- a/libpdffit2/pdffit.h +++ /dev/null @@ -1,611 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes Phase, DataSet, Fit, Pdf, PdfFit, RefVar, NonRefVar, Builtin -* -* Comments: Main header file included by all others. Big mess. -* -***********************************************************************/ - -#ifndef PDFFIT_H_INCLUDED -#define PDFFIT_H_INCLUDED - -#include -#include -#include -#include -#include -#include - -#include "AtomType.h" -#include "Atom.h" -#include "PairDistance.h" -#include "matrix.h" -#include "exceptions.h" -#include "LocalPeriodicTable.h" -#include "OutputStreams.h" - -using namespace std; - -/*********************************************************************** - * Here are constants for the parameter coding - DO NOT CHANGE - * unless you are rewriting the program !!!!!!!!!!!!!!!!!!!!!! - *********************************************************************** - * - * n_st : Number of global structural parameters per phase - * n_at : Number of parameters for each atom - * n_ex : Number of experimental parameters per dataset - * - ***********************************************************************/ - -const int n_st = 11; -const int n_at = 10; -const int n_ex = 3; - -const int ALL = -1; -typedef vector::iterator VAIT; - -enum FCON { USER, IDENT, FCOMP, FSQR }; - -typedef double (*fbuiltin)(double); - -class Fit; -class PdfFit; -class DataSet; -class Phase; -class NonRefVar; -class RefVar; - - -// non-refinable variables accessible to the users -class NonRefVar -{ - friend class PdfFit; - double *a; - - public: - NonRefVar() : a(NULL) - { - mtype = "NonRefVar"; - } - bool isAssigned() { return (a != NULL); } - void setptr(double* a) { this->a = a; } - void setval(double a) { *this->a = a; } - double get() { - double rv = (a) ? *a : 0.0; - return rv; - } - const string& type() const - { - return mtype; - } - - protected: - string mtype; -}; - -// Refinable variables accessible to the users -class RefVar: public NonRefVar -{ - friend class PdfFit; - public: - RefVar() : NonRefVar() - { - mtype = "RefVar"; - } -}; - - -typedef double (*fcon)(vector&, vector&); -typedef double (*fbuiltin) (double); - -// TK commented out 03/31/05 -// class Builtin { fbuiltin func, deriv; -// public: -// Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} -// }; - -// TK 03/31/05 replaced above with -class Builtin { - public: - fbuiltin func, deriv; // made these public. - // Really should just be a struct, or provide - // const pointers. - Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} -}; - -// contains the address of the variable, and the current value of the parameter -class Fit -{ - friend class PdfFit; - - map builtin; - - double parse(string line, vector &dnumdp); - double compute(string &expr, vector &dnumdp); - string substitute_pars(string &expr); - double getnum(istringstream &inexpr, vector &dnumdp); - void init_builtins(); - void reset(); - - public: - Fit() - { - reset(); - } - - // CLF Wed May 25 2005 - // Made these members of fit. Were local variables to - // refine function. - double alambda, chisq, ochisq; - int stagnating; - // CLF - - int iter; - double fit_rw; - double redchisq; // reduced chi-squared - double wnorm; // sum of weighted squared datapoints - int ntot, ndof; // total # of points, number of degrees of freedom - // parameter related variables - vector p; // fit-parameters - vector dp; // errors on the refined parameters; - vector id; // parameter identification number (arbitrary integer) - vector ip; // parameter selection - matrix covar, alpha; // covariance matrix and curvature - - // constraint related variables - vector var; // constrained variables - vector dvar; // errors on the constrained variables - vector vref; // true if variable contains free parameters - matrix vcovar; // covariance matrix on constrained variables - vector fconstraint; // constraint equations - vector form; // constraint formula - vector idef; // default parameter if no explicit constraint - vector ctype; // type of constraint - - vector used; // vector of used parameter indices (not ids) in the current constraint - - // variables relating constraint-parameter - matrix dvdp; // derivative of var wrt p - - // variables relating to refinable variables - vector sdptr; // pointer to standard deviation of refinable variable - - vector refvar; // integer pointer from refinable variable to actual constraint # - - void fixpar(int pidx); - void freepar(int pidx); - void setpar(unsigned int pidx, double val); - double getpar(unsigned int pidx); - void constrain(double &a, string form); - void constrain(double &a, double f(vector&, vector&) ); - void constrain(double &a, int ipar ); - void constrain(double &a, int ipar, FCON type); - void constrain(double &a, string inpform, fcon f, int idef, FCON type); - int vfind(double &a); // look for variable in list of constraints - int parfind(unsigned int j); - void fill_variables(); - void fill_errors(); - int varsize() const { return var.size(); } - int psize() const { return p.size(); } - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - void out(); - - private: - vector order_by_id() const; - -}; - -class PdfFit -{ - // class methods - - public: - static const string& version(const char* ver=NULL); - - private: - - //Struct cr; - int nphase; - int total; // total # of atoms - vector phase; - - Fit fit; - - // Dataset parameters - int nset; - vector datasets; - DataSet *curset; - - void init(); - - public: - - void fit_setup(); - void fit_errors(); - void fit_theory(bool ldiff, bool lout); - double totalWeighedSquareObs() const; - int totalReducedObservations() const; - - private: - - void initarrays(); - - void mrqmin(vector &a, vector &ia, matrix &covar, - matrix &alpha, double &chisq, double &alamda, - bool deriv); - void mrqmin(double a[], int ia[], int ma, double **covar, - double **alpha, double *chisq, double *alamda, bool deriv); - void mrqcof(double*, int*, int, double**, double*, double*, bool deriv); - void fill_variables(vector a); - int getnpar() { return nset*n_ex + nphase*n_st + total*n_at; } - - public: - - Phase* curphase; - PdfFit(); - ~PdfFit(); - - void alloc(char tp, double qmax, double qdamp, - double rmin, double rmax, int bin); - void calc(); - int read_struct(string fname); // returns 1:OK, 0:Error - int read_data(string fname, char tp, double qmax, double qdamp); - //Wed Oct 12 2005 - CLF - int read_struct_string(char * buffer); // returns 1:OK, 0:Error - int read_data_string(string& buffer, char tp, double qmax, double - qdamp, string name = "string"); - int read_data_arrays(char tp, double qmax, double qdamp, int length, - double * r_data, double * Gr_data, double * dGr_data = NULL, - string name = "array"); - void reset(); - //Thu Oct 13 2005 - CLF - string save_pdf(int iset, string fname = ""); - string save_dif(int iset, string fname = ""); - string save_res(string fname = ""); - string save_struct(int ip, string strucfile = ""); - string show_struct(int ip); - // - int refine(bool deriv, double toler = 0.00000001); - int refine_step(bool deriv, double toler = 0.00000001); - double getrw(void) - { - return fit.fit_rw; - } - void setpar(unsigned int pidx, double val) - { - fit.setpar(pidx, val); - } - void setpar(unsigned int pidx, RefVar v) - { - fit.setpar(pidx, *v.a); - } - double getpar(unsigned int pidx) - { - return fit.getpar(pidx); - } - void fixpar(int pidx) - { - fit.fixpar(pidx); - } - void freepar(int pidx) - { - fit.freepar(pidx); - } - void range(int iset, double rmin, double rmax); - - void constrain(RefVar v, double f(vector&, vector&)) - { - fit.constrain(*v.a,f); - } - void constrain(RefVar v, string form) - { - fit.constrain(*v.a,form); - } - void constrain(RefVar v, int ipar) - { - fit.constrain(*v.a,ipar); - } - void constrain(RefVar v, int ipar, FCON type) - { - fit.constrain(*v.a,ipar,type); - } - void setphase(int ip); - void setdata(int is); - void setvar(RefVar v, double a) { v.setval(a); } - double getvar(RefVar v) { return v.get(); } - void setvar(NonRefVar v, double a) { v.setval(a); } - double getvar(NonRefVar v) { return v.get(); } - - void selphase(int ip); - void pdesel(int ip); - Phase* getphase(int ip); - int num_phases() { return this->nphase; } - int num_datasets() { return this->nset; } - - private: - - void check_sel_args(int ip, char ijchar, int aidx1=1); - void selphaseForEachDataSet(Phase*); - - public: - - void selectAtomType(int ip, char ijchar, char* symbol, bool select); - void selectAtomIndex(int ip, char ijchar, int aidx1, bool select); - void selectAll(int ip, char ijchar); - void selectNone(int ip, char ijchar); - - pair bond_angle(int ia, int ja, int ka); - PairDistance bond_length_atoms(int ia, int ja); - vector bond_length_types(string symi, string symj, - double bmin, double bmax); - - vector getpdf_obs(); - vector getpdf_fit(); - - // current phase and set refinable variable pointers - vector lat, x, y, z, u11, u22, u33, u12, u13, u23, occ; - RefVar pscale; - RefVar spdiameter; - NonRefVar stepcut; - RefVar sratio; - RefVar delta2, delta1; - RefVar dscale, qdamp, qbroad; - NonRefVar rcut; - int getnfmin(); - int getnfmax(); - double getdeltar(); - double getrmin(); - double getrmax(); - vector getcrw() const; - map > getPhaseFractions(); - double get_scat(char tp, string smbpat); -}; - -class Pdf -{ - public: - - int nfmin, nfmax, ncmin, ncmax; - double qmax, qdamp, rmin, rmax, deltar; - double rfmin, rfmax; // fit range - double rcmin, rcmax; // extended calculation range - double dscale, ddscale, qbroad, dqbroad, dqdamp; - - Pdf() - { - nfmin = nfmax = ncmin = ncmax = 0; - qmax = qdamp = rmin = rmax = deltar = 0.0; - rfmin = rfmax = rcmin = rcmax = 0.0; - dscale = 0.0; ddscale = 0.0; - qbroad = dqbroad = dqdamp = 0.0; - } - - vector pdftot; // total pdf - matrix calc; // ?? pdf for each phase and each point in the dataset -}; - -class DataSet: public Pdf -{ - - private: - int offset; - const PdfFit* mowner; - void applyQmaxCutoff(double* y, size_t len); - void extendCalculationRange(bool lout); - string selectedAtomsString(int ip, char ijchar); - void read_data_stream(int iset, istream& fdata, - char tp, double qmax, double qdamp, string name); - void warningOnMissingWeights() const; - - public: - - int iset; // Dataset index - char scattering_type; - string name; - - DataSet(const PdfFit* owner) : Pdf(), mowner(owner) - { - dscale = 1.0; ddscale = 0; - qbroad = dqbroad = 0.0; - }; - // pdf-related - void determine(bool ldiff, bool lout, Fit &par); - void pdf_derivative (Phase& phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl, - double gaus, Fit &fit, double* fit_a_i); - - const vector& getpdf_fit(); - const vector& getpdf_obs(); - //Thu Oct 13 2005 - CLF - string build_pdf_file(); - string build_dif_file(); - // - void read_data(int iset, string fname, char tp, double qmax, double qdamp); - //Wed Oct 12 2005 - CLF - void read_data_string(int iset, string& buffer, char tp, double qmax, double qdamp, - string name = "string"); - void read_data_arrays(int iset, char tp, double qmax, double qdamp, - int length, double * r_data, double * Gr_data, double * dGr_data = NULL, string name = "array"); - // - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - void range(double rmin, double rmax); - - void fit_setup_derivatives(Fit &par); - void selphase(int ip, Phase *phase); - - vector getcrw() const; - double weighedSquareObs() const; - double getdsrw() const; - double getdsredchisq() const; - - // phase fraction calculations - vector< pair > getAtomPhaseFractions(); - vector< pair > getCellPhaseFractions(); - vector< pair > getMassPhaseFractions(); - - // fit related - matrix fit_a, fit_b; // nbin*npar - - int bin; - vector obs, wic; - - // phase specific information this dataset: selected, allowed atoms - vector psel; // phase selection - // i and j indices to be ignored when calculating PDF - map > phase_ignore_i; - map > phase_ignore_j; - vector cumchisq; - friend void PdfFit::fit_setup(); - -}; - -class Phase { - - private: - - // data - string spcgr, name; - int offset; - LocalPeriodicTable _local_periodic_table; - - double ar[3], wrez[3], dar[3], dwrez[3]; - double gten[3][3], dgten[3][3]; // tensor and sd - double rten[3][3], drten[3][3]; // tensor and sd - double _eps[3][3][3], _reps[3][3][3], _deps[3][3][3], _dreps[3][3][3]; - double &eps(int i, int j, int k) { return _eps[i][j][k]; } - double &reps(int i, int j, int k) { return _reps[i][j][k]; } - double &deps(int i, int j, int k) { return _deps[i][j][k]; } - double &dreps(int i, int j, int k) { return _dreps[i][j][k]; } - - // methods - - set selectAtomsOf(string symbol); - - // Added a return value - string get_scat_string(char tp, const AtomType* atp); - - // shift to equivalent lattice position nearest to the origin - void make_nearest(double xyz[3]); - - public: - - vector atom_types; - int iphase; - double cosa, cosb, cosg, sina, sinb, sing; - double v, dv, vr, dvr; - int icc[3]; - // Phase has a number of public elements as it is often cross-referenced - - int natoms; // total number of atoms in multicell icc0 x icc1 x icc2 - int ncatoms; // number of atoms in one cell - - // IMPORTANT: atom[i].atom_type must be a pointer to AtomType - // from _local_periodic_table. Insertion of a new entry to - // vector atom must be followed by reassign_atom_type(entry); - vector atom; - - double pscale, dpscale; - double a0[3], win[3], da0[3], dwin[3]; - double np, dnp, rho0, drho0; // np: total occupance, rho0: number density - - // pdf-related - double delta2, sratio, rcut; - double ddelta2, dsratio, delta1, ddelta1; - double spdiameter, dspdiameter; // spherical particle diameter - double stepcut; - double dnorm, corr_max; - - - Phase() - { - pscale = 1.0; dpscale = 0.0; - sratio=1.0; - a0[0] = a0[1] = a0[2] = da0[0] = da0[1] = da0[2] = - win[0] = win[1] = win[2] = dwin[0] = dwin[1] = dwin[2] = - delta2 = ddelta2 = dsratio = rcut = 0.0; - delta1 = ddelta1 = corr_max = 0.0; - spdiameter = dspdiameter = 0.0; - stepcut = 0.0; - icc[0] = icc[1] = icc[2] = ncatoms = natoms = 0; - spcgr = "P1"; - name = "UNNAMED"; - } - inline size_t nscat() - { - return atom_types.size(); - } - void read_struct(int iphase, string fname); - void read_struct_string(int iphase, char * buffer); - private: - void read_struct_stream(int _iphase, istream& fstruct); - void read_header(istream &fstruct, bool &ldiscus); - void read_atoms(istream &fstruct); - // Reset atom_type to point to an entry from _local_periodic_table - void reassign_atom_type(Atom* ap); - - public: - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - template void save_struct(Stream &fout); - - void lattice(); - void show_lattice(); - void tensor(double ten[3][3], double vec[3], double win[3]); - void dtensor(double vec[3], double win[3], double dten[3][3], double dvec[3], double dwin[3]); - - double skalpro(const double h[3], const double k[3]); - double dskalpro(double h[3], double k[3], double dh[3], double dk[3]); - - double circum_diameter(); // diameter of a sphere enclosing unit cell - // mean square displacement of 2 atoms - double msdAtoms(const Atom& ai, const Atom& aj, double* vl); - // reference to the local periodic table - LocalPeriodicTable* getPeriodicTable(); - - // pdf-related - - double averageAtomicMass(); - double averageScatteringFactor(char tp); - void setup_weights(char tp); - - pair bond_angle(int ia, int ja, int ka); - PairDistance bond_length_atoms(int ia, int ja); - vector bond_length_types(string symi, string symj, - double bmin, double bmax); - // Fri Oct 28 2005 - CLF - // Added a return value - void show_scat(char tp); - string get_scat_string(char tp); - string get_scat_string(char tp, string smbpat); - void set_scat(char tp, const string& smbpat, double value); - void reset_scat(const string& smbpat); - - friend class Atom; - friend class DataSet; - friend void PdfFit::fit_setup(); - friend void DataSet::fit_setup_derivatives(Fit &par); - friend void DataSet::determine(bool ldiff, bool lout, Fit &par); - friend void DataSet::pdf_derivative (Phase& phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl, - double gaus, Fit &fit, double* fit_a_i); - friend void PdfFit::fit_theory(bool ldiff, bool lout); -}; - - -#endif // PDFFIT_H_INCLUDED diff --git a/libpdffit2/pdflsmin.cc b/libpdffit2/pdflsmin.cc deleted file mode 100644 index 078d2754..00000000 --- a/libpdffit2/pdflsmin.cc +++ /dev/null @@ -1,326 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit methods for Levenberg-Marquardt least-squares minimization. -* -* Comments: -* -***********************************************************************/ - -//#define CHECK_DERIVATIVES - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "matrix.h" -#include "nrutil.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -void PdfFit::mrqmin(vector &a, vector &ia, matrix &covar, - matrix &alpha, double &chisq, double &alamda, bool deriv) -{ - using std::copy; - - int ma = a.size(); - double** _covar = new double*[ma]; - double** _alpha = new double*[ma]; - double* _a = new double[ma]; - - copy(a.begin(), a.end(), _a); - - for (int i = 0; i < ma; i++) - { - _covar[i] = &covar[i][0]-1; - _alpha[i] = &alpha[i][0]-1; - } - - int* iaptr = ia.size() ? &(ia[0]) - 1 : NULL; - mrqmin(_a-1, iaptr, ma, _covar-1, _alpha-1, &chisq, &alamda, deriv); - - copy(_a, _a + ma, a.begin()); - - delete [] _a; - delete [] _alpha; - delete [] _covar; -} - - -// Levenberg-Marquardt method, attempting to reduce the value Chi2 of a fit -// between a set of data points x[1..ndata], y[1..ndata] with individual -// standard deviations sig[1..ndata], and a nonlinear function dependent on ma -// coeffcients a[1..ma]. The input array ia[1..ma] indicates by nonzero -// entries those components of a that should be fitted for, and by zero entries -// those components that should be held fixed at their input values. The -// program re- turns current best-fit values for the parameters a[1..ma], and -// Chi2=chisq. The arrays covar[1..ma][1..ma], alpha[1..ma][1..ma] are used as -// working space during most iterations. Supply a routine -// funcs(x,a,yfit,dyda,ma) that evaluates the fitting function yfit, and its -// derivatives dyda[1..ma] with respect to the fitting parameters a at x. On -// the first call provide an initial guess for the parameters a, and set -// alamda<0 for initialization (which then sets alamda=.001). If a step -// succeeds chisq becomes smaller and alamda de- creases by a factor of 10. If -// a step fails alamda grows by a factor of 10. You must call this routine -// repeatedly until convergence is achieved. Then, make one final call with -// alamda=0, so that covar[1..ma][1..ma] returns the covariance matrix, and -// alpha the curvature matrix. (Parameters held fixed will return zero -// covariances.) -void PdfFit::mrqmin(double a[], int ia[], int ma, double **covar, double **alpha, double *chisq, double *alamda, bool deriv) -{ - void covsrt(double **covar, int ma, int ia[], int mfit); - void gaussj(double **a, int n, double **b, int m); - - int j, k, l; - static int mfit; - static double ochisq, *atry, *beta, *da, **oneda; - - if (*alamda < 0.0) - { - // Initialization. - atry = dvector(1, ma); - beta = dvector(1, ma); - da = dvector(1, ma); - - for (mfit = 0, j = 1; j <= ma; j++) - if (ia[j]) mfit++; - - oneda = dmatrix(1, mfit, 1, 1); - *alamda = 0.001; - mrqcof(a, ia, ma, alpha, beta, chisq, deriv); - ochisq=(*chisq); - for (j = 1; j <= ma; j++) atry[j]=a[j]; - - *pout << "\n******************************** ITER: " << fit.iter << " ********************************\n"; - fit.fit_rw = sqrt(ochisq/fit.wnorm); - fit.redchisq = ochisq/(fit.ntot-fit.ndof); - fit.out(); - *pout << " chisq.: " << ochisq << " red.chisq.: " << fit.redchisq << " Rw: " << fit.fit_rw << endl; - } - // Alter linearized fitting matrix, by augmenting diagonal elements. - for (j = 1; j <= mfit; j++) - { - for (k = 1; k <= mfit; k++) covar[j][k]=alpha[j][k]; - covar[j][j]=alpha[j][j]*(1.0+(*alamda)); - oneda[j][1]=beta[j]; - } - - //=================================================================== -#if defined(TEST) - print(covar, mfit); double **save = dmatrix(1, mfit, 1, mfit); - for(int i = 1; i <= mfit; i++) for(j = 1; j <= mfit; j++) save[i][j] = covar[i][j]; - for(int i = 1; i <= mfit; i++) printf("%lg ", oneda[i][1]); printf("\n"); -#endif - //=================================================================== - - gaussj(covar, mfit, oneda, 1); // Matrix solution. - - //=================================================================== -#if defined(TEST) - double res; - for(int i = 1; i <= mfit; i++) - { - res = 0; - for(j = 1; j <= mfit; j++) - res += save[i][j]*oneda[j][1]; printf("%lg ", res); - } - printf("\n"); -#endif - //================================================================= - - for (j = 1; j <= mfit; j++) da[j]=oneda[j][1]; - if (*alamda == 0.0) { // Once converged, evaluate covariance matrix. - covsrt(covar, ma, ia, mfit); - covsrt(alpha, ma, ia, mfit); // Spread out alpha to its full size too. - free_dmatrix(oneda, 1, mfit, 1, 1); - free_dvector(da, 1, ma); - free_dvector(beta, 1, ma); - free_dvector(atry, 1, ma); - return; - } - for (j = 0, l = 1; l <= ma; l++) // Did the trial succeed? - if (ia[l]) atry[l]=a[l]+da[++j]; - mrqcof(atry, ia, ma, covar, da, chisq, deriv); - if (*chisq < ochisq) { // Success, accept the new solution. - *alamda *= 0.1; - ochisq=(*chisq); - for (j = 1; j <= mfit; j++) { - for (k = 1; k <= mfit; k++) alpha[j][k]=covar[j][k]; - beta[j]=da[j]; - } - for (l = 1; l <= ma; l++) a[l]=atry[l]; - } else { // Failure, increase alamda and return. - *alamda *= 10.0; - *chisq = ochisq; - } -} - -// Used by mrqmin to evaluate the linearized fitting matrix alpha, and -// vector beta as in (15.5.8), and calculate Chi2. -void PdfFit::mrqcof(double a[], int ia[], int ma, double **alpha, double beta[], double *chisq, bool deriv) -{ - int i, j, k, l, m, mfit = 0; - double wt, sig2i, dy, *dyda; - //double ymod; - - dyda = dvector(1, ma); - for (j = 1; j <= ma; j++) - if (ia[j]) mfit++; - for (j = 1; j <= mfit; j++) { // Initialize (symmetric) alpha, beta. - for (k = 1; k <= j; k++) alpha[j][k]=0.0; - beta[j]=0.0; - } - - // careful: a of mrqcof is in fact atry of mrqmin! - for (j = 1; j <= ma; j++) - fit.p[j-1] = a[j]; - - // printf("a=%.12lg %.12lg %.12lg\n", a[1], a[2], a[3]); - - fit_theory(deriv, false); // yields pdftot and derivatives wrt parameters - - //============================================================================= -#if !defined(CHECK_DERIVATIVES) - // deriv: true for analytic derivatives, false for numerical ones - if (!deriv) -#endif - { -#if defined(CHECK_DERIVATIVES) - matrix dersave = datasets[0]->fit_b; -#endif - - // numerical derivative - vector > pdfsave; - for (int is = 0; is < nset; is++) - { - pdfsave.push_back(datasets[is]->pdftot); - - // fit_b used both in numerical and analytical derivative case - datasets[is]->fit_b.clear(); - datasets[is]->fit_b.resize(datasets[is]->ncmax+1, fit.psize()); - } - - double psave; - - if (fit.psize() != ma) { - throw constraintError("Inconsistent number of parameters"); - } - - for (int ip = 0; ip < fit.psize(); ip++) - { - if (!fit.ip[ip]) continue; - - double delta = double_eps*fit.p[ip]; - if (fabs(delta) < double_eps/100) delta = double_eps; - psave = fit.p[ip]; - fit.p[ip] += delta; - fit_theory(false, false); // yields pdftot and derivatives wrt parameters - fit.p[ip] = psave; - - for (int is = 0; is < nset; is++) - { - DataSet* pds = this->datasets[is]; - - for (i = pds->nfmin; i <= pds->nfmax; i++) - { - pds->fit_b[i][ip] = (pds->pdftot[i]-pdfsave[is][i])/delta; - } - } - -#if defined(CHECK_DERIVATIVES) - i = 200; - { - *pout << "DERIVATIVES:: ANALYTIC : " << dersave[i][ip] << endl; - *pout << " NUMERICAL: " << (datasets[0]->pdftot[i]-pdfsave[0][i])/delta - << " (delta[" << fit.id[ip] << "]=" << delta << ")" << endl << endl; - } -#endif - } - for (int is = 0; is < nset; is++) datasets[is]->pdftot = pdfsave[is]; - -#if defined(CHECK_DERIVATIVES) - exit(0); -#endif - } - //============================================================================= - - *chisq = 0.0; - - for (int is = 0; is < nset; is++) - { - DataSet* pds = this->datasets[is]; - pds->cumchisq.clear(); - - for (i = pds->nfmin; i <= pds->nfmax; i++) - { // Summation loop over all data. - - //(*funcs)(x[i], a, &ymod, dyda, ma); - sig2i = pds->wic[i]; - dy = pds->obs[i] - pds->pdftot[i]; - - for (j = 1; j <= ma; j++) - dyda[j] = pds->fit_b[i][j-1]; // of course use fit_b, NOT fit_a - - //if (i==0) printf("dyda=%.12lg %.12lg %.12lg\n", dyda[1], dyda[2], dyda[3]); - - for (j = 0, l = 1; l <= ma; l++) { - if (ia[l]) { - wt = dyda[l]*sig2i; - for (j++, k = 0, m = 1; m <= l; m++) - if (ia[m]) alpha[j][++k] += wt*dyda[m]; - beta[j] += dy*wt; - } - } - double prev = pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); - double chisq_contribution = dy * dy * sig2i; - pds->cumchisq.push_back(prev + chisq_contribution); - } - *chisq += pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); - } - for (j = 2; j <= mfit; j++) // Fill in the symmetric side. - for (k = 1; k < j; k++) alpha[k][j]=alpha[j][k]; - free_dvector(dyda, 1, ma); - //print(alpha, ma); -} - - -// Expand in storage the covariance matrix covar, so as to take into account -// parameters that are being held fixed. (For the latter, return zero -// covariances.) -void covsrt(double **covar, int ma, int ia[], int mfit) -{ - int i, j, k; - for (i = mfit+1; i <= ma; i++) - { - for (j = 1; j <= i; j++) - { - covar[i][j]=covar[j][i]=0.0; - } - } - k = mfit; - for (j = ma; j >= 1; j--) { - if (ia[j]) - { - for (i = 1; i <= ma; i++) swap(covar[i][k], covar[i][j]); - for (i = 1; i <= ma; i++) swap(covar[k][i], covar[j][i]); - k--; - } - } -} - -// End of file diff --git a/libpdffit2/scatlen.cc b/libpdffit2/scatlen.cc deleted file mode 100644 index 81beee03..00000000 --- a/libpdffit2/scatlen.cc +++ /dev/null @@ -1,114 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Phase methods for accessing scattering factors. -* -* Comments: Up to date with 1.3.10 Fortran version. -* In Fortran this was fourier.f -* -***********************************************************************/ - -#include -#include - -#include "LocalPeriodicTable.h" -#include "StringUtils.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -void Phase::show_scat(char tp) -{ - *pout << get_scat_string(tp); -} - -string Phase::get_scat_string(char tp) -{ - stringstream sout; - vector::iterator atp; - for (atp = atom_types.begin(); atp != atom_types.end(); ++atp) - { - sout << get_scat_string(tp, *atp); - } - return sout.str(); -} - -string Phase::get_scat_string(char tp, string smbpat) -{ - const LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp = lpt->lookup(smbpat); - return get_scat_string(tp, atp); -} - -string Phase::get_scat_string(char tp, const AtomType* atp) -{ - stringstream sout; - string usymbol = toupper(atp->symbol); - switch(tp) - { - case 'n': - case 'N': - sout << "Neutron scattering length for " << usymbol << " : "; - break; - case 'x': - case 'X': - sout << "X-ray scattering factor for " << usymbol << " : "; - break; - } - // this also throws runtime_error for invalid tp value - sout << atp->sf(tp); - return sout.str(); -} - -void Phase::set_scat(char tp, const string& smbpat, double value) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const string& stdsmbl = lpt->lookup(smbpat)->symbol; - switch (tp) - { - case 'n': - case 'N': - lpt->setNsf(stdsmbl, value); - break; - case 'x': - case 'X': - lpt->setXsf(stdsmbl, value); - break; - default: - ostringstream emsg; - emsg << "Invalid scattering type '" << tp << "'"; - throw runtime_error(emsg.str()); - } - const AtomType* atp = lpt->symbol(stdsmbl); - *pout << get_scat_string(tp, atp); -} - -void Phase::reset_scat(const string& smbpat) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp = lpt->lookup(smbpat); - const string& stdsmbl = atp->symbol; - lpt->reset(stdsmbl); - *pout << get_scat_string('N', stdsmbl); - *pout << get_scat_string('X', stdsmbl); -} - - -LocalPeriodicTable* Phase::getPeriodicTable() -{ - return &this->_local_periodic_table; -} - - -// End of file diff --git a/libpdffit2/stru.cc b/libpdffit2/stru.cc deleted file mode 100644 index f9022f23..00000000 --- a/libpdffit2/stru.cc +++ /dev/null @@ -1,837 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit and Phase methods for reading and saving the structure, -* and for calculating bond lengths and angles. -* -* Comments: -* -***********************************************************************/ - -// Up to date with 1.3.10 Fortran version - -#include -#include -#include -#include - -#include "PointsInSphere.h" -#include "LocalPeriodicTable.h" -#include "Atom.h" -#include "StringUtils.h" -#include "PairDistance.h" -#include "MathUtils.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - - -/*********************************************************************** -* local helper routines -***********************************************************************/ - -namespace { - -// Read a number and an eventual comma delimiter or EOF -template Type vget(istringstream &fin, char delim) -{ - char c; - Type val; - - fin >> val; - - // Return if reading error - if (!fin) { - string line; - fin.clear(); - fin >> line; - throw vgetException(line); - } - if (!fin) return 0; - - // check on end of file before looking for delimiter - if (fin.eof()) return val; - - // read eventual delimiter - fin >> c; - - // if a character c has been read and it is not the expected - // delimiter: put back for next reading - if (fin && c != delim) fin.unget(); - - // clear any error in case no delimiter could be read - if (!fin) fin.clear(); - - return val; -} - -// read space delimited value -template Type vget(istringstream &fin) -{ - Type val; - fin >> val; - return val; -} - -// read space or comma delimited double -double dget(istringstream &fin) -{ - return vget(fin, ','); -} - -// read space or comma delimited integer -int iget(istringstream &fin) -{ - return vget(fin, ','); -} - - -// strip leading spaces -string lstrip(const string &line) -{ - string naked; - string::size_type i = line.find_first_not_of(" \t"); - if (i != string::npos) naked = line.substr(i); - return naked; -} - -// substitute all occurences of literal pattern with new string -void substitute(string& s, const string& pat, const string& sub) -{ - string::size_type p; - string::size_type start = 0; - for (p = s.find(pat, start); p != string::npos; p = s.find(pat, start)) - { - s = s.replace(p, pat.size(), sub); - start = p + sub.size(); - } -} - - -} // local namespace - - -/*********************************************************************** -* Read a structure file. -***********************************************************************/ -int PdfFit::read_struct(string structfile) -{ - Phase* ph = new Phase(); - try { - ph->read_struct(nphase+1, structfile); - } - catch(Exception e) { - delete ph; - // Moved error catching to python bindings. - throw; - } - this->phase.push_back(ph); - this->total += ph->natoms; - this->nphase++; - this->selphaseForEachDataSet(ph); - this->setphase(this->nphase); - ph->show_lattice(); - return 1; -} - -/*********************************************************************** - Wed Oct 12 2005 - CLF - Read a structure from a storage string. -*************************************************************************/ -int PdfFit::read_struct_string(char * buffer) -{ - Phase* ph = new Phase(); - try { - ph->read_struct_string(nphase+1, buffer); - } - catch(Exception e) { - delete ph; - throw; - } - this->phase.push_back(ph); - this->total += ph->natoms; - this->nphase++; - this->selphaseForEachDataSet(ph); - this->setphase(this->nphase); - ph->show_lattice(); - return 1; -} - -void Phase::read_struct(int _iphase, string structfile) -{ - ifstream fstruct; - - fstruct.open(structfile.c_str()); - if (!fstruct) throw IOError("File does not exist"); - - read_struct_stream(_iphase, fstruct); -} - -void Phase::read_struct_string(int _iphase, char * buffer) -{ - istringstream fstruct(buffer); - read_struct_stream(_iphase, fstruct); -} - -void Phase::read_struct_stream(int _iphase, istream& fstruct) -{ - double tot; - bool ldiscus; - - iphase = _iphase; - natoms = 0; - - read_header(fstruct, ldiscus); - - if (ldiscus) - { - *pout << " Structure file format : DISCUS (converting B -> Uij) \n"; - Atom::streamformat = Atom::DISCUS; - } - else - { - *pout << " Structure file format : PDFFIT\n"; - Atom::streamformat = Atom::PDFFIT; - } - - read_atoms(fstruct); - // update atom_types - atom_types.clear(); - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - if (!count(atom_types.begin(), atom_types.end(), ai->atom_type)) - { - atom_types.push_back(ai->atom_type); - } - } - - lattice(); - - tot = icc[0]*icc[1]*icc[2]*ncatoms; - - if (tot != natoms) - { - throw structureError("Inconsistent # of atoms in structure"); - } -} - - -/****************************************************************** - This subroutine reads the header of a structure file - Wed Oct 12 2005 - CLF - Changed ifstream to istream to accomodate stringstreams - as well. -********************************************************************/ - -void Phase::read_header(istream &fstruct, bool &ldiscus) -{ - string ier_msg; - string befehl, line; - - - // initialize format type to discuss format - ldiscus = true; - - /* parse structure file header and fill phase variables */ - - while (getline(fstruct, line)) - { - istringstream sline(line); - string action; - - // try to read a command from structure file - // if an error occurs, an exception will be caught - try{ - sline >> befehl; - - // get out if we get to atom positions - if (befehl == "atoms") break; - - // skip comments, i.e., when befehl starts with '#' - else if (befehl.find('#') == 0) continue; - - // format - else if (befehl == "format") - { - string format; - sline >> format; - ldiscus = (format != "pdffit"); - } - - // scale factor (PDFFIT) - else if (befehl == "scale") - { - action = "Reading scale factor"; - this->pscale = dget(sline); - this->dpscale = 0.0; - if (!sline) - { - throw structureError(action); - } - } - - // peak sharpening factors (PDFFIT) - else if (befehl == "sharp") - { - action = "reading sharpening parameters"; - double v0 = 0.0, v1 = 0.0, v2 = 0.0, v3 = 0.0; - // at least 3-parameters must be read without error - v0 = dget(sline); - v1 = dget(sline); - v2 = dget(sline); - // we have new format if we can read the 4th parameter - try { - v3 = dget(sline); - delta2 = v0; - delta1 = v1; - sratio = v2; - rcut = v3; - } - // if reading of 4th parameter fails, assume old format - catch(vgetException) { - delta2 = v0; - delta1 = 0.0; - sratio = v1; - rcut = v2; - } - ddelta2 = 0.0; - dsratio = 0.0; - ddelta1 = 0.0; - } - - // space group symbol (only to save it later for DISCUS use) - else if (befehl == "spcgr") - { - sline >> spcgr; - } - - // particle shape corrections - else if (befehl == "shape") - { - action = "reading particle shape correction data"; - string shapedata; - getline(sline, shapedata); - substitute(shapedata, ",", " "); - istringstream shapestream(shapedata); - string w; - shapestream >> w; - if (w == "sphere") - { - this->spdiameter = dget(shapestream); - } - else if (w == "stepcut") - { - this->stepcut = dget(shapestream); - } - else - { - ostringstream emsg; - emsg << " Unknown shape correction: " << w; - throw structureError(emsg.str()); - } - } - - // title / name for structure - else if (befehl == "title") - { - getline(sline, name); - // getline keeps leading whitespace - name = lstrip(name); - } - - // cell constants - else if (befehl == "cell") - { - action = "reading unit cell parameters"; - a0[0] = dget(sline); - a0[1] = dget(sline); - a0[2] = dget(sline); - win[0] = dget(sline); - win[1] = dget(sline); - win[2] = dget(sline); - } - - // standard deviation of cell constants - else if (befehl == "dcell") - { - action = "reading standard deviation of unit cell parameters"; - da0[0] = dget(sline); - da0[1] = dget(sline); - da0[2] = dget(sline); - dwin[0] = dget(sline); - dwin[1] = dget(sline); - dwin[2] = dget(sline); - } - - // crystal dimensions and number of atoms per unit cell 'ncell' - else if (befehl == "ncell") - { - action = "reading # atoms/unit cell"; - icc[0] = iget(sline); - icc[1] = iget(sline); - icc[2] = iget(sline); - ncatoms = iget(sline); - } - - // show warning message otherwise - else - { - *pout << " ****WARN**** Unknown keyword: " << - befehl << " (ignored) ****\n"; - } - } // end of try - // catch vget-exception and throw the specific exception - catch(vgetException e) { throw structureError(action+e.GetMsg()); } - } -} - -void Phase::read_atoms(istream& fstruct) -{ - Atom a; - while (fstruct >> a) - { - reassign_atom_type(&a); - this->atom.push_back(a); - natoms++; - } - return; -} - - -void Phase::reassign_atom_type(Atom* ap) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const string& smbl = ap->atom_type->symbol; - ap->atom_type = lpt->symbol(smbl); -} - - - -/******************************************* -c------ - Save structure for given phase - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -*******************************************/ -string PdfFit::show_struct(int ip) -{ - string filestring = save_struct(ip,""); - return filestring; -} - -string PdfFit::save_struct(int ip, string strucfile) -{ - - stringstream outfilestream; - - if ( (ip < 1) || (ip > nphase) ) - { - throw unassignedError("phase does not exist"); - } - else - { - bool ldiscus=false; - ofstream fout; - - if (!strucfile.empty()) - { - if (ldiscus) - *pout << " Saving structure (DISCUS format) phase " << ip - << " to file : " << strucfile << endl; - else - *pout << " Saving structure phase " << ip << " to file : " - << strucfile << endl; - - phase[ip-1]->save_struct(outfilestream); - - fout.open(strucfile.c_str()); - if (!fout) { - throw IOError("cannot create output file"); - } - fout << outfilestream.str(); - fout.close(); - } - else - { - phase[ip-1]->save_struct(outfilestream); - } - } - - return outfilestream.str(); -} - -/*************************************************************** -c This subroutine saves the structure and/or the unit cell -c onto a file. The format uses keyword description. -****************************************************************/ -template void Phase::save_struct(Stream &fout) -{ - const double fac = 8.0*M_PI*M_PI /3.0; - bool ldis=false; - - // -- Write new type of structure file - - fout << "title " << name << endl; - - fout << setprecision(6) << fixed; - - if (!ldis) - { - fout << "format pdffit" << endl; - fout << "scale " << setw(9) << pscale << endl; - fout << "sharp " << setw(9) << delta2 << ", " << setw(9) << delta1 << ", " - << setw(9) << sratio << ", " << setw(9) << rcut << endl; - } - - fout << "spcgr " << spcgr << endl; - - if (spdiameter > 0.0) - { - fout << "shape sphere, " << spdiameter << endl; - } - - if (stepcut > 0.0) - { - fout << "shape stepcut, " << stepcut << endl; - } - - fout << "cell "; - for (int i=0; i<3; i++) - fout << setw(9) << a0[i] << ", "; - - for (int i=0; i<3; i++) - { - fout << setw(9) << win[i]; - if (i!=2) - fout << ", "; - else - fout << endl; - } - - if (!ldis) - { - fout << "dcell "; - for (int i=0; i<3; i++) - fout << setw(9) << da0[i] << ", "; - - for (int i=0; i<3; i++) - { - fout << setw(9) << dwin[i]; - if (i!=2) - fout << ", "; - else - fout << endl; - } - } - - fout << "ncell "; - for (int i=0; i<3; i++) - fout << setw(9) << icc[i] << ", "; - fout << setw(9) << ncatoms << endl; - - fout << "atoms" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - - if (ldis) - { - double dw = fac*(ai->u[1]+ai->u[2]+ai->u[3]); - fout << setw(4) << left << ai->atom_type->symbol; - fout << right << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; - fout << ' ' << setw(12) << dw << endl; - } - else - { - fout << setw(4) << left << ai->atom_type->symbol; - fout << right << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; - fout << ' ' << setw(12) << setprecision(4) << ai->occ << endl; - - fout << " "; - fout << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->dpos[i]; - fout << ' ' << setw(12) << setprecision(4) << ai->docc << endl; - - fout << " "; - fout << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->u[i]; - fout << endl; - - fout << " "; - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->du[i]; - fout << endl; - - fout << " "; - for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->u[i]; - fout << endl; - - fout << " "; - for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->du[i]; - fout << endl; - } - } -} - - -/*************************************** -c Calculate bond angles with errors -****************************************/ -pair PdfFit::bond_angle(int ia, int ja, int ka) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_angle(ia, ja, ka); -} - -/*********************************************************************** -* shift to equivalent lattice position that is nearest to the origin -***********************************************************************/ -void Phase::make_nearest(double xyz[3]) -{ - // first shift to the first unit cell - for (int i = 0; i !=3; ++i) - { - // MS compatibility - use fmod instead of remainder - xyz[i] = fmod(xyz[i], icc[i]); - } - // that is all in orthogonal cell or if we get to the origin - if ( (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0) || - (win[0] == 90.0 && win[1] == 90.0 && win[2] == 90.0) ) - { - return; - } - // otherwise we need to check all cells around - // first, let us shift to octant with xyz[i] <= 0.0 - for (int i = 0; i != 3; ++i) - { - if (xyz[i] > 0.0) xyz[i] -= icc[i]; - } - double nearest[3] = { xyz[0], xyz[1], xyz[2] }; - double mindsquare = skalpro(nearest, nearest); - double test[3]; - for (test[0] = xyz[0]; test[0] < icc[0]; test[0] += icc[0]) - { - for (test[1] = xyz[1]; test[1] < icc[1]; test[1] += icc[1]) - { - for (test[2] = xyz[2]; test[2] < icc[2]; test[2] += icc[2]) - { - double dsquare = skalpro(test,test); - if (dsquare < mindsquare) - { - copy(test, test+3, nearest); - dsquare = mindsquare; - } - } - } - } - copy(nearest, nearest+3, xyz); -} - -pair Phase::bond_angle(int ia, int ja, int ka) -{ - double x[3], y[3], dx[3], dy[3], xx, yy, xy, dxx, dyy, dxy, arg, darg, ang, dang; - - - if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) - || (ka < 1) || (ka > natoms)) - { - stringstream eout; - eout << "Incorrect atom number(s): " << ia << ", " << ja << ", " << ka; - throw ValueError(eout.str()); - } - if ( ia == ja || ia == ka || ja == ka ) - { - stringstream eout; - eout << "All atoms must be different: " << ia << ", "; - eout << ja << ", " << ka; - throw ValueError(eout.str()); - } - - Atom& ai = atom[ia - 1]; - Atom& aj = atom[ja - 1]; - Atom& ak = atom[ka - 1]; - - for (int i=0; i<3; i++) - { - x[i] = aj.pos[i] - ai.pos[i]; - y[i] = aj.pos[i] - ak.pos[i]; - dx[i] = aj.dpos[i] + ai.dpos[i]; - dy[i] = aj.dpos[i] + ak.dpos[i]; - } - - make_nearest(x); - make_nearest(y); - xx = sqrt(skalpro(x,x)); - yy = sqrt(skalpro(y,y)); - xy = skalpro(x,y); - - dxx = 0.5/xx*dskalpro(x,x,dx,dx); - dyy = 0.5/yy*dskalpro(y,y,dy,dy); - dxy = dskalpro(x,y,dx,dy); - arg = xy/(xx*yy); - ang = acosd(arg); - darg = (1.0/(xx*yy)*dxy + arg/xx*dxx +arg/yy*dyy); - if (arg != 1.0) - dang = fabs(1.0/sqrt(1.0-arg*arg)/rad*darg); - else - dang = 0.0; - - pair rv(ang, dang); - - return rv; -} - -/*************************************** -c Calculate bond lengths with errors -****************************************/ -PairDistance PdfFit::bond_length_atoms(int ia, int ja) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_length_atoms(ia, ja); -} - -PairDistance Phase::bond_length_atoms(int ia, int ja) -{ - double d[3], dd[3], dist, ddist; - - // -- Simple distance between given atoms - - if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) ) - { - - stringstream eout; - eout << "Incorrect atom number(s): " << ia << ", " << ja; - throw ValueError(eout.str()); - } - - Atom& ai = atom[ia-1]; - Atom& aj = atom[ja-1]; - - for (int jj=0; jj<3; jj++) - { - d[jj] = ai.pos[jj] - aj.pos[jj]; - dd[jj] = ai.dpos[jj] + aj.dpos[jj]; - } - make_nearest(d); - dist = sqrt(skalpro(d,d)); - ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; - - PairDistance pd; - pd.dij = dist; - pd.ddij = ddist; - pd.i = ia; - pd.j = ja; - - return pd; -} - - -vector PdfFit::bond_length_types(string symi, string symj, - double bmin, double bmax) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_length_types(symi, symj, bmin, bmax); -} - -vector Phase::bond_length_types(string symi, string symj, - double bmin, double bmax) -{ - double d[3], dd[3], dist, ddist; - set iselection, jselection; - iselection = selectAtomsOf(symi); - jselection = selectAtomsOf(symj); - - // ---- Get all bonds in specified range - - // calculate range for PointsInSphere sequencer - // (negative rsphmin is no problem) - double buffzone = circum_diameter(); - double rsphmin = bmin - buffzone; - double rsphmax = bmax + buffzone; - PointsInSphere sph( rsphmin, rsphmax, a0[0]*icc[0], - a0[1]*icc[1], a0[2]*icc[2], - win[0], win[1], win[2] ); - - // -- Loop over all atoms within the crystal - vector rv; - set::iterator ia, ja; - for (ia = iselection.begin(); ia != iselection.end(); ++ia) - { - for (ja = jselection.begin(); ja != jselection.end(); ++ja) - { - for (sph.rewind(); !sph.finished(); sph.next()) - { - for (int jj=0; jj<3; jj++) - { - d[jj] = atom[*ia].pos[jj] - atom[*ja].pos[jj] - - sph.mno[jj]*icc[jj]; - dd[jj] = atom[*ia].dpos[jj] + atom[*ja].dpos[jj]; - } - dist = sqrt(skalpro(d,d)); - if ( (dist >= bmin) && (dist <= bmax) ) - { - ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; - PairDistance pd; - pd.dij = dist; - pd.ddij = ddist; - pd.i = *ia + 1; - pd.j = *ja + 1; - rv.push_back(pd); - } - } - } - } - stable_sort(rv.begin(), rv.end()); - return rv; -} - -set Phase::selectAtomsOf(string symbol) -{ - set selection; - if (toupper(symbol) == "ALL") - { - for (size_t i = 0; i != size_t(natoms); ++i) selection.insert(i); - return selection; - } - // here we need to find AtomType - LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp; - try - { - atp = lpt->lookup(symbol); - } - catch (ValueError e) - { - ostringstream emsg; - emsg << "Incorrect atom type '" << symbol << "'"; - throw ValueError(emsg.str()); - } - for (size_t i = 0; i != size_t(natoms); ++i) - { - if (atom[i].atom_type == atp) selection.insert(i); - } - return selection; -} - -// End of file diff --git a/libpdffit2/support_msvc9.h b/libpdffit2/support_msvc9.h deleted file mode 100644 index cb4bbf70..00000000 --- a/libpdffit2/support_msvc9.h +++ /dev/null @@ -1,13 +0,0 @@ -/*********************************************************************** -* Python 2.7 needs MSVC 9.0 which does not have unique_ptr. -* Work around by substituting auto_ptr instead. -***********************************************************************/ - -#ifdef _MSC_VER - -// workarounds for MSVC 9.0 -------------------------------------------- -#if _MSC_VER <= 1500 -#define unique_ptr auto_ptr -#endif - -#endif // _MSC_VER diff --git a/libpdffit2/tests/Makefile b/libpdffit2/tests/Makefile deleted file mode 100644 index f6bfe566..00000000 --- a/libpdffit2/tests/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -######################################################################## -# Targets: alltests unittests -# -# Comments: This Makefile is for building and running C++ unit tests -# on the libpdffit2 sources. Intended for developers, not for the end -# users who just want to build pdffit2 from sources. -# -######################################################################## - - -# compiler options -CPPFLAGS += -I../ $(shell cppunit-config --cflags) -LDLIBS += $(shell cppunit-config --libs) - - -# default target -all: unittest - - -# build unit test driver -alltests: alltests.cc \ - TestPointsInSphere.cc ../PointsInSphere.cc - - -# execute unit tests -unittest: alltests - ./alltests - - -# clean up any generated files -clean: - rm -f alltests diff --git a/libpdffit2/tests/TestPointsInSphere.cc b/libpdffit2/tests/TestPointsInSphere.cc deleted file mode 100644 index b82fcb31..00000000 --- a/libpdffit2/tests/TestPointsInSphere.cc +++ /dev/null @@ -1,228 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Unit tests for PointsInSphere module -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include - -#include "PointsInSphere.h" - -using namespace std; -using namespace NS_POINTSINSPHERE; - -namespace { - -const double eps = 1.0e-12; - -struct vidxgroup -{ - double vijk[4]; - vidxgroup(double v, int* ijk) - { - vijk[0] = v; - for (size_t i = 0; i != 3; ++i) { vijk[i+1] = ijk[i]; } - } - vidxgroup(double v, int i, int j, int k) - { - vijk[0] = v; vijk[1] = i; vijk[2] = j; vijk[3] = k; - } -}; - -bool operator<(const vidxgroup &x, const vidxgroup &y) -{ - return (x.vijk[0] < y.vijk[0] - eps) || - lexicographical_compare(x.vijk+1, x.vijk+4, y.vijk+1, y.vijk+4); -} - -bool operator==(const vidxgroup &x, const vidxgroup &y) -{ - bool eq = (fabs(x.vijk[0] - y.vijk[0]) < eps) && - equal(x.vijk+1, x.vijk+4, y.vijk+1); - return eq; -} - -ostream& operator<<(ostream &s, const vidxgroup &x) -{ - return s << "<" << x.vijk[0] << ";" << int(x.vijk[1]) - << ',' << int(x.vijk[2]) << ',' << int(x.vijk[3]) << '>'; -} - -} // namespace - -//////////////////////////////////////////////////////////////////////// -// TestPointsInSphere -//////////////////////////////////////////////////////////////////////// - -class TestPointsInSphere : public CppUnit::TestFixture -{ - - CPPUNIT_TEST_SUITE(TestPointsInSphere); - CPPUNIT_TEST(test_Cubic); - CPPUNIT_TEST(test_Orthorombic); - CPPUNIT_TEST(test_Hexagonal); - CPPUNIT_TEST(test_FCC); - CPPUNIT_TEST_SUITE_END(); - -private: - - LatticeParameters* latpar; - -public: - - void setUp() - { - latpar = new LatticeParameters(1, 1, 1, 90, 90, 90); - } - - void tearDown() - { - delete latpar; - } - -private: - - int count(double Rmin, double Rmax) - { - int c = 0; - for ( PointsInSphere sph(Rmin, Rmax, *latpar); - not sph.finished(); sph.next(), ++c ) - { } - return c; - } - - vector sortedPoints(double Rmin, double Rmax) - { - vector ridx; - for ( PointsInSphere sph(Rmin, Rmax, *latpar); - not sph.finished(); sph.next() ) - { - ridx.push_back(vidxgroup(sph.r(), sph.mno)); - } - sort(ridx.begin(), ridx.end()); - return ridx; - } - -public: - - void test_Cubic() - { - latpar->a = latpar->b = latpar->c = 1.0; - latpar->alpha = latpar->beta = latpar->gamma = 90.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(0, count(0.0, 0.0)); - CPPUNIT_ASSERT_EQUAL(0, count(eps, 0.5)); - CPPUNIT_ASSERT_EQUAL(0, count(1.0 + eps, 1.1)); - CPPUNIT_ASSERT_EQUAL(1, count(0.0, eps)); - CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1 + eps)); - CPPUNIT_ASSERT_EQUAL(19, count(0.0, sqrt(2.0) + eps)); - CPPUNIT_ASSERT_EQUAL(12, count(1.0 + eps, sqrt(2.0) + eps)); - } - - void test_Orthorombic() - { - latpar->a = 1.0; latpar->b = 2.0; latpar->c = 3.0; - latpar->alpha = latpar->beta = latpar->gamma = 90.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(3, count(0.0, 1.1)); - CPPUNIT_ASSERT_EQUAL(4, count(1.9, 2.1)); - vidxgroup ep[] = { - vidxgroup(0, 0, 0, 0), - vidxgroup(1, -1, 0, 0), - vidxgroup(1, 1, 0, 0), - vidxgroup(2, -2, 0, 0), - vidxgroup(2, 0, -1, 0), - vidxgroup(2, 0, 1, 0), - vidxgroup(2, 2, 0, 0), - vidxgroup(sqrt(5.0), -1, -1, 0), - vidxgroup(sqrt(5.0), -1, 1, 0), - vidxgroup(sqrt(5.0), 1, -1, 0), - vidxgroup(sqrt(5.0), 1, 1, 0), - vidxgroup(sqrt(8.0), -2, -1, 0), - vidxgroup(sqrt(8.0), -2, 1, 0), - vidxgroup(sqrt(8.0), 2, -1, 0), - vidxgroup(sqrt(8.0), 2, 1, 0), - vidxgroup(3, -3, 0, 0), - vidxgroup(3, 0, 0, -1), - vidxgroup(3, 0, 0, 1), - vidxgroup(3, 3, 0, 0), - }; - vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); - vector act_pts = sortedPoints(0.0, 3.0+eps); - CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); - for (size_t i = 0; i != exp_pts.size(); ++i) - { - CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); - } - } - - void test_Hexagonal() - { - latpar->a = 1.0; latpar->b = 1.0; latpar->c = 2.0; - latpar->alpha = latpar->beta = 90.0; latpar->gamma = 120.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1+eps)); - vidxgroup ep[] = { - vidxgroup(0, 0, 0, 0), - vidxgroup(1, -1, -1, 0), - vidxgroup(1, -1, 0, 0), - vidxgroup(1, 0, -1, 0), - vidxgroup(1, 0, 1, 0), - vidxgroup(1, 1, 0, 0), - vidxgroup(1, 1, 1, 0), - vidxgroup(sqrt(3.0), -2, -1, 0), - vidxgroup(sqrt(3.0), -1, -2, 0), - vidxgroup(sqrt(3.0), -1, 1, 0), - vidxgroup(sqrt(3.0), 1, -1, 0), - vidxgroup(sqrt(3.0), 1, 2, 0), - vidxgroup(sqrt(3.0), 2, 1, 0), - vidxgroup(2, -2, -2, 0), - vidxgroup(2, -2, 0, 0), - vidxgroup(2, 0, -2, 0), - vidxgroup(2, 0, 0, -1), - vidxgroup(2, 0, 0, 1), - vidxgroup(2, 0, 2, 0), - vidxgroup(2, 2, 0, 0), - vidxgroup(2, 2, 2, 0), - }; - vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); - vector act_pts = sortedPoints(0.0, 2.0+eps); - CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); - for (size_t i = 0; i != exp_pts.size(); ++i) - { - CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); - } - } - - void test_FCC() - { - latpar->a = latpar->b = latpar->c = sqrt(0.5); - latpar->alpha = latpar->beta = latpar->gamma = 60.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(13, count(0.0, sqrt(0.5)+eps)); - CPPUNIT_ASSERT_EQUAL(19, count(0.0, 1.0+eps)); - } - -}; - -// Registers the fixture into the 'registry' -CPPUNIT_TEST_SUITE_REGISTRATION(TestPointsInSphere); - -// End of file diff --git a/libpdffit2/tests/alltests.cc b/libpdffit2/tests/alltests.cc deleted file mode 100644 index 318cb4b3..00000000 --- a/libpdffit2/tests/alltests.cc +++ /dev/null @@ -1,46 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Unit tests driver -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -using namespace std; -using namespace CppUnit; - -int main() -{ - // Get the top level suite from the registry - Test *suite = TestFactoryRegistry::getRegistry().makeTest(); - - // Adds the test to the list of test to run - TextUi::TestRunner runner; - runner.addTest( suite ); - - // Change the default outputter to a compiler error format outputter - runner.setOutputter( new CompilerOutputter(&runner.result(), cerr) ); - // Run the tests. - bool wasSucessful = runner.run(); - - // Return error code 1 if the one of test failed. - return wasSucessful ? EXIT_SUCCESS : EXIT_FAILURE; -} - -// End of file diff --git a/pdffit2module/PyFileStreambuf.h b/pdffit2module/PyFileStreambuf.h deleted file mode 100644 index 3a2bc383..00000000 --- a/pdffit2module/PyFileStreambuf.h +++ /dev/null @@ -1,97 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PyFileStreambuf -* -* Comments: PyFileStreambuf is a C++ streambuf which writes to a python -* file-like object. The python file can be changed anytime by -* calling the redirect() method. -* -* Examples: // redirect std::cout -* std::cout.rdbuf( PyFileStreambuf(PyObject* python_file) ); -* -***********************************************************************/ - -#ifndef PYFILESTREAMBUF_H_INCLUDED -#define PYFILESTREAMBUF_H_INCLUDED -#define PY_SSIZE_T_CLEAN - -#include -#include - -// MS compatibility fix -#include - -class PyFileStreambuf : public std::streambuf -{ - private: - - // Data members - PyObject* py_file; - - public: - - // Constructor - PyFileStreambuf(PyObject* f) : py_file(f) - { - Py_INCREF(py_file); - } - - // Destructor - ~PyFileStreambuf() - { - Py_DECREF(py_file); - } - - // Methods - PyObject* redirect(PyObject* f) - { - Py_INCREF(f); - Py_DECREF(py_file); - py_file = f; - return py_file; - } - - protected: - - virtual int_type overflow( int_type c) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", &c, 1); - if (rv) { Py_DECREF(rv); } - return c; - } - - virtual std::streamsize xsputn(const char_type* s, std::streamsize n) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", s, n); - if (rv) { Py_DECREF(rv); } - return n; - } - - virtual int sync() - { - if (PyObject_HasAttrString(py_file, "flush")) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "flush", NULL); - if (rv) { Py_DECREF(rv); } - } - return 0; - } - -}; - -#endif // PYFILESTREAMBUF_H_INCLUDED diff --git a/pdffit2module/bindings.cc b/pdffit2module/bindings.cc deleted file mode 100644 index 568e1dd1..00000000 --- a/pdffit2module/bindings.cc +++ /dev/null @@ -1,341 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Method table for python module bindings. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include - -#include "bindings.h" -#include "misc.h" - -// the method table -struct PyMethodDef pypdffit2_methods[] = { - - //copyright - {pypdffit2_copyright__name__, pypdffit2_copyright, - METH_VARARGS, pypdffit2_copyright__doc__}, - - //create - {pypdffit2_create__name__, pypdffit2_create, - METH_VARARGS, pypdffit2_create__doc__}, - - //read_struct - {pypdffit2_read_struct__name__, pypdffit2_read_struct, - METH_VARARGS, pypdffit2_read_struct__doc__}, - - //read_struct_string - {pypdffit2_read_struct_string__name__, pypdffit2_read_struct_string, - METH_VARARGS, pypdffit2_read_struct_string__doc__}, - - //read_data - {pypdffit2_read_data__name__, pypdffit2_read_data, - METH_VARARGS, pypdffit2_read_data__doc__}, - - //read_data_string - {pypdffit2_read_data_string__name__, pypdffit2_read_data_string, - METH_VARARGS, pypdffit2_read_data_string__doc__}, - - //read_data_arrays - {pypdffit2_read_data_arrays__name__, pypdffit2_read_data_arrays, - METH_VARARGS, pypdffit2_read_data_arrays__doc__}, - - //pdfrange - {pypdffit2_pdfrange__name__, pypdffit2_pdfrange, - METH_VARARGS, pypdffit2_pdfrange__doc__}, - - //reset - {pypdffit2_reset__name__, pypdffit2_reset, - METH_VARARGS, pypdffit2_reset__doc__}, - - //alloc - {pypdffit2_alloc__name__, pypdffit2_alloc, - METH_VARARGS, pypdffit2_alloc__doc__}, - - //calc - {pypdffit2_calc__name__, pypdffit2_calc, - METH_VARARGS, pypdffit2_calc__doc__}, - - //refine - {pypdffit2_refine__name__, pypdffit2_refine, - METH_VARARGS, pypdffit2_refine__doc__}, - - //refine_step - {pypdffit2_refine_step__name__, pypdffit2_refine_step, - METH_VARARGS, pypdffit2_refine_step__doc__}, - - //save_pdf - {pypdffit2_save_pdf__name__, pypdffit2_save_pdf, - METH_VARARGS, pypdffit2_save_pdf__doc__}, - - //save_dif - {pypdffit2_save_dif__name__, pypdffit2_save_dif, - METH_VARARGS, pypdffit2_save_dif__doc__}, - - //save_res - {pypdffit2_save_res__name__, pypdffit2_save_res, - METH_VARARGS, pypdffit2_save_res__doc__}, - - //save_struct - {pypdffit2_save_struct__name__, pypdffit2_save_struct, - METH_VARARGS, pypdffit2_save_struct__doc__}, - - //show_struct - {pypdffit2_show_struct__name__, pypdffit2_show_struct, - METH_VARARGS, pypdffit2_show_struct__doc__}, - - //constrain_int - {pypdffit2_constrain_int__name__, pypdffit2_constrain_int, - METH_VARARGS, pypdffit2_constrain_int__doc__}, - - //constrain_str - {pypdffit2_constrain_str__name__, pypdffit2_constrain_str, - METH_VARARGS, pypdffit2_constrain_str__doc__}, - - //setpar_dbl - {pypdffit2_setpar_dbl__name__, pypdffit2_setpar_dbl, - METH_VARARGS, pypdffit2_setpar_dbl__doc__}, - - //setpar_RV - {pypdffit2_setpar_RV__name__, pypdffit2_setpar_RV, - METH_VARARGS, pypdffit2_setpar_RV__doc__}, - - //setvar - {pypdffit2_setvar__name__, pypdffit2_setvar, - METH_VARARGS, pypdffit2_setvar__doc__}, - - //getvar - {pypdffit2_getvar__name__, pypdffit2_getvar, - METH_VARARGS, pypdffit2_getvar__doc__}, - - //getR - {pypdffit2_getR__name__, pypdffit2_getR, - METH_VARARGS, pypdffit2_getR__doc__}, - - //getpdf_fit - {pypdffit2_getpdf_fit__name__, pypdffit2_getpdf_fit, - METH_VARARGS, pypdffit2_getpdf_fit__doc__}, - - //getpdf_obs - {pypdffit2_getpdf_obs__name__, pypdffit2_getpdf_obs, - METH_VARARGS, pypdffit2_getpdf_obs__doc__}, - - //getpdf_diff - {pypdffit2_getpdf_diff__name__, pypdffit2_getpdf_diff, - METH_VARARGS, pypdffit2_getpdf_diff__doc__}, - - //getcrw - {pypdffit2_getcrw__name__, pypdffit2_getcrw, - METH_VARARGS, pypdffit2_getcrw__doc__}, - - //getrw - {pypdffit2_getrw__name__, pypdffit2_getrw, - METH_VARARGS, pypdffit2_getrw__doc__}, - - //getpar - {pypdffit2_getpar__name__, pypdffit2_getpar, - METH_VARARGS, pypdffit2_getpar__doc__}, - - //fixpar - {pypdffit2_fixpar__name__, pypdffit2_fixpar, - METH_VARARGS, pypdffit2_fixpar__doc__}, - - //freepar - {pypdffit2_freepar__name__, pypdffit2_freepar, - METH_VARARGS, pypdffit2_freepar__doc__}, - - //setphase - {pypdffit2_setphase__name__, pypdffit2_setphase, - METH_VARARGS, pypdffit2_setphase__doc__}, - - //setdata - {pypdffit2_setdata__name__, pypdffit2_setdata, - METH_VARARGS, pypdffit2_setdata__doc__}, - - //psel - {pypdffit2_psel__name__, pypdffit2_psel, - METH_VARARGS, pypdffit2_psel__doc__}, - - //pdesel - {pypdffit2_pdesel__name__, pypdffit2_pdesel, - METH_VARARGS, pypdffit2_pdesel__doc__}, - - //selectAtomType - {pypdffit2_selectAtomType__name__, pypdffit2_selectAtomType, - METH_VARARGS, pypdffit2_selectAtomType__doc__}, - - //selectAtomIndex - {pypdffit2_selectAtomIndex__name__, pypdffit2_selectAtomIndex, - METH_VARARGS, pypdffit2_selectAtomIndex__doc__}, - - //selectAll - {pypdffit2_selectAll__name__, pypdffit2_selectAll, - METH_VARARGS, pypdffit2_selectAll__doc__}, - - //selectNone - {pypdffit2_selectNone__name__, pypdffit2_selectNone, - METH_VARARGS, pypdffit2_selectNone__doc__}, - - //bond_angle - {pypdffit2_bond_angle__name__, pypdffit2_bond_angle, - METH_VARARGS, pypdffit2_bond_angle__doc__}, - - //bond_length_atoms - {pypdffit2_bond_length_atoms__name__, pypdffit2_bond_length_atoms, - METH_VARARGS, pypdffit2_bond_length_atoms__doc__}, - - //bond_length_types - {pypdffit2_bond_length_types__name__, pypdffit2_bond_length_types, - METH_VARARGS, pypdffit2_bond_length_types__doc__}, - - //get_scat_string - {pypdffit2_get_scat_string__name__, pypdffit2_get_scat_string, - METH_VARARGS, pypdffit2_get_scat_string__doc__}, - - //get_scat - {pypdffit2_get_scat__name__, pypdffit2_get_scat, - METH_VARARGS, pypdffit2_get_scat__doc__}, - - //set_scat - {pypdffit2_set_scat__name__, pypdffit2_set_scat, - METH_VARARGS, pypdffit2_set_scat__doc__}, - - //reset_scat - {pypdffit2_reset_scat__name__, pypdffit2_reset_scat, - METH_VARARGS, pypdffit2_reset_scat__doc__}, - - //lat - {pypdffit2_lat__name__, pypdffit2_lat, - METH_VARARGS, pypdffit2_lat__doc__}, - - //x - {pypdffit2_x__name__, pypdffit2_x, - METH_VARARGS, pypdffit2_x__doc__}, - - //y - {pypdffit2_y__name__, pypdffit2_y, - METH_VARARGS, pypdffit2_y__doc__}, - - //z - {pypdffit2_z__name__, pypdffit2_z, - METH_VARARGS, pypdffit2_z__doc__}, - - //u11 - {pypdffit2_u11__name__, pypdffit2_u11, - METH_VARARGS, pypdffit2_u11__doc__}, - - //u22 - {pypdffit2_u22__name__, pypdffit2_u22, - METH_VARARGS, pypdffit2_u22__doc__}, - - //u33 - {pypdffit2_u33__name__, pypdffit2_u33, - METH_VARARGS, pypdffit2_u33__doc__}, - - //u12 - {pypdffit2_u12__name__, pypdffit2_u12, - METH_VARARGS, pypdffit2_u12__doc__}, - - //u13 - {pypdffit2_u13__name__, pypdffit2_u13, - METH_VARARGS, pypdffit2_u13__doc__}, - - //u23 - {pypdffit2_u23__name__, pypdffit2_u23, - METH_VARARGS, pypdffit2_u23__doc__}, - - //occ - {pypdffit2_occ__name__, pypdffit2_occ, - METH_VARARGS, pypdffit2_occ__doc__}, - - //pscale - {pypdffit2_pscale__name__, pypdffit2_pscale, - METH_VARARGS, pypdffit2_pscale__doc__}, - - //spdiameter - {pypdffit2_spdiameter__name__, pypdffit2_spdiameter, - METH_VARARGS, pypdffit2_spdiameter__doc__}, - - //stepcut - {pypdffit2_stepcut__name__, pypdffit2_stepcut, - METH_VARARGS, pypdffit2_stepcut__doc__}, - - //sratio - {pypdffit2_sratio__name__, pypdffit2_sratio, - METH_VARARGS, pypdffit2_sratio__doc__}, - - //delta2 - {pypdffit2_delta2__name__, pypdffit2_delta2, - METH_VARARGS, pypdffit2_delta2__doc__}, - - //delta1 - {pypdffit2_delta1__name__, pypdffit2_delta1, - METH_VARARGS, pypdffit2_delta1__doc__}, - - //dscale - {pypdffit2_dscale__name__, pypdffit2_dscale, - METH_VARARGS, pypdffit2_dscale__doc__}, - - //qdamp - {pypdffit2_qdamp__name__, pypdffit2_qdamp, - METH_VARARGS, pypdffit2_qdamp__doc__}, - - //qbroad - {pypdffit2_qbroad__name__, pypdffit2_qbroad, - METH_VARARGS, pypdffit2_qbroad__doc__}, - - //rcut - {pypdffit2_rcut__name__, pypdffit2_rcut, - METH_VARARGS, pypdffit2_rcut__doc__}, - - //get_atoms - {pypdffit2_get_atoms__name__, pypdffit2_get_atoms, - METH_VARARGS, pypdffit2_get_atoms__doc__}, - - //num_atoms - {pypdffit2_num_atoms__name__, pypdffit2_num_atoms, - METH_VARARGS, pypdffit2_num_atoms__doc__}, - - //get_atom_types - {pypdffit2_get_atom_types__name__, pypdffit2_get_atom_types, - METH_VARARGS, pypdffit2_get_atom_types__doc__}, - - //num_phases - {pypdffit2_num_phases__name__, pypdffit2_num_phases, - METH_VARARGS, pypdffit2_num_phases__doc__}, - - //num_datasets - {pypdffit2_num_datasets__name__, pypdffit2_num_datasets, - METH_VARARGS, pypdffit2_num_datasets__doc__}, - - //phase_fractions - {pypdffit2_phase_fractions__name__, pypdffit2_phase_fractions, - METH_VARARGS, pypdffit2_phase_fractions__doc__}, - - //redirect_stdout - {pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout, - METH_VARARGS, pypdffit2_redirect_stdout__doc__}, - - //is_element - {pypdffit2_is_element__name__, pypdffit2_is_element, - METH_VARARGS, pypdffit2_is_element__doc__}, - -// Sentinel - {0, 0} -}; - -// End of file diff --git a/pdffit2module/bindings.h b/pdffit2module/bindings.h deleted file mode 100644 index bf1e1406..00000000 --- a/pdffit2module/bindings.h +++ /dev/null @@ -1,27 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Method table for python module bindings. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_BINDINGS_H -#define PYPDFFIT2_BINDINGS_H - -// the method table -extern struct PyMethodDef pypdffit2_methods[]; - -#endif // PYPDFFIT2_BINDINGS_H diff --git a/pdffit2module/misc.cc b/pdffit2module/misc.cc deleted file mode 100644 index 80198049..00000000 --- a/pdffit2module/misc.cc +++ /dev/null @@ -1,2219 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Bindings from python to c++ PdfFit class. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include -#include -#include -#include -#include -#include -#include -#include - -#include "misc.h" -#include "pyexceptions.h" -#include "PyFileStreambuf.h" -#include "libpdffit2/StringUtils.h" -#include "libpdffit2/LocalPeriodicTable.h" -#include "libpdffit2/pdffit.h" - -// ostream buffer used for engine output redirection -PyFileStreambuf* py_stdout_streambuf = NULL; - -// copyright -char pypdffit2_copyright__doc__[] = ""; -char pypdffit2_copyright__name__[] = "copyright"; - -static char pypdffit2_copyright_note[] = - "pdffit2 python module: Copyright (c) 2005-2016 Simon J. L. Billinge et al."; - -// constant strings for python capsule names (cn) -static char* cnpfit = "pdffit"; -static char* cnvar = "pdfvar"; - -PyObject * pypdffit2_copyright(PyObject *, PyObject *) -{ - return Py_BuildValue("s", pypdffit2_copyright_note); -} - -//helper function to convert a pylist to a double array. -void double_array_from_pylist(PyObject *pylist, double *d_array, int const length) -{ - //length is the size of the d_array and not necessarily equal to the length - //of the pylist - PyObject *pyval = 0; - - for(int i = 0; i < length; i++) { - pyval = PyList_GetItem(pylist, i); - d_array[i] = PyFloat_AsDouble(pyval); - } -} - -// helper function to delete PdfFit object -static void deletePdfFit(PyObject* ptr) -{ - PdfFit *pdf = (PdfFit *)PyCapsule_GetPointer(ptr, cnpfit); - delete pdf; - return; -} - -// create a PdfFit instance -char pypdffit2_create__doc__[] = ""; -char pypdffit2_create__name__[] = "create"; - -PyObject * pypdffit2_create(PyObject *, PyObject *args) -{ - PdfFit *ppdf = new PdfFit(); - PyObject *py_ppdf = PyCapsule_New((void *)ppdf, cnpfit, deletePdfFit); - return py_ppdf; -} - - -// read_struct -char pypdffit2_read_struct__doc__[] = "Read structure file into memory."; -char pypdffit2_read_struct__name__[] = "read_struct"; - -PyObject * pypdffit2_read_struct(PyObject *, PyObject *args) -{ - char *fname; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_struct(fname); - } - catch(structureError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_struct_string -char pypdffit2_read_struct_string__doc__[] = "Read structure file into memory from a c-string."; -char pypdffit2_read_struct_string__name__[] = "read_struct_string"; - -PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *args) -{ - char *buffer; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &buffer); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_struct_string(buffer); - } - catch(structureError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - - -// read_data -char pypdffit2_read_data__doc__[] = "Read data file into memory."; -char pypdffit2_read_data__name__[] = "read_data"; - -PyObject * pypdffit2_read_data(PyObject *, PyObject *args) -{ - char *fname; - char stype; - double qmax, qdamp; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oscdd", &py_ppdf, &fname, &stype, &qmax, &qdamp); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_data(fname, stype, qmax, qdamp); - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_data_string -char pypdffit2_read_data_string__doc__[] = "Read data from string into memory."; -char pypdffit2_read_data_string__name__[] = "read_data_string"; - -PyObject * pypdffit2_read_data_string(PyObject *, PyObject *args) -{ - char *buffer; - char *c_name = NULL; - char stype; - double qmax, qdamp; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oscdd|s", &py_ppdf, &buffer, &stype, &qmax, &qdamp, &c_name); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - string name = c_name ? c_name : ""; - try { - string sbuffer(buffer); - ppdf->read_data_string(sbuffer, stype, qmax, qdamp, name); - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_data_arrays - read_data_lists in PdfFit class -char pypdffit2_read_data_arrays__doc__[] = "Read data from arrays into memory."; -char pypdffit2_read_data_arrays__name__[] = "read_data_arrays"; - -PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *args) -{ - char stype; - double qmax, qdamp; - int length; - char * c_name = NULL; - double *r_data = NULL; - double *Gr_data = NULL; - double *dGr_data = NULL; - PyObject *py_r_data = Py_None; - PyObject *py_Gr_data = Py_None; - PyObject *py_dGr_data = Py_None; - PyObject *py_ppdf = NULL; - int ok = PyArg_ParseTuple(args, "OcddOO|Os", &py_ppdf, &stype, &qmax, &qdamp, - &py_r_data, &py_Gr_data, &py_dGr_data, &c_name); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - - length = PyList_Size(py_Gr_data); - //quick check that the arrays are all the same length // - int r_len = PyList_Size(py_r_data); - int dGr_len = length; - if(py_dGr_data != Py_None) { - dGr_len = PyList_Size(py_dGr_data); - } - if(r_len != length || dGr_len != length) - { - string err_string = "Data arrays have different lengths"; - PyErr_SetString(PyExc_ValueError, err_string.c_str()); - return 0; - } - - // create data arrays - r_data = new double [length]; - double_array_from_pylist(py_r_data, r_data, length); - Gr_data = new double [length]; - double_array_from_pylist(py_Gr_data, Gr_data, length); - if(py_dGr_data != Py_None) { - dGr_data = new double [length]; - double_array_from_pylist(py_dGr_data, dGr_data, length); - } - string name = c_name; - try { - ppdf->read_data_arrays(stype, qmax, qdamp, length, - r_data, Gr_data, dGr_data, name); - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - - // read_data_arrays creates its own copy of the data, so we must delete our - // copies here. - delete [] r_data; - delete [] Gr_data; - if( dGr_data != NULL ) delete [] dGr_data; - Py_INCREF(Py_None); - return Py_None; -} - -// pdfrange (range in c) -char pypdffit2_pdfrange__doc__[] = "Set r-range of pdf."; -char pypdffit2_pdfrange__name__[] = "pdfrange"; - -PyObject * pypdffit2_pdfrange(PyObject *, PyObject *args) -{ - int iset; - double rmin, rmax; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oidd", &py_ppdf, &iset, &rmin, &rmax); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->range(iset, rmin, rmax); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// reset -char pypdffit2_reset__doc__[] = "reset pdf data"; -char pypdffit2_reset__name__[] = "reset"; - -PyObject * pypdffit2_reset(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - ppdf->reset(); - Py_INCREF(Py_None); - return Py_None; -} - -// alloc -char pypdffit2_alloc__doc__[] = "Allocate space for pdf data"; -char pypdffit2_alloc__name__[] = "alloc"; - -PyObject * pypdffit2_alloc(PyObject *, PyObject *args) -{ - char stype; - double qmax, qdamp, rmin, rmax; - int bin; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocddddi", &py_ppdf, &stype, &qmax, &qdamp, &rmin, &rmax, &bin); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->alloc(stype, qmax, qdamp, rmin, rmax, bin); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// calc -char pypdffit2_calc__doc__[] = "calculate pdf from data"; -char pypdffit2_calc__name__[] = "calc"; - -PyObject * pypdffit2_calc(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->calc(); - } - catch (calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch (parseError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// refine -char pypdffit2_refine__doc__[] = "refine model to pdf data"; -char pypdffit2_refine__name__[] = "refine"; - -PyObject * pypdffit2_refine(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - double toler; - int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->refine(true, toler); - } - catch(constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// local helper class for background thread in pypdffit2_refine_step() -namespace { - -class RefineStepHelper -{ - private: - PyThreadState* thread_state; - ostringstream msgout; - - public: - // Constructor saves thread state and arranges for holding - // engine output when redirected - RefineStepHelper() - { - if (py_stdout_streambuf) - { - NS_PDFFIT2::pout->rdbuf(msgout.rdbuf()); - } - thread_state = PyEval_SaveThread(); - } - - // method for restoring thread state and writing any outstanding output - void clean() - { - PyEval_RestoreThread(thread_state); - if (py_stdout_streambuf) - { - NS_PDFFIT2::pout->rdbuf(py_stdout_streambuf); - *NS_PDFFIT2::pout << msgout.str(); - } - } -}; - -} // local namespace - -// refine_step -char pypdffit2_refine_step__doc__[] = "Make one step in the refinement process."; -char pypdffit2_refine_step__name__[] = "refine_step"; - -PyObject * pypdffit2_refine_step(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - double toler; - int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefineStepHelper janitor; // takes care of thread an output issues - int finished = 1; - try { - finished = ppdf->refine_step(true, toler); - } - catch(parseError e) { - // parseError is due to invalid constraint - janitor.clean(); - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(constraintError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(...) { - janitor.clean(); - return 0; - } - janitor.clean(); - - return Py_BuildValue("i", finished); -} - -// save_pdf -char pypdffit2_save_pdf__doc__[] = "Save calculated pdf to file"; -char pypdffit2_save_pdf__name__[] = "save_pdf"; - -PyObject * pypdffit2_save_pdf(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_pdf(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_dif -char pypdffit2_save_dif__doc__[] = "Save pdf difference to file"; -char pypdffit2_save_dif__name__[] = "save_dif"; - -PyObject * pypdffit2_save_dif(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_dif(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_res -char pypdffit2_save_res__doc__[] = "Save residual to file"; -char pypdffit2_save_res__name__[] = "save_res"; - -PyObject * pypdffit2_save_res(PyObject *, PyObject *args) -{ - char *fname; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_res(fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_struct -char pypdffit2_save_struct__doc__[] = "Save refined structure to file"; -char pypdffit2_save_struct__name__[] = "save_struct"; - -PyObject * pypdffit2_save_struct(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_struct(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// show_struct -char pypdffit2_show_struct__doc__[] = "Show structure."; -char pypdffit2_show_struct__name__[] = "show_struct"; - -PyObject * pypdffit2_show_struct(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->show_struct(ip); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// constrain to string -char pypdffit2_constrain_str__doc__[] = "Constrain refined variable to string."; -char pypdffit2_constrain_str__name__[] = "constrain_str"; - -PyObject* pypdffit2_constrain_str(PyObject*, PyObject* args) -{ - PyObject* py_v = 0; - char* vname; - char* form; - PyObject* py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOss", &py_ppdf, &py_v, &vname, &form); - if (!ok) return 0; - PdfFit* ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefVar* v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); - if (v->type() != "RefVar") - { - string emsg = "cannot constrain non-refinable variable "; - emsg += vname; - PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); - return 0; - } - if (v->isAssigned()) { - try { - ppdf->constrain(*v, form); - } - catch (constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - ostringstream emsg; - emsg << "Variable " << vname << " was not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); - } - Py_INCREF(Py_None); - return Py_None; -} - -// constrain to integer. -char pypdffit2_constrain_int__doc__[] = "Constrain refined variable to integer."; -char pypdffit2_constrain_int__name__[] = "constrain_int"; - -PyObject* pypdffit2_constrain_int(PyObject*, PyObject* args) -{ - PyObject* py_v = 0; - int ftype = 0; - char* vname; - int ipar; - PyObject* py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOsi|i", &py_ppdf, &py_v, &vname, &ipar, &ftype); - if (!ok) return 0; - PdfFit* ppdf = (PdfFit*) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefVar* v = (RefVar*) PyCapsule_GetPointer(py_v, cnvar); - if (v->type() != "RefVar") - { - string emsg = "cannot constrain non-refinable variable "; - emsg += vname; - PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); - return 0; - } - if (v->isAssigned()) { - try { - if (ftype) - { - ppdf->constrain(*v, ipar, (FCON)ftype); - } - else ppdf->constrain(*v, ipar); - } - catch (constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - ostringstream emsg; - emsg << "Variable " << vname << " was not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setpar with value of double -char pypdffit2_setpar_dbl__doc__[] = "Set parameter value."; -char pypdffit2_setpar_dbl__name__[] = "setpar_dbl"; - -PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *args) -{ - unsigned int n; - double val; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OId", &py_ppdf, &n, &val); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setpar(n, val); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setpar with value of RefVar -char pypdffit2_setpar_RV__doc__[] = "Set parameter value via refined variable."; -char pypdffit2_setpar_RV__name__[] = "setpar_RV"; - -PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *args) -{ - unsigned int n; - RefVar *v; - PyObject *py_v; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OIO", &py_ppdf, &n, &py_v); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); - if( v->isAssigned() ) { - try - { - ppdf->setpar(n, *v); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - string eout = "Variable not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setvar -char pypdffit2_setvar__doc__[] = "Set variable to value."; -char pypdffit2_setvar__name__[] = "setvar"; - -PyObject * pypdffit2_setvar(PyObject *, PyObject *args) -{ - double a; - NonRefVar *v; - PyObject *py_v; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOd", &py_ppdf, &py_v, &a); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); - if( v->isAssigned() ) { - ppdf->setvar(*v, a); - } - else { - string eout = "Must import a structure"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// getvar -char pypdffit2_getvar__doc__[] = "Get variable value."; -char pypdffit2_getvar__name__[] = "getvar"; - -PyObject * pypdffit2_getvar(PyObject *, PyObject *args) -{ - NonRefVar *v = 0; - PyObject *py_v = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OO", &py_ppdf, &py_v); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); - if(v->isAssigned()) { - double crval = ppdf->getvar(*v); - return Py_BuildValue("d", crval); - } - else { - string eout = "Variable not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - Py_INCREF(Py_None); - return Py_None; - } -} - -// getcrw -char pypdffit2_getcrw__doc__[] = "Get cumulative Rw for the current dataset."; -char pypdffit2_getcrw__name__[] = "getcrw"; - -PyObject * pypdffit2_getcrw(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector crw = ppdf->getcrw(); - PyObject *py_r; - py_r = PyList_New(crw.size()); - for (int i = 0; i != int(crw.size()); ++i) - { - PyList_SetItem(py_r, i, PyFloat_FromDouble(crw[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// getrw -char pypdffit2_getrw__doc__[] = "Get rw of fit."; -char pypdffit2_getrw__name__[] = "getrw"; - -PyObject * pypdffit2_getrw(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - double crval = ppdf->getrw(); - return Py_BuildValue("d", crval); -} - -// getR -char pypdffit2_getR__doc__[] = "Get list of r-values for plotting."; -char pypdffit2_getR__name__[] = "getR"; - -PyObject * pypdffit2_getR(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - /* One should not put functionality in the bindings. However, - * this function is meant to create a python object from a - * c-object that does not actually exist. All that is stored - * in pdffit about the fitted R-range is the minimum, maximum, - * and step size. This binding turns that info into a python - * list. If the number of fit points stored in nfmax and nfmin - * have not yet been assigned, then this falls back on the - * r-points. This is crucial so that one can investigate the - * PDF before any fitting has been done. Once fit parameters - * have been established, they can be used and the r list, - * pdf-obs list, and pdf-fit list will be the same size. - * Also see getpdf_obs(). - */ - try - { - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - double rmin = ppdf->getrmin(); - double rmax = ppdf->getrmax(); - double deltar = ppdf->getdeltar(); - PyObject *py_r; - if(len == 1) - { - nfmin = 0; - nfmax = (int) ((rmax - rmin)/deltar); - len = nfmax + 1; - } - py_r = PyList_New(len); - for (int i=nfmin;i<=nfmax;i++) - { - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", i*deltar + rmin)); - } - - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpdf_fit -char pypdffit2_getpdf_fit__doc__[] = "Get list of calculated pdf points."; -char pypdffit2_getpdf_fit__name__[] = "getpdf_fit"; - -PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - //Return only the data range used in the fit - try - { - int min = ppdf->getnfmin(); - int max = ppdf->getnfmax(); - int len = max - min + 1; - vector v_pdfdata = ppdf->getpdf_fit(); - PyObject *py_r; - py_r = PyList_New(len); - for (int i=min;i<=max;i++) { - PyList_SetItem(py_r, i-min, Py_BuildValue("d", v_pdfdata[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpdf_obs -char pypdffit2_getpdf_obs__doc__[] = "Get list of observed (theory) pdf points."; -char pypdffit2_getpdf_obs__name__[] = "getpdf_obs"; - -PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector v_pdfdata = ppdf->getpdf_obs(); - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - //Return only the data range used in the fit - PyObject *py_r; - py_r = PyList_New(len); - for (int i=nfmin;i<=nfmax;i++) { - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", v_pdfdata[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// getpdf_diff -char pypdffit2_getpdf_diff__doc__[] = "Get list of differences between observed and fitted PDF points."; -char pypdffit2_getpdf_diff__name__[] = "getpdf_diff"; - -PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector Gobs = ppdf->getpdf_obs(); - vector Gfit = ppdf->getpdf_fit(); - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - //Return only the data range used in the fit - PyObject *py_r; - py_r = PyList_New(len); - for (int i = nfmin; i <= nfmax; i++) { - double Gdiff_i = Gobs[i] - Gfit[i]; - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", Gdiff_i)); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpar -char pypdffit2_getpar__doc__[] = "Get value of parameter"; -char pypdffit2_getpar__name__[] = "getpar"; - -PyObject * pypdffit2_getpar(PyObject *, PyObject *args) -{ - unsigned int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OI", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - double crval = ppdf->getpar(n); - return Py_BuildValue("d", crval); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// fixpar -char pypdffit2_fixpar__doc__[] = "Fix value of parameter."; -char pypdffit2_fixpar__name__[] = "fixpar"; - -PyObject * pypdffit2_fixpar(PyObject *, PyObject *args) -{ - int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->fixpar(n); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// freepar -char pypdffit2_freepar__doc__[] = "Free parameter."; -char pypdffit2_freepar__name__[] = "freepar"; - -PyObject * pypdffit2_freepar(PyObject *, PyObject *args) -{ - int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->freepar(n); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setphase -char pypdffit2_setphase__doc__[] = "Set phase in focus."; -char pypdffit2_setphase__name__[] = "setphase"; - -PyObject * pypdffit2_setphase(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setphase(ip); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setdata -char pypdffit2_setdata__doc__[] = "Set data in focus."; -char pypdffit2_setdata__name__[] = "setdata"; - -PyObject * pypdffit2_setdata(PyObject *, PyObject *args) -{ - int is; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &is); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setdata(is); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// psel -char pypdffit2_psel__doc__[] = "Select phase in focus."; -char pypdffit2_psel__name__[] = "psel"; - -PyObject * pypdffit2_psel(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selphase(ip); - } - catch(unassignedError e) - { - // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// pdesel -char pypdffit2_pdesel__doc__[] = "Deselect phase in focus."; -char pypdffit2_pdesel__name__[] = "pdesel"; - -PyObject * pypdffit2_pdesel(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->pdesel(ip); - } - catch(unassignedError e) - { - // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAtomType -char pypdffit2_selectAtomType__doc__[] = "Include element in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAtomType__name__[] = "selectAtomType"; - -PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - char* smbpat; - bool select; - int ok = PyArg_ParseTuple(args, "Oicsb", &py_ppdf, &ip, &ijchar, &smbpat, &select); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAtomType(ip, ijchar, smbpat, select); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAtomIndex -char pypdffit2_selectAtomIndex__doc__[] = "Include atom of given index in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAtomIndex__name__[] = "selectAtomIndex"; - -PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int aidx1; - bool select; - int ok = PyArg_ParseTuple(args, "Oicib", &py_ppdf, &ip, &ijchar, &aidx1, &select); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAtomIndex(ip, ijchar, aidx1, select); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAll -char pypdffit2_selectAll__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAll__name__[] = "selectAll"; - -PyObject * pypdffit2_selectAll(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAll(ip, ijchar); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectNone -char pypdffit2_selectNone__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectNone__name__[] = "selectNone"; - -PyObject * pypdffit2_selectNone(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectNone(ip, ijchar); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// bond_angle -char pypdffit2_bond_angle__doc__[] = "Return bond angle between three atoms."; -char pypdffit2_bond_angle__name__[] = "bond_angle"; - -PyObject * pypdffit2_bond_angle(PyObject *, PyObject *args) -{ - int ia, ja, ka; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oiii", &py_ppdf, &ia, &ja, &ka); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pair angstd = ppdf->bond_angle(ia, ja, ka); - PyObject* py_tpl; - py_tpl = Py_BuildValue("(d,d)", angstd.first, angstd.second); - return py_tpl; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// bond_length_atoms (nearest bond length between two atoms) -char pypdffit2_bond_length_atoms__doc__[] = - "Return a tuple of (dij, ddij) for distance between two atoms\n" - "and its standard deviation."; -char pypdffit2_bond_length_atoms__name__[] = "bond_length_atoms"; - -PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *args) -{ - int ia, ja; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oii", &py_ppdf, &ia, &ja); - PairDistance pd; - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pd = ppdf->bond_length_atoms(ia, ja); - PyObject *py_tpl; - py_tpl = Py_BuildValue("(d,d)", pd.dij, pd.ddij); - return py_tpl; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// bond_length_types (bond lengths between two elements inside given bounds) -char pypdffit2_bond_length_types__doc__[] = - "Return bond lengths between two elements within given bounds\n" - "\n" - "a1 -- symbol of the first element in pair or 'ALL'\n" - "a2 -- symbol of the second element in pair or 'ALL'\n" - "lb -- lower bound for bond lengths\n" - "ub -- upper bound for bond lengths\n" - "\n" - "Return a dictionary of distance data containing:\n" - "\n" - "dij : list of bond lenghts within given bounds\n" - "ddij : list of bond legnth standard deviations\n" - "ij0 : list of tupled pairs of indices starting at 0\n" - "ij1 : list of tupled pairs of indices starting at 1"; -char pypdffit2_bond_length_types__name__[] = "bond_length_types"; - -PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *args) -{ - char* symi; - char* symj; - double bmin = 0; - double bmax = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ossdd", &py_ppdf, &symi, &symj, &bmin, &bmax); - vector pdvec; - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pdvec = ppdf->bond_length_types(symi, symj, bmin, bmax); - int np = pdvec.size(); - PyObject* py_dij; - PyObject* py_ddij; - PyObject* py_ij0; - PyObject* py_ij1; - py_dij = PyList_New(np); - py_ddij = PyList_New(np); - py_ij0 = PyList_New(np); - py_ij1 = PyList_New(np); - for (int i = 0; i < np; ++i) - { - PairDistance& pd = pdvec[i]; - PyObject *py_item; - py_item = PyFloat_FromDouble(pd.dij); - PyList_SetItem(py_dij, i, py_item); - py_item = PyFloat_FromDouble(pd.ddij); - PyList_SetItem(py_ddij, i, py_item); - py_item = Py_BuildValue("(i,i)", pd.i - 1, pd.j - 1); - PyList_SetItem(py_ij0, i, py_item); - py_item = Py_BuildValue("(i,i)", pd.i, pd.j); - PyList_SetItem(py_ij1, i, py_item); - } - PyObject* py_rv; - py_rv = PyDict_New(); - PyDict_SetItemString(py_rv, "dij", py_dij); - PyDict_SetItemString(py_rv, "ddij", py_ddij); - PyDict_SetItemString(py_rv, "ij0", py_ij0); - PyDict_SetItemString(py_rv, "ij1", py_ij1); - return py_rv; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// get_scat_string -char pypdffit2_get_scat_string__doc__[] = "Return string with scatter details."; -char pypdffit2_get_scat_string__name__[] = "get_scat_string"; - -PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *args) -{ - char stype; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oc", &py_ppdf, &stype); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - string outstring; - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "No scatterers exist"); - return 0; - } - // here curphase exists, get_scat_string throws runtime error - // for invalid stype. - try { - outstring = (ppdf->curphase)->get_scat_string(stype); - } - catch (runtime_error e) { - PyErr_SetString(PyExc_ValueError, e.what()); - return 0; - } - return Py_BuildValue("s", outstring.c_str()); -} - -// get_scat -char pypdffit2_get_scat__doc__[] = "Return scattering factor for given element."; -char pypdffit2_get_scat__name__[] = "get_scat"; - -PyObject * pypdffit2_get_scat(PyObject *, PyObject *args) -{ - char stype; - char* smbpat; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocs", &py_ppdf, &stype, &smbpat); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - double value; - try { - value = ppdf->get_scat(stype, smbpat); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - PyObject* py_rv; - py_rv = PyFloat_FromDouble(value); - return py_rv; -} - -// set_scat -char pypdffit2_set_scat__doc__[] = "Set custom scattering factor for given element."; -char pypdffit2_set_scat__name__[] = "set_scat"; - -PyObject * pypdffit2_set_scat(PyObject *, PyObject *args) -{ - char stype; - char* smbpat; - double value; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocsd", &py_ppdf, &stype, &smbpat, &value); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); - return 0; - } - // Here curphase exists. set_scat may throw - // runtime or ValueError for invalid arguments - try { - ppdf->curphase->set_scat(stype, smbpat, value); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (runtime_error e) { - PyErr_SetString(PyExc_ValueError, e.what()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// reset_scat -char pypdffit2_reset_scat__doc__[] = "Reset scattering factor for given element."; -char pypdffit2_reset_scat__name__[] = "reset_scat"; - -PyObject * pypdffit2_reset_scat(PyObject *, PyObject *args) -{ - char* smbpat; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &smbpat); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); - return 0; - } - // Here curphase exists. reset_scat may throw - // runtime or ValueError for invalid arguments - try { - ppdf->curphase->reset_scat(smbpat); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -//throw-away variable that helps with exception handling -//RefVar *_junkRV = new RefVar(); -// utility function (not available from Python) -RefVar *getRefVar(vector &v, unsigned int i) -{ - if (v.size() == 0) - { - throw unassignedError("Variable not yet assigned"); - } - else if (i > v.size() || i < 1) - { - stringstream errstr; - errstr << "Index " << i << " out of bounds"; - throw ValueError(errstr.str()); - } - return &v[i-1]; -} - -//current phase and set refinable variable pointers - -// lat -char pypdffit2_lat__doc__[] = "Pointer to refinable variable lat."; -char pypdffit2_lat__name__[] = "lat"; - -PyObject * pypdffit2_lat(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->lat,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// x -char pypdffit2_x__doc__[] = "Pointer to refinable variable x."; -char pypdffit2_x__name__[] = "x"; - -PyObject * pypdffit2_x(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->x,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// y -char pypdffit2_y__doc__[] = "Pointer to refinable variable y."; -char pypdffit2_y__name__[] = "y"; - -PyObject * pypdffit2_y(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->y,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// z -char pypdffit2_z__doc__[] = "Pointer to refinable variable z."; -char pypdffit2_z__name__[] = "z"; - -PyObject * pypdffit2_z(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->z,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u11 -char pypdffit2_u11__doc__[] = "Pointer to refinable variable u11."; -char pypdffit2_u11__name__[] = "u11"; - -PyObject * pypdffit2_u11(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u11,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u22 -char pypdffit2_u22__doc__[] = "Pointer to refinable variable u22."; -char pypdffit2_u22__name__[] = "u22"; - -PyObject * pypdffit2_u22(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u22,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u33 -char pypdffit2_u33__doc__[] = "Pointer to refinable variable u33."; -char pypdffit2_u33__name__[] = "u33"; - -PyObject * pypdffit2_u33(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u33,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u12 -char pypdffit2_u12__doc__[] = "Pointer to refinable variable u12."; -char pypdffit2_u12__name__[] = "u12"; - -PyObject * pypdffit2_u12(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u12,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u13 -char pypdffit2_u13__doc__[] = "Pointer to refinable variable u13."; -char pypdffit2_u13__name__[] = "u13"; - -PyObject * pypdffit2_u13(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u13,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u23 -char pypdffit2_u23__doc__[] = "Pointer to refinable variable u23."; -char pypdffit2_u23__name__[] = "u23"; - -PyObject * pypdffit2_u23(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u23,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// occ -char pypdffit2_occ__doc__[] = "Pointer to refinable variable occ."; -char pypdffit2_occ__name__[] = "occ"; - -PyObject * pypdffit2_occ(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->occ,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// pscale -char pypdffit2_pscale__doc__[] = "Pointer to variable pscale."; -char pypdffit2_pscale__name__[] = "pscale"; - -PyObject * pypdffit2_pscale(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->pscale), cnvar, NULL); - return py_v; -} - -// spdiameter -char pypdffit2_spdiameter__doc__[] = "Pointer to variable spdiameter."; -char pypdffit2_spdiameter__name__[] = "spdiameter"; - -PyObject * pypdffit2_spdiameter(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->spdiameter), cnvar, NULL); - return py_v; -} - -// stepcut -char pypdffit2_stepcut__doc__[] = "Pointer to nonvariable stepcut."; -char pypdffit2_stepcut__name__[] = "stepcut"; - -PyObject * pypdffit2_stepcut(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->stepcut), cnvar, NULL); - return py_v; -} - -// sratio -char pypdffit2_sratio__doc__[] = "Pointer to variable sratio."; -char pypdffit2_sratio__name__[] = "sratio"; - -PyObject * pypdffit2_sratio(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->sratio), cnvar, NULL); - return py_v; -} - -// delta2 -char pypdffit2_delta2__doc__[] = "Pointer to variable delta2."; -char pypdffit2_delta2__name__[] = "delta2"; - -PyObject * pypdffit2_delta2(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->delta2), cnvar, NULL); - return py_v; -} - -// delta1 -char pypdffit2_delta1__doc__[] = "Pointer to variable delta1."; -char pypdffit2_delta1__name__[] = "delta1"; - -PyObject * pypdffit2_delta1(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->delta1), cnvar, NULL); - return py_v; -} - -// dscale -char pypdffit2_dscale__doc__[] = "Pointer to variable dscale."; -char pypdffit2_dscale__name__[] = "dscale"; - -PyObject * pypdffit2_dscale(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->dscale), cnvar, NULL); - return py_v; -} - -// qdamp -char pypdffit2_qdamp__doc__[] = "Pointer to variable qdamp."; -char pypdffit2_qdamp__name__[] = "qdamp"; - -PyObject * pypdffit2_qdamp(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->qdamp), cnvar, NULL); - return py_v; -} - -// qbroad -char pypdffit2_qbroad__doc__[] = "Pointer to variable qbroad."; -char pypdffit2_qbroad__name__[] = "qbroad"; - -PyObject * pypdffit2_qbroad(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->qbroad), cnvar, NULL); - return py_v; -} - -// rcut -char pypdffit2_rcut__doc__[] = "Pointer to nonvariable rcut."; -char pypdffit2_rcut__name__[] = "rcut"; - -PyObject * pypdffit2_rcut(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->rcut), cnvar, NULL); - return py_v; -} - -// get_atoms -char pypdffit2_get_atoms__doc__[] = "Get element symbols of atoms in the phase."; -char pypdffit2_get_atoms__name__[] = "get_atoms"; - -PyObject * pypdffit2_get_atoms(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip = 0; - int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - Phase* ph; - try { - ph = ppdf->getphase(ip); - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // Phase ph is defined here - PyObject *py_atoms = PyList_New(ph->natoms); - for (int i = 0; i < ph->natoms; ++i) - { - string usymbol = toupper(ph->atom[i].atom_type->symbol); - PyList_SetItem(py_atoms, i, PyUnicode_FromString(usymbol.c_str())); - } - return py_atoms; -} - -// num_atoms -char pypdffit2_num_atoms__doc__[] = "Get the number of atoms in the current phase."; -char pypdffit2_num_atoms__name__[] = "num_atoms"; - -PyObject * pypdffit2_num_atoms(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (ppdf->curphase) - { - retval = (ppdf->curphase)->natoms; - } - else - { - PyErr_SetString(pypdffit2_unassignedError, "No data loaded"); - return 0; - } - return Py_BuildValue("i", retval); -} - -// get_atom_types -char pypdffit2_get_atom_types__doc__[] = "Get ordered unique symbols of atoms in the phase."; -char pypdffit2_get_atom_types__name__[] = "get_atom_types"; - -PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip = 0; - int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - Phase* ph; - try { - ph = ppdf->getphase(ip); - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // Phase ph is defined here - PyObject *py_atom_types = PyList_New(ph->atom_types.size()); - for (int i = 0; i < int(ph->atom_types.size()); ++i) - { - string usymbol = toupper(ph->atom_types[i]->symbol); - PyList_SetItem(py_atom_types, i, PyUnicode_FromString(usymbol.c_str())); - } - return py_atom_types; -} - - -// num_phases -char pypdffit2_num_phases__doc__[] = "Get the number of loaded phases."; -char pypdffit2_num_phases__name__[] = "num_phases"; - -PyObject * pypdffit2_num_phases(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - retval = ppdf->num_phases(); - return Py_BuildValue("i", retval); -} - - -// num_datasets -char pypdffit2_num_datasets__doc__[] = "Get the number of loaded datasets."; -char pypdffit2_num_datasets__name__[] = "num_datasets"; - -PyObject * pypdffit2_num_datasets(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - retval = ppdf->num_datasets(); - return Py_BuildValue("i", retval); -} - - -// phase_fractions -char pypdffit2_phase_fractions__doc__[] = - "Return relative phase fractions for current dataset scattering type\n" - "\n" - "Return a dictionary of relative phase fractions:\n" - "\n" - "atom -- list of fractions normalized to atom count\n" - "stdatom -- errors of atom count fractions\n" - "cell -- list of fractions normalized to unit cell count\n" - "stdcell -- errors of unit cell count fractions\n" - "mass -- list of relative weight fractions\n" - "stdmass -- errors of relative weight fractions\n" - ; -char pypdffit2_phase_fractions__name__[] = "phase_fractions"; - -PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - map > fractions; - try - { - fractions = ppdf->getPhaseFractions(); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // convert fractions map to an equivalent python dictionary - map >::iterator ii; - PyObject* py_rv; - py_rv = PyDict_New(); - for (ii = fractions.begin(); ii != fractions.end(); ++ii) - { - int n = ii->second.size(); - PyObject* py_lst; - py_lst = PyList_New(n); - for (int i = 0; i < n; ++i) - { - PyObject* py_value; - py_value = PyFloat_FromDouble(ii->second.at(i)); - PyList_SetItem(py_lst, i, py_value); - } - PyDict_SetItemString(py_rv, ii->first.c_str(), py_lst); - } - return py_rv; -} - -// redirect_stdout -char pypdffit2_redirect_stdout__doc__[] = "Redirect engine output to a file-like object."; -char pypdffit2_redirect_stdout__name__[] = "redirect_stdout"; - -PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) -{ - // instance of PyFileStreambuf which takes care of redirection - PyObject *py_file = 0; - int ok = PyArg_ParseTuple(args, "O", &py_file); - if (!ok) return 0; - // check if py_file has write and flush attributes - if ( !PyObject_HasAttrString(py_file, "write") || - !PyObject_HasAttrString(py_file, "flush") ) - { - PyErr_SetString(PyExc_TypeError, "expected file-like argument"); - return 0; - } - // create py_stdout_streambuf if necessary - if (!py_stdout_streambuf) - { - py_stdout_streambuf = new PyFileStreambuf(py_file); - } - py_stdout_streambuf->redirect(py_file); - // on first redirection we need to assign new ostream to NS_PDFFIT2::pout - if (NS_PDFFIT2::pout == &std::cout) - { - NS_PDFFIT2::pout = new ostream(py_stdout_streambuf); - } - Py_INCREF(Py_None); - return Py_None; -} - -// is_element -char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table."; -char pypdffit2_is_element__name__[] = "is_element"; - -PyObject * pypdffit2_is_element(PyObject *, PyObject *args) -{ - // instance of PyFileStreambuf which takes care of redirection - char *smbpat; - int ok = PyArg_ParseTuple(args, "s", &smbpat); - if (!ok) return 0; - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - PyObject *rv = PyBool_FromLong(lpt->has(smbpat)); - return rv; -} - -// End of file diff --git a/pdffit2module/misc.h b/pdffit2module/misc.h deleted file mode 100644 index f8782307..00000000 --- a/pdffit2module/misc.h +++ /dev/null @@ -1,486 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Bindings from python to c++ PdfFit class. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_MISC_H -#define PYPDFFIT2_MISC_H - -// copyright -extern char pypdffit2_copyright__name__[]; -extern char pypdffit2_copyright__doc__[]; -extern "C" -PyObject * pypdffit2_copyright(PyObject *, PyObject *); - -// create -extern char pypdffit2_create__name__[]; -extern char pypdffit2_create__doc__[]; -extern "C" -PyObject * pypdffit2_create(PyObject *, PyObject *); - -// read_struct -extern char pypdffit2_read_struct__name__[]; -extern char pypdffit2_read_struct__doc__[]; -extern "C" -PyObject * pypdffit2_read_struct(PyObject *, PyObject *); - -// read_struct_string -extern char pypdffit2_read_struct_string__name__[]; -extern char pypdffit2_read_struct_string__doc__[]; -extern "C" -PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *); - -// read_data -extern char pypdffit2_read_data__name__[]; -extern char pypdffit2_read_data__doc__[]; -extern "C" -PyObject * pypdffit2_read_data(PyObject *, PyObject *); - -// read_data_string -extern char pypdffit2_read_data_string__name__[]; -extern char pypdffit2_read_data_string__doc__[]; -extern "C" -PyObject * pypdffit2_read_data_string(PyObject *, PyObject *); - -// read_data_arrays -extern char pypdffit2_read_data_arrays__name__[]; -extern char pypdffit2_read_data_arrays__doc__[]; -extern "C" -PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *); - -// pdfrange -extern char pypdffit2_pdfrange__doc__[]; -extern char pypdffit2_pdfrange__name__[]; -extern "C" -PyObject * pypdffit2_pdfrange(PyObject *, PyObject *); - -// reset -extern char pypdffit2_reset__doc__[]; -extern char pypdffit2_reset__name__[]; -extern "C" -PyObject * pypdffit2_reset(PyObject *, PyObject *); - -// alloc -extern char pypdffit2_alloc__doc__[]; -extern char pypdffit2_alloc__name__[]; -extern "C" -PyObject * pypdffit2_alloc(PyObject *, PyObject *); - -// calc -extern char pypdffit2_calc__doc__[]; -extern char pypdffit2_calc__name__[]; -extern "C" -PyObject * pypdffit2_calc(PyObject *, PyObject *); - -// refine -extern char pypdffit2_refine__doc__[]; -extern char pypdffit2_refine__name__[]; -extern "C" -PyObject * pypdffit2_refine(PyObject *, PyObject *); - -// refine_step -extern char pypdffit2_refine_step__doc__[]; -extern char pypdffit2_refine_step__name__[]; -extern "C" -PyObject * pypdffit2_refine_step(PyObject *, PyObject *); - -// save_pdf -extern char pypdffit2_save_pdf__doc__[]; -extern char pypdffit2_save_pdf__name__[]; -extern "C" -PyObject * pypdffit2_save_pdf(PyObject *, PyObject *); - -// save_dif -extern char pypdffit2_save_dif__doc__[]; -extern char pypdffit2_save_dif__name__[]; -extern "C" -PyObject * pypdffit2_save_dif(PyObject *, PyObject *); - -// save_res -extern char pypdffit2_save_res__doc__[]; -extern char pypdffit2_save_res__name__[]; -extern "C" -PyObject * pypdffit2_save_res(PyObject *, PyObject *); - -// save_struct -extern char pypdffit2_save_struct__doc__[]; -extern char pypdffit2_save_struct__name__[]; -extern "C" -PyObject * pypdffit2_save_struct(PyObject *, PyObject *); - -// show_struct -extern char pypdffit2_show_struct__doc__[]; -extern char pypdffit2_show_struct__name__[]; -extern "C" -PyObject * pypdffit2_show_struct(PyObject *, PyObject *); - -// constrain to string -extern char pypdffit2_constrain_str__doc__[]; -extern char pypdffit2_constrain_str__name__[]; -extern "C" -PyObject * pypdffit2_constrain_str(PyObject *, PyObject *); - -// constrain_int to integer -extern char pypdffit2_constrain_int__doc__[]; -extern char pypdffit2_constrain_int__name__[]; -extern "C" -PyObject * pypdffit2_constrain_int(PyObject *, PyObject *); - -// setpar_dbl -extern char pypdffit2_setpar_dbl__doc__[]; -extern char pypdffit2_setpar_dbl__name__[]; -extern "C" -PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *); - -// setpar with RefVar -extern char pypdffit2_setpar_RV__doc__[]; -extern char pypdffit2_setpar_RV__name__[]; -extern "C" -PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *); - -// setvar -extern char pypdffit2_setvar__doc__[]; -extern char pypdffit2_setvar__name__[]; -extern "C" -PyObject * pypdffit2_setvar(PyObject *, PyObject *); - -// getvar -extern char pypdffit2_getvar__doc__[]; -extern char pypdffit2_getvar__name__[]; -extern "C" -PyObject * pypdffit2_getvar(PyObject *, PyObject *); - -// getR -extern char pypdffit2_getR__doc__[]; -extern char pypdffit2_getR__name__[]; -extern "C" -PyObject * pypdffit2_getR(PyObject *, PyObject *); - -// getpdf_fit -extern char pypdffit2_getpdf_fit__doc__[]; -extern char pypdffit2_getpdf_fit__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *); - -// getpdf_obs -extern char pypdffit2_getpdf_obs__doc__[]; -extern char pypdffit2_getpdf_obs__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *); - -// getpdf_diff -extern char pypdffit2_getpdf_diff__doc__[]; -extern char pypdffit2_getpdf_diff__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *); - -// getcrw -extern char pypdffit2_getcrw__doc__[]; -extern char pypdffit2_getcrw__name__[]; -extern "C" -PyObject * pypdffit2_getcrw(PyObject *, PyObject *); - -// getrw -extern char pypdffit2_getrw__doc__[]; -extern char pypdffit2_getrw__name__[]; -extern "C" -PyObject * pypdffit2_getrw(PyObject *, PyObject *); - -// getpar -extern char pypdffit2_getpar__doc__[]; -extern char pypdffit2_getpar__name__[]; -extern "C" -PyObject * pypdffit2_getpar(PyObject *, PyObject *); - -// fixpar -extern char pypdffit2_fixpar__doc__[]; -extern char pypdffit2_fixpar__name__[]; -extern "C" -PyObject * pypdffit2_fixpar(PyObject *, PyObject *); - -// freepar -extern char pypdffit2_freepar__doc__[]; -extern char pypdffit2_freepar__name__[]; -extern "C" -PyObject * pypdffit2_freepar(PyObject *, PyObject *); - -// setphase -extern char pypdffit2_setphase__doc__[]; -extern char pypdffit2_setphase__name__[]; -extern "C" -PyObject * pypdffit2_setphase(PyObject *, PyObject *); - -// setdata -extern char pypdffit2_setdata__doc__[]; -extern char pypdffit2_setdata__name__[]; -extern "C" -PyObject * pypdffit2_setdata(PyObject *, PyObject *); - -// psel -extern char pypdffit2_psel__doc__[]; -extern char pypdffit2_psel__name__[]; -extern "C" -PyObject * pypdffit2_psel(PyObject *, PyObject *); - -// pdesel -extern char pypdffit2_pdesel__doc__[]; -extern char pypdffit2_pdesel__name__[]; -extern "C" -PyObject * pypdffit2_pdesel(PyObject *, PyObject *); - -// selectAtomType -extern char pypdffit2_selectAtomType__doc__[]; -extern char pypdffit2_selectAtomType__name__[]; -extern "C" -PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *); - -// selectAtomIndex -extern char pypdffit2_selectAtomIndex__doc__[]; -extern char pypdffit2_selectAtomIndex__name__[]; -extern "C" -PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *); - -// selectAll -extern char pypdffit2_selectAll__doc__[]; -extern char pypdffit2_selectAll__name__[]; -extern "C" -PyObject * pypdffit2_selectAll(PyObject *, PyObject *); - -// selectNone -extern char pypdffit2_selectNone__doc__[]; -extern char pypdffit2_selectNone__name__[]; -extern "C" -PyObject * pypdffit2_selectNone(PyObject *, PyObject *); - -// bond_angle -extern char pypdffit2_bond_angle__doc__[]; -extern char pypdffit2_bond_angle__name__[]; -extern "C" -PyObject * pypdffit2_bond_angle(PyObject *, PyObject *); - -// bond_length_atoms -extern char pypdffit2_bond_length_atoms__doc__[]; -extern char pypdffit2_bond_length_atoms__name__[]; -extern "C" -PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *); - -// bond_length_types -extern char pypdffit2_bond_length_types__doc__[]; -extern char pypdffit2_bond_length_types__name__[]; -extern "C" -PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *); - -// get_scat_string -extern char pypdffit2_get_scat_string__doc__[]; -extern char pypdffit2_get_scat_string__name__[]; -extern "C" -PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *); - -// get_scat -extern char pypdffit2_get_scat__doc__[]; -extern char pypdffit2_get_scat__name__[]; -extern "C" -PyObject * pypdffit2_get_scat(PyObject *, PyObject *); - -// set_scat -extern char pypdffit2_set_scat__doc__[]; -extern char pypdffit2_set_scat__name__[]; -extern "C" -PyObject * pypdffit2_set_scat(PyObject *, PyObject *); - -// reset_scat -extern char pypdffit2_reset_scat__doc__[]; -extern char pypdffit2_reset_scat__name__[]; -extern "C" -PyObject * pypdffit2_reset_scat(PyObject *, PyObject *); - -// lat -extern char pypdffit2_lat__doc__[]; -extern char pypdffit2_lat__name__[]; -extern "C" -PyObject * pypdffit2_lat(PyObject *, PyObject *); - -// x -extern char pypdffit2_x__doc__[]; -extern char pypdffit2_x__name__[]; -extern "C" -PyObject * pypdffit2_x(PyObject *, PyObject *); - -// y -extern char pypdffit2_y__doc__[]; -extern char pypdffit2_y__name__[]; -extern "C" -PyObject * pypdffit2_y(PyObject *, PyObject *); - -// z -extern char pypdffit2_z__doc__[]; -extern char pypdffit2_z__name__[]; -extern "C" -PyObject * pypdffit2_z(PyObject *, PyObject *); - -// u11 -extern char pypdffit2_u11__doc__[]; -extern char pypdffit2_u11__name__[]; -extern "C" -PyObject * pypdffit2_u11(PyObject *, PyObject *); - -// u22 -extern char pypdffit2_u22__doc__[]; -extern char pypdffit2_u22__name__[]; -extern "C" -PyObject * pypdffit2_u22(PyObject *, PyObject *); - -// u33 -extern char pypdffit2_u33__doc__[]; -extern char pypdffit2_u33__name__[]; -extern "C" -PyObject * pypdffit2_u33(PyObject *, PyObject *); - -// u12 -extern char pypdffit2_u12__doc__[]; -extern char pypdffit2_u12__name__[]; -extern "C" -PyObject * pypdffit2_u12(PyObject *, PyObject *); - -// u13 -extern char pypdffit2_u13__doc__[]; -extern char pypdffit2_u13__name__[]; -extern "C" -PyObject * pypdffit2_u13(PyObject *, PyObject *); - -// u23 -extern char pypdffit2_u23__doc__[]; -extern char pypdffit2_u23__name__[]; -extern "C" -PyObject * pypdffit2_u23(PyObject *, PyObject *); - -// occ -extern char pypdffit2_occ__doc__[]; -extern char pypdffit2_occ__name__[]; -extern "C" -PyObject * pypdffit2_occ(PyObject *, PyObject *); - -// pscale -extern char pypdffit2_pscale__doc__[]; -extern char pypdffit2_pscale__name__[]; -extern "C" -PyObject * pypdffit2_pscale(PyObject *, PyObject *); - -// spdiameter -extern char pypdffit2_spdiameter__doc__[]; -extern char pypdffit2_spdiameter__name__[]; -extern "C" -PyObject * pypdffit2_spdiameter(PyObject *, PyObject *); - -// stepcut -extern char pypdffit2_stepcut__doc__[]; -extern char pypdffit2_stepcut__name__[]; -extern "C" -PyObject * pypdffit2_stepcut(PyObject *, PyObject *); - -// sratio -extern char pypdffit2_sratio__doc__[]; -extern char pypdffit2_sratio__name__[]; -extern "C" -PyObject * pypdffit2_sratio(PyObject *, PyObject *); - -// delta2 -extern char pypdffit2_delta2__doc__[]; -extern char pypdffit2_delta2__name__[]; -extern "C" -PyObject * pypdffit2_delta2(PyObject *, PyObject *); - -// delta1 -extern char pypdffit2_delta1__doc__[]; -extern char pypdffit2_delta1__name__[]; -extern "C" -PyObject * pypdffit2_delta1(PyObject *, PyObject *); - -// dscale -extern char pypdffit2_dscale__doc__[]; -extern char pypdffit2_dscale__name__[]; -extern "C" -PyObject * pypdffit2_dscale(PyObject *, PyObject *); - -// qdamp -extern char pypdffit2_qdamp__doc__[]; -extern char pypdffit2_qdamp__name__[]; -extern "C" -PyObject * pypdffit2_qdamp(PyObject *, PyObject *); - -// qbroad -extern char pypdffit2_qbroad__doc__[]; -extern char pypdffit2_qbroad__name__[]; -extern "C" -PyObject * pypdffit2_qbroad(PyObject *, PyObject *); - -// rcut -extern char pypdffit2_rcut__doc__[]; -extern char pypdffit2_rcut__name__[]; -extern "C" -PyObject * pypdffit2_rcut(PyObject *, PyObject *); - -// get_atoms -extern char pypdffit2_get_atoms__doc__[]; -extern char pypdffit2_get_atoms__name__[]; -extern "C" -PyObject * pypdffit2_get_atoms(PyObject *, PyObject *); - -// num_atoms -extern char pypdffit2_num_atoms__doc__[]; -extern char pypdffit2_num_atoms__name__[]; -extern "C" -PyObject * pypdffit2_num_atoms(PyObject *, PyObject *); - -// get_atom_types -extern char pypdffit2_get_atom_types__doc__[]; -extern char pypdffit2_get_atom_types__name__[]; -extern "C" -PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *); - -// num_phases -extern char pypdffit2_num_phases__doc__[]; -extern char pypdffit2_num_phases__name__[]; -extern "C" -PyObject * pypdffit2_num_phases(PyObject *, PyObject *); - -// num_datasets -extern char pypdffit2_num_datasets__doc__[]; -extern char pypdffit2_num_datasets__name__[]; -extern "C" -PyObject * pypdffit2_num_datasets(PyObject *, PyObject *); - -// phase_fractions -extern char pypdffit2_phase_fractions__doc__[]; -extern char pypdffit2_phase_fractions__name__[]; -extern "C" -PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *); - -// redirect_stdout -extern char pypdffit2_redirect_stdout__doc__[]; -extern char pypdffit2_redirect_stdout__name__[]; -extern "C" -PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *); - -// is_element -extern char pypdffit2_is_element__doc__[]; -extern char pypdffit2_is_element__name__[]; -extern "C" -PyObject * pypdffit2_is_element(PyObject *, PyObject *); - -#endif // PYPDFFIT2_MISC_H diff --git a/pdffit2module/pdffit2module.cc b/pdffit2module/pdffit2module.cc deleted file mode 100644 index acf89fa3..00000000 --- a/pdffit2module/pdffit2module.cc +++ /dev/null @@ -1,150 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* The python pdffit2 module. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include -#include - -#include "pyexceptions.h" -#include "bindings.h" -#include "libpdffit2/pdffit.h" - -using namespace std; - -char pypdffit2_module__doc__[] = - "pdffit2 - interface to the core calculation routines in C++"; - -// local helper for transfer version information from -// Python to C++ PdfFit class. - -namespace { - -void transfer_version() -{ - // obtain version information from the Python module - PyObject* mdiffpy_pdffit2; - mdiffpy_pdffit2 = PyImport_ImportModule("diffpy.pdffit2"); - if (!mdiffpy_pdffit2) return; - PyObject* pyversion; - pyversion = PyObject_GetAttrString(mdiffpy_pdffit2, "__version__"); - Py_DECREF(mdiffpy_pdffit2); - if (!pyversion) return; - const char* cversion; -#if PY_MAJOR_VERSION >= 3 - cversion = PyUnicode_AsUTF8(pyversion); -#else - cversion = PyString_AsString(pyversion); -#endif - // copy version information to C++ constant - if (cversion) PdfFit::version(cversion); - Py_DECREF(pyversion); -} - - -void setup_module_contents(PyObject* d) -{ - // install the module exceptions - pypdffit2_runtimeError = PyErr_NewException("pdffit2.runtime", 0, 0); - PyDict_SetItemString(d, "RuntimeException", pypdffit2_runtimeError); - - pypdffit2_unassignedError = PyErr_NewException( - "pdffit2.unassignedError", 0, 0); - PyDict_SetItemString(d, "unassignedError", pypdffit2_unassignedError); - - pypdffit2_dataError = PyErr_NewException( - "pdffit2.dataError", 0, 0); - PyDict_SetItemString(d, "dataError", pypdffit2_dataError); - - pypdffit2_structureError = PyErr_NewException( - "pdffit2.structureError", 0, 0); - PyDict_SetItemString(d, "structureError", pypdffit2_structureError); - - pypdffit2_calculationError = PyErr_NewException( - "pdffit2.calculationError", 0, 0); - PyDict_SetItemString(d, "calculationError", pypdffit2_calculationError); - - pypdffit2_constraintError = PyErr_NewException( - "pdffit2.constraintError", 0, 0); - PyDict_SetItemString(d, "constraintError", pypdffit2_constraintError); - - transfer_version(); -} - -} // namespace ------------------------------------------------------------- - -// TODO remove PY_MAJOR_VERSION blocks after ending support for Python 2.7 - -#if PY_MAJOR_VERSION == 2 - -// Initialization function for the module (*must* be called initpdffit2) -extern "C" -void -initpdffit2() -{ - // create the module and add the functions - PyObject * m = Py_InitModule4( - "pdffit2", pypdffit2_methods, - pypdffit2_module__doc__, 0, PYTHON_API_VERSION); - - // get its dictionary - PyObject * d = PyModule_GetDict(m); - - // check for errors - if (PyErr_Occurred()) { - Py_FatalError("can't initialize module pdffit2"); - } - - // install the module exceptions and version string - setup_module_contents(d); - - return; -} - -#else - -// Module initialization for Python 3 ---------------------------------------- - -static struct PyModuleDef pdffit2moduledef = { - PyModuleDef_HEAD_INIT, - // .m_name = - "pdffit2", - // .m_doc = - pypdffit2_module__doc__, - // .m_size = - -1, - // .m_methods = - pypdffit2_methods, -}; - - -PyMODINIT_FUNC -PyInit_pdffit2(void) - -{ - PyObject *module = PyModule_Create(&pdffit2moduledef); - if (module == NULL) return NULL; - - PyObject* d = PyModule_GetDict(module); - setup_module_contents(d); - return module; -} - -#endif // PY_MAJOR_VERSION == 2 - -// End of file diff --git a/pdffit2module/pyexceptions.cc b/pdffit2module/pyexceptions.cc deleted file mode 100644 index e94b3d16..00000000 --- a/pdffit2module/pyexceptions.cc +++ /dev/null @@ -1,30 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions for pdffit2 python module. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include - -PyObject *pypdffit2_runtimeError = 0; -PyObject *pypdffit2_unassignedError = 0; -PyObject *pypdffit2_dataError = 0; -PyObject *pypdffit2_structureError = 0; -PyObject *pypdffit2_calculationError = 0; -PyObject *pypdffit2_constraintError = 0; - -// End of file diff --git a/pdffit2module/pyexceptions.h b/pdffit2module/pyexceptions.h deleted file mode 100644 index 09bd942b..00000000 --- a/pdffit2module/pyexceptions.h +++ /dev/null @@ -1,33 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions for pdffit2 python module. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_EXCEPTIONS_H -#define PYPDFFIT2_EXCEPTIONS_H - -// exceptions - -extern PyObject *pypdffit2_runtimeError; -extern PyObject *pypdffit2_unassignedError; -extern PyObject *pypdffit2_dataError; -extern PyObject *pypdffit2_structureError; -extern PyObject *pypdffit2_constraintError; -extern PyObject *pypdffit2_calculationError; - -#endif // PYPDFFIT2_EXCEPTIONS_H From c6d6cffc62c54bd1dabc7a74994d3c6f77d41e1d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:02:27 -0400 Subject: [PATCH 2/7] Update init py files --- src/diffpy/__init__.py | 6 +- src/diffpy/pdffit2/__init__.py | 9 ++- src/diffpy/pdffit2/tests/__init__.py | 102 +++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 5b3af482..e1ae0400 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (c) 2008 trustees of the Michigan State University. +# All rights reserved. # (c) 2024 The Trustees of Columbia University in the City of New York. # All rights reserved. # @@ -13,7 +15,9 @@ # ############################################################################## -"""Blank namespace package for module diffpy.""" +"""diffpy - tools for structure analysis by diffraction. + +Blank namespace package for module diffpy.""" from pkgutil import extend_path diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index e12b2fb9..c5a8e039 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (c) 2006 trustees of the Michigan State University. +# All rights reserved. # (c) 2024 The Trustees of Columbia University in the City of New York. # All rights reserved. # @@ -16,9 +18,14 @@ """PDFfit2 - real space structure refinement program.""" # package version -from diffpy.pdffit2.version import __version__ +from diffpy.pdffit2.version import __version__, __date__ +from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.pdffit2 import is_element # silence the pyflakes syntax checker assert __version__ or True +assert __date__ or True +assert all((PdfFit, redirect_stdout, is_element)) # End of file diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index e69de29b..174b14d2 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2012 Trustees of the Columbia University in the City of New York. +# All rights reserved. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +"""Unit tests for the diffpy.pdffit2 package. +""" + +import unittest + +def testsuite(pattern=''): + '''Create a unit tests suite for the diffpy.pdffit2 package. + + Parameters + ---------- + pattern : str, optional + Regular expression pattern for selecting test cases. + Select all tests when empty. Ignore the pattern when + any of unit test modules fails to import. + + Returns + ------- + suite : `unittest.TestSuite` + The TestSuite object containing the matching tests. + ''' + import re + from os.path import dirname + from itertools import chain + from pkg_resources import resource_filename + loader = unittest.defaultTestLoader + thisdir = resource_filename(__name__, '') + depth = __name__.count('.') + 1 + topdir = thisdir + for i in range(depth): + topdir = dirname(topdir) + suite_all = loader.discover(thisdir, pattern='*Test*.py', + top_level_dir=topdir) + # always filter the suite by pattern to test-cover the selection code. + suite = unittest.TestSuite() + rx = re.compile(pattern) + tsuites = list(chain.from_iterable(suite_all)) + tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) + if not tsok: # pragma: no cover + return suite_all + tcases = chain.from_iterable(tsuites) + for tc in tcases: + tcwords = tc.id().split('.') + shortname = '.'.join(tcwords[-3:]) + if rx.search(shortname): + suite.addTest(tc) + # verify all tests are found for an empty pattern. + assert pattern or suite_all.countTestCases() == suite.countTestCases() + return suite + + +def test(): + '''Execute all unit tests for the diffpy.pdffit2 package. + + Returns + ------- + result : `unittest.TestResult` + ''' + suite = testsuite() + runner = unittest.TextTestRunner() + result = runner.run(suite) + return result + + +def testdeps(): + '''Execute all unit tests for diffpy.pdffit2 and its dependencies. + + Returns + ------- + result : `unittest.TestResult` + ''' + from importlib import import_module + modulenames = ''' + diffpy.pdffit2.tests + diffpy.structure.tests + '''.split() + suite = unittest.TestSuite() + for mname in modulenames: + mod = import_module(mname) + suite.addTests(mod.testsuite()) + runner = unittest.TextTestRunner() + result = runner.run(suite) + return result + + +# End of file From 055ccd04a1fd78ed618aecf740d61321b1b60267 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:06:22 -0400 Subject: [PATCH 3/7] add six to requirements --- requirements/run.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/run.txt b/requirements/run.txt index 9cc306b0..33133cd6 100644 --- a/requirements/run.txt +++ b/requirements/run.txt @@ -1 +1,2 @@ diffpy.structure +six From e77515def0e4e488648e4450e315f750985bf214 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:09:54 -0400 Subject: [PATCH 4/7] run.py without pytest --- src/diffpy/pdffit2/tests/run.py | 42 +++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py index 463f010e..39ae1dcf 100644 --- a/src/diffpy/pdffit2/tests/run.py +++ b/src/diffpy/pdffit2/tests/run.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (c) 2012 Trustees of the Columbia University in the City of New York. +# All rights reserved. # (c) 2024 The Trustees of Columbia University in the City of New York. # All rights reserved. # @@ -12,23 +14,39 @@ # See LICENSE.rst for license information. # ############################################################################## + """Convenience module for executing all unit tests with python -m diffpy.pdffit2.tests.run """ -import sys -import pytest +if __name__ == '__main__': + import sys + # show warnings by default + if not sys.warnoptions: + import os, warnings + warnings.simplefilter("default") + # also affect subprocesses + os.environ["PYTHONWARNINGS"] = "default" + from diffpy.pdffit2.tests import test + # produce zero exit code for a successful test + sys.exit(not test().wasSuccessful()) + -if __name__ == "__main__": - # show output results from every test function - args = ["-v"] - # show the message output for skipped and expected failure tests - if len(sys.argv) > 1: - args.extend(sys.argv[1:]) - print("pytest arguments: {}".format(args)) - # call pytest and exit with the return code from pytest - exit_res = pytest.main(args) - sys.exit(exit_res) +# Consider upgrading to pytest +# import sys +# +# import pytest +# +# if __name__ == "__main__": +# # show output results from every test function +# args = ["-v"] +# # show the message output for skipped and expected failure tests +# if len(sys.argv) > 1: +# args.extend(sys.argv[1:]) +# print("pytest arguments: {}".format(args)) +# # call pytest and exit with the return code from pytest +# exit_res = pytest.main(args) +# sys.exit(exit_res) # End of file From 29d68a277e06e4ee5b6d04c8e5159a230f8cc4cf Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:25:08 -0400 Subject: [PATCH 5/7] add other vars in version.py --- src/diffpy/pdffit2/version.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 69e4d1b2..478a5ca7 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -16,11 +16,14 @@ """Definition of __version__.""" # We do not use the other three variables, but can be added back if needed. -# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] +__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] # obtain version information from importlib.metadata import version __version__ = version("diffpy.pdffit2") +__date__ = __all__[0] +__git_commit__ = __all__[1] +__timestamp__ = __all__[2] -# End of file +# End of file \ No newline at end of file From 7f6ca7cd7e4ba4f879dd4133634c7bbc33b27bf4 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:30:12 -0400 Subject: [PATCH 6/7] pre-commit fixes --- src/diffpy/pdffit2/tests/__init__.py | 37 +++++++++++++++------------- src/diffpy/pdffit2/tests/run.py | 8 ++++-- src/diffpy/pdffit2/version.py | 2 +- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index 174b14d2..4ffdb21c 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -20,8 +20,9 @@ import unittest -def testsuite(pattern=''): - '''Create a unit tests suite for the diffpy.pdffit2 package. + +def testsuite(pattern=""): + """Create a unit tests suite for the diffpy.pdffit2 package. Parameters ---------- @@ -34,30 +35,31 @@ def testsuite(pattern=''): ------- suite : `unittest.TestSuite` The TestSuite object containing the matching tests. - ''' + """ import re - from os.path import dirname from itertools import chain + from os.path import dirname + from pkg_resources import resource_filename + loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, '') - depth = __name__.count('.') + 1 + thisdir = resource_filename(__name__, "") + depth = __name__.count(".") + 1 topdir = thisdir for i in range(depth): topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern='*Test*.py', - top_level_dir=topdir) + suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) # always filter the suite by pattern to test-cover the selection code. suite = unittest.TestSuite() rx = re.compile(pattern) tsuites = list(chain.from_iterable(suite_all)) tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover + if not tsok: # pragma: no cover return suite_all tcases = chain.from_iterable(tsuites) for tc in tcases: - tcwords = tc.id().split('.') - shortname = '.'.join(tcwords[-3:]) + tcwords = tc.id().split(".") + shortname = ".".join(tcwords[-3:]) if rx.search(shortname): suite.addTest(tc) # verify all tests are found for an empty pattern. @@ -66,12 +68,12 @@ def testsuite(pattern=''): def test(): - '''Execute all unit tests for the diffpy.pdffit2 package. + """Execute all unit tests for the diffpy.pdffit2 package. Returns ------- result : `unittest.TestResult` - ''' + """ suite = testsuite() runner = unittest.TextTestRunner() result = runner.run(suite) @@ -79,17 +81,18 @@ def test(): def testdeps(): - '''Execute all unit tests for diffpy.pdffit2 and its dependencies. + """Execute all unit tests for diffpy.pdffit2 and its dependencies. Returns ------- result : `unittest.TestResult` - ''' + """ from importlib import import_module - modulenames = ''' + + modulenames = """ diffpy.pdffit2.tests diffpy.structure.tests - '''.split() + """.split() suite = unittest.TestSuite() for mname in modulenames: mod = import_module(mname) diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py index 39ae1dcf..d5c4ea41 100644 --- a/src/diffpy/pdffit2/tests/run.py +++ b/src/diffpy/pdffit2/tests/run.py @@ -20,15 +20,19 @@ """ -if __name__ == '__main__': +if __name__ == "__main__": import sys + # show warnings by default if not sys.warnoptions: - import os, warnings + import os + import warnings + warnings.simplefilter("default") # also affect subprocesses os.environ["PYTHONWARNINGS"] = "default" from diffpy.pdffit2.tests import test + # produce zero exit code for a successful test sys.exit(not test().wasSuccessful()) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 478a5ca7..60d34a97 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -26,4 +26,4 @@ __git_commit__ = __all__[1] __timestamp__ = __all__[2] -# End of file \ No newline at end of file +# End of file From 26776a3b492df4203483e3343651b1b299b61695 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:32:42 -0400 Subject: [PATCH 7/7] isort fix --- .pre-commit-config.yaml | 2 +- src/diffpy/pdffit2/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ab2ecdd..8aedd156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: hooks: - id: isort args: ["--profile", "black", "--order-by-type"] - exclude: ^diffpy/pdffit2/__init__\.py$ + exclude: ^src/diffpy/pdffit2/__init__\.py$ - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index c5a8e039..fe3fbce3 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -18,9 +18,9 @@ """PDFfit2 - real space structure refinement program.""" # package version +from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.version import __version__, __date__ from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.pdffit2 import is_element # silence the pyflakes syntax checker