Пример #1
0
    def testInheritatedMethods(self):
        ph1 = PolarizedPhoton(8000.0, Vector(2, 4, 5),
                              StokesVector([1, 2, 3, 4]))

        ph1.setUnitDirectionVector(Vector(1, 0, 0))
        ph1.setEnergy(9000)

        self.assertTrue(ph1.unitDirectionVector().components()[0] == 1)
        self.assertTrue(ph1.unitDirectionVector().components()[1] == 0)
        self.assertTrue(ph1.unitDirectionVector().components()[2] == 0)

        self.assertTrue(ph1.energy() == 9000.0)
Пример #2
0
 def testEnergy(self):
     photon = PolarizedPhoton(4000, Vector(0, 0, 1),
                              StokesVector([1.0, 0.0, 1.0, 0.0]))
     self.assertEqual(photon.energy(), 4000)