Exemplo n.º 1
0
 def setUp(self):
     self.olc = OverlapCalculator()
     if not hasattr(self, 'rutile'):
         type(self).rutile = loadObjCrystCrystal('rutile.cif')
     if not hasattr(self, 'nickel'):
         type(self).nickel = loadObjCrystCrystal('Ni.cif')
     return
 def setUp(self):
     self.bdc = BondCalculator()
     if not hasattr(self, 'rutile'):
         type(self).rutile = loadObjCrystCrystal('rutile.cif')
     if not hasattr(self, 'nickel'):
         type(self).nickel = loadObjCrystCrystal('Ni.cif')
     return
Exemplo n.º 3
0
 def test_from_rutile(self):
     """check SFAverage.fromStructure for pyobjcryst Crystal of rutile.
     """
     rutile = loadObjCrystCrystal('rutile.cif')
     qa = numpy.arange(0, 25, 0.1)
     sfavg = SFAverage.fromStructure(rutile, self.sftx, qa)
     fti = self.sftx.lookup('Ti', qa)
     fo = self.sftx.lookup('O', qa)
     self.assertTrue(numpy.allclose((fti + 2 * fo) / 3.0, sfavg.f1avg))
     fti2, fo2 = fti**2, fo**2
     self.assertTrue(numpy.allclose((fti2 + 2 * fo2) / 3.0, sfavg.f2avg))
     self.assertEqual(6, sfavg.count)
Exemplo n.º 4
0
 def _comparePDFs(self, nickname, pdfbasename, cifbasename):
     def setself(**kwtoset):
         for n, v in kwtoset.items():
             setattr(self, nickname + '_' + n, v)
         return
     r, gobs, cfg = _loadExpectedPDF(pdfbasename)
     setself(r=r, gobs=gobs, cfg=cfg)
     crst = loadObjCrystCrystal(cifbasename)
     setself(crst=crst)
     pdfc = _makePDFCalculator(crst, cfg)
     gcalc = pdfc.pdf
     mxnd = _maxNormDiff(gobs, gcalc)
     setself(gcalc=gcalc, mxnd=mxnd)
     return
Exemplo n.º 5
0
 def _comparePDFs(self, nickname, pdfbasename, cifbasename):
     def setself(**kwtoset):
         for n, v in kwtoset.items():
             setattr(self, nickname + '_' + n, v)
         return
     r, gobs, cfg = _loadExpectedPDF(pdfbasename)
     setself(r=r, gobs=gobs, cfg=cfg)
     crst = loadObjCrystCrystal(cifbasename)
     setself(crst=crst)
     pdfc = _makePDFCalculator(crst, cfg)
     gcalc = pdfc.pdf
     mxnd = _maxNormDiff(gobs, gcalc)
     setself(gcalc=gcalc, mxnd=mxnd)
     return
 def setUp(self):
     rutile_crystal = loadObjCrystCrystal('TiO2_rutile-fit.cif')
     self.rutile = createStructureAdapter(rutile_crystal)
     return
Exemplo n.º 7
0
 def setUp(self):
     rutile_crystal = loadObjCrystCrystal('TiO2_rutile-fit.cif')
     self.rutile = createStructureAdapter(rutile_crystal)
     return
Exemplo n.º 8
0
 def setUp(self):
     rutile_crystal = loadObjCrystCrystal(rutile_cif)
     self.rutile = createStructureAdapter(rutile_crystal)
     return
 def setUp(self):
     rutile_crystal = loadObjCrystCrystal(rutile_cif)
     self.rutile = createStructureAdapter(rutile_crystal)
     return