예제 #1
0
class TestSimulatedDevice(unittest.TestCase):
	def setUp(self):
		self.front = QuantumEfficiency.IdealQE(1.1)
		self.back = QuantumEfficiency.ZeroQE()
		self.device = SimpleDevice(self.front)
		self.optical = SimpleOpticalParameters(0.5, 1.0)
		self.illumination = IlluminationParameters()
		self.params = SimulationParameters(self.optical, self.illumination)
		
	def test_eqes(self):
		compare.CompareArrays(self, self.front, self.device.front_eqe())
		compare.CompareArrays(self, self.back, self.device.back_eqe())
		
	def test_voltage(self):
		self.device.set_voltage(1.0)
		
		self.assertRaises(Exception, self.device.front_eqe, self.device)
	
	def test_optical_params(self):
		self.assertAlmostEqual(self.params.optical.front_reflectance(600), 0.5)
		self.assertAlmostEqual(self.params.optical.back_reflectance(600), 1.0)
	
	def test_illumination(self):
		self.assertTrue(self.illumination.dark)
		
		self.illumination.add_light(Spectrum.AM15G(), True)
		self.assertFalse(self.illumination.dark)
		self.assertIsNot(self.illumination.absolute_light(True), None)
		self.assertIs(self.illumination.absolute_light(False), None)
		
		#We should return an error if there's more than one light
		self.illumination.add_light(Spectrum.AM15G(), True)
		self.assertRaises(Exception, self.illumination.absolute_light, self.illumination, True)
		
예제 #2
0
 def setUp(self):
     self.front = QuantumEfficiency.IdealQE(1.1)
     self.back = QuantumEfficiency.ZeroQE()
     self.device = SimpleDevice(self.front)
     self.optical = SimpleOpticalParameters(0.5, 1.0)
     self.illumination = IlluminationParameters()
     self.params = SimulationParameters(self.optical, self.illumination)
예제 #3
0
class TestSimulatedDevice(unittest.TestCase):
    def setUp(self):
        self.front = QuantumEfficiency.IdealQE(1.1)
        self.back = QuantumEfficiency.ZeroQE()
        self.device = SimpleDevice(self.front)
        self.optical = SimpleOpticalParameters(0.5, 1.0)
        self.illumination = IlluminationParameters()
        self.params = SimulationParameters(self.optical, self.illumination)

    def test_eqes(self):
        compare.CompareArrays(self, self.front, self.device.front_eqe())
        compare.CompareArrays(self, self.back, self.device.back_eqe())

    def test_voltage(self):
        self.device.set_voltage(1.0)

        self.assertRaises(Exception, self.device.front_eqe, self.device)

    def test_optical_params(self):
        self.assertAlmostEqual(self.params.optical.front_reflectance(600), 0.5)
        self.assertAlmostEqual(self.params.optical.back_reflectance(600), 1.0)

    def test_illumination(self):
        self.assertTrue(self.illumination.dark)

        self.illumination.add_light(Spectrum.AM15G(), True)
        self.assertFalse(self.illumination.dark)
        self.assertIsNot(self.illumination.absolute_light(True), None)
        self.assertIs(self.illumination.absolute_light(False), None)

        #We should return an error if there's more than one light
        self.illumination.add_light(Spectrum.AM15G(), True)
        self.assertRaises(Exception, self.illumination.absolute_light,
                          self.illumination, True)
예제 #4
0
	def setUp(self):
		self.front = QuantumEfficiency.IdealQE(1.1)
		self.back = QuantumEfficiency.ZeroQE()
		self.device = SimpleDevice(self.front)
		self.optical = SimpleOpticalParameters(0.5, 1.0)
		self.illumination = IlluminationParameters()
		self.params = SimulationParameters(self.optical, self.illumination)
예제 #5
0
    def test_current(self):
        sil = SimpleDevice.FromPC1DDirectory(
            os.path.join(os.path.dirname(__file__), "data", "si_reference"))

        current = sil.current()

        self.assertAlmostEqual(current, 0.0335616807321)
예제 #6
0
 def test_simpledevice(self):
     sil = SimpleDevice.FromPC1DDirectory(
         os.path.join(os.path.dirname(__file__), "data", "si_reference"))