示例#1
0
    def test_properties(self):
        il = Illuminant("D65.mat")
        self.assertRaises(Exception, il.energy)
        self.assertRaises(Exception, il.luminance)

        il.wave = np.array(range(400, 710, 10))
        self.assertTrue(il.photons.size == 31, "wavelength interpolation failed")
示例#2
0
 def test_constructor(self):
     self.assertRaises(Exception, Illuminant())
     self.assertRaises(Exception, Illuminant("D50.mat"))
     self.assertRaises(Exception, Illuminant("D65.mat"))
     self.assertRaises(Exception, Illuminant("D75.mat"))
     self.assertRaises(Exception, Illuminant("Fluorescent.mat"))
     self.assertRaises(Exception, Illuminant("Tungsten.mat"))
示例#3
0
 def test_properties(self):
     scene = Scene('macbeth')
     il = Illuminant('D50.mat', wave=scene.wave)
     scene.mean_luminance = 50
     self.assertRaises(Exception, scene.adjust_illuminant(il))
     self.assertRaises(Exception, scene.luminance)
     self.assertRaises(Exception, scene.mean_luminance)
     self.assertRaises(Exception, scene.shape)
     self.assertRaises(Exception, scene.width)
     self.assertRaises(Exception, scene.height)
     self.assertRaises(Exception, scene.sample_size)
     self.assertRaises(Exception, scene.bin_width)
     self.assertRaises(Exception, scene.energy)
     self.assertRaises(Exception, scene.xyz)
     self.assertRaises(Exception, scene.srgb)
示例#4
0
 def test_plot(self):
     il = Illuminant("D65.mat")
     self.assertRaises(Exception, il.plot("energy"))
     self.assertRaises(Exception, il.plot("photons"))