Exemplo n.º 1
0
 def test_d_spacing_for_first_hkl_of_bcc(self):
     """Assert the d_spacing values for the first BCC structure are correct"""
     _handler = BraggEdgeCalculator(structure_name="BCC", lattice=1.)
     _handler.calculate_hkl()
     _handler.calculate_bragg_edges()
     self.assertAlmostEqual(0.7071, _handler.d_spacing[0], delta=0.0001)
     self.assertAlmostEqual(0.5, _handler.d_spacing[1], delta=0.0001)
     self.assertAlmostEqual(0.4083, _handler.d_spacing[2], delta=0.0001)
Exemplo n.º 2
0
 def test_right_hkl_number_calculated_for_BCC(self):
     """Assert that the right number of hkl sets is returned for BCC"""
     _structure_name = "BCC"
     _handler = BraggEdgeCalculator(structure_name=_structure_name,
                                    number_of_set=5)
     _handler.calculate_hkl()
     _hkl = _handler.hkl
     self.assertEqual(5, len(_hkl))
Exemplo n.º 3
0
 def test_bragg_edge_for_first_hkl_of_bcc(self):
     """Assert the bragg edge values for the first BCC structure are correct"""
     _handler = BraggEdgeCalculator(structure_name="BCC", lattice=1.)
     _handler.calculate_hkl()
     _handler.calculate_bragg_edges()
     self.assertAlmostEqual(1.4142, _handler.bragg_edges[0], delta=0.0001)
     self.assertAlmostEqual(1.0, _handler.bragg_edges[1], delta=0.0001)
     self.assertAlmostEqual(0.8165, _handler.bragg_edges[2], delta=0.0001)
 def test_d_spacing_for_first_hkl_of_bcc(self):
     """Assert the d_spacing values for the first BCC structure are correct"""
     _handler = BraggEdgeCalculator(structure_name = "BCC", lattice=1.)
     _handler.calculate_hkl()
     _handler.calculate_bragg_edges()
     self.assertAlmostEqual(0.7071, _handler.d_spacing[0], delta=0.0001)
     self.assertAlmostEqual(0.5, _handler.d_spacing[1], delta=0.0001)
     self.assertAlmostEqual(0.4083, _handler.d_spacing[2], delta=0.0001)
 def test_right_hkl_number_calculated_for_BCC(self):
     """Assert that the right number of hkl sets is returned for BCC"""
     _structure_name = "BCC"
     _handler = BraggEdgeCalculator(structure_name = _structure_name, 
                                          number_of_set = 5)
     _handler.calculate_hkl()
     _hkl = _handler.hkl
     self.assertEqual(5, len(_hkl))
 def test_bragg_edge_for_first_hkl_of_bcc(self):
     """Assert the bragg edge values for the first BCC structure are correct"""
     _handler = BraggEdgeCalculator(structure_name = "BCC", lattice=1.)
     _handler.calculate_hkl()
     _handler.calculate_bragg_edges()
     self.assertAlmostEqual(1.4142, _handler.bragg_edges[0], delta=0.0001)
     self.assertAlmostEqual(1.0, _handler.bragg_edges[1], delta=0.0001)
     self.assertAlmostEqual(0.8165, _handler.bragg_edges[2], delta=0.0001)
Exemplo n.º 7
0
 def test_right_hkl_set_is_calculated_for_BCC(self):
     """Assert that the right set of hkl sets is returned for BCC"""
     _structure_name = "BCC"
     _handler = BraggEdgeCalculator(structure_name=_structure_name,
                                    number_of_set=5)
     _handler.calculate_hkl()
     _hkl = _handler.hkl
     self.assertEqual([1, 1, 0], _hkl[0])
     self.assertEqual([2, 0, 0], _hkl[1])
     self.assertEqual([2, 1, 1], _hkl[2])
     self.assertEqual([2, 2, 0], _hkl[3])
     self.assertEqual([2, 2, 2], _hkl[4])
 def test_right_hkl_set_is_calculated_for_BCC(self):
     """Assert that the right set of hkl sets is returned for BCC"""
     _structure_name = "BCC"
     _handler = BraggEdgeCalculator(structure_name = _structure_name, 
                                          number_of_set = 5)
     _handler.calculate_hkl()
     _hkl = _handler.hkl
     self.assertEqual([1, 1, 0], _hkl[0])
     self.assertEqual([2, 0, 0], _hkl[1])
     self.assertEqual([2, 1, 1], _hkl[2])
     self.assertEqual([2, 2, 0], _hkl[3])
     self.assertEqual([2, 2, 2], _hkl[4])