Example #1
0
 def __init__(self, name = "pdf"):
     """Initialize the generator.
     """
     from diffpy.srreal.pdfcalculator import PDFCalculator
     BasePDFGenerator.__init__(self, name)
     self._setCalculator(PDFCalculator())
     return
Example #2
0
    def __init__(self, name="pdf"):
        """Initialize the generator.

        """
        BasePDFGenerator.__init__(self, name)
        self._setCalculator(PDFCalculator())
        return
    def __init__(self, name = "pdf"):
        """Initialize the generator.

        """
        BasePDFGenerator.__init__(self, name)
        self._setCalculator(DebyePDFCalculator())
        return
Example #4
0
    def setPhase(self, parset, periodic=None):
        """Set the phase that will be used to calculate the PDF.
        """
        if periodic == None:
            periodic = self.periodic

        return BasePDFGenerator.setPhase(self, parset, periodic)
Example #5
0
    def __init__(self, name="pdf", mode='pdf'):
        """Initialize the generator.

        """
        self.mode = mode
        self.dPDFmode = None
        BasePDFGenerator.__init__(self, name)
        if mode == 'pdf':
            self._setCalculator(PDFCalculator())
            self.periodic = True
        elif mode == 'debye':
            self._setCalculator(DebyePDFCalculator())
            self.periodic = False
        else:
            raise TypeError('PDF generator mode wrong, should be "pdf" or "debye"')
        return
    def setPhase(self, parset, periodic = False):
        """Set the phase that will be used to calculate the PDF.

        Set the phase directly with a DiffpyStructureParSet,
        ObjCrystCrystalParSet or ObjCrystMoleculeParSet that adapts a structure
        object (from diffpy or pyobjcryst).  The passed ParameterSet will be
        managed by this generator.

        parset  --  A SrRealParSet that holds the structural information.
                    This can be used to share the phase between multiple
                    BasePDFGenerators, and have the changes in one reflect in
                    another.
        periodic -- The structure should be treated as periodic (default True).
                    Note that some structures do not support periodicity, in
                    which case this will be ignored.

        """
        return BasePDFGenerator.setPhase(self, parset, periodic)
    def setPhase(self, parset, periodic = False):
        """Set the phase that will be used to calculate the PDF.

        Set the phase directly with a DiffpyStructureParSet,
        ObjCrystCrystalParSet or ObjCrystMoleculeParSet that adapts a structure
        object (from diffpy or pyobjcryst).  The passed ParameterSet will be
        managed by this generator.

        parset  --  A SrRealParSet that holds the structural information.
                    This can be used to share the phase between multiple
                    BasePDFGenerators, and have the changes in one reflect in
                    another.
        periodic -- The structure should be treated as periodic (default True).
                    Note that some structures do not support periodicity, in
                    which case this will be ignored.

        """
        return BasePDFGenerator.setPhase(self, parset, periodic)
    def setStructure(self, stru, name = "phase", periodic = False):
        """Set the structure that will be used to calculate the PDF.

        This creates a DiffpyStructureParSet, ObjCrystCrystalParSet or
        ObjCrystMoleculeParSet that adapts stru to a ParameterSet interface.
        See those classes (located in diffpy.srfit.structure) for how they are
        used. The resulting ParameterSet will be managed by this generator.

        stru    --  diffpy.Structure.Structure, pyobjcryst.crystal.Crystal or
                    pyobjcryst.molecule.Molecule instance . Default None.
        name    --  A name to give to the managed ParameterSet that adapts stru
                    (default "phase").
        periodic -- The structure should be treated as periodic (default
                    False). Note that some structures do not support
                    periodicity, in which case this will have no effect on the
                    PDF calculation.

        """
        return BasePDFGenerator.setStructure(self, stru, name, periodic)
    def setStructure(self, stru, name = "phase", periodic = False):
        """Set the structure that will be used to calculate the PDF.

        This creates a DiffpyStructureParSet, ObjCrystCrystalParSet or
        ObjCrystMoleculeParSet that adapts stru to a ParameterSet interface.
        See those classes (located in diffpy.srfit.structure) for how they are
        used. The resulting ParameterSet will be managed by this generator.

        stru    --  diffpy.structure.Structure, pyobjcryst.crystal.Crystal or
                    pyobjcryst.molecule.Molecule instance.  Default None.
        name    --  A name to give to the managed ParameterSet that adapts stru
                    (default "phase").
        periodic -- The structure should be treated as periodic (default
                    False). Note that some structures do not support
                    periodicity, in which case this will have no effect on the
                    PDF calculation.

        """
        return BasePDFGenerator.setStructure(self, stru, name, periodic)