コード例 #1
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_offset(self):
     lut = linear_lut(10, 265, fill=True)
     expected_lut = np.zeros(266, dtype='uint8')
     expected_lut[:10] = 0
     expected_lut[10:] = np.linspace(0, 255, 256)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #2
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_offset(self):
     lut = linear_lut(10, 265, fill=True)
     expected_lut = np.zeros(266, dtype='uint8')
     expected_lut[:10] = 0
     expected_lut[10:] = np.linspace(0, 255, 256)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #3
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_fill_false1(self):
     lut = linear_lut(100, 199)
     self.assertEqual(len(lut), 200)
コード例 #4
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_dtype_uint16(self):
     lut = linear_lut(dtype='uint16')
     self.assertEqual(lut.dtype, np.uint16)
     self.assertTrue(np.all(lut == np.arange(2 ** 16, dtype='uint16')))
コード例 #5
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_all_defaults(self):
     lut = linear_lut()
     self.assertEqual(lut.dtype, np.uint8)
     self.assertTrue(np.all(lut == np.arange(2 ** 8, dtype='uint8')))
コード例 #6
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_vmin_omin(self):
     lut = linear_lut(10, 209, omin=10, omax=209)
     expected_lut = np.arange(210)
     expected_lut[:10] = 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #7
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_vmin_omin(self):
     lut = linear_lut(10, 209, omin=10, omax=209)
     expected_lut = np.arange(210)
     expected_lut[:10] = 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #8
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_fill1(self):
     lut = linear_lut(100, 199, fill=500)
     self.assertEqual(len(lut), 500)
コード例 #9
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_fill2(self):
     lut = linear_lut(100, 3000, fill=500)
     self.assertEqual(len(lut), 3001)
コード例 #10
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_fill1(self):
     lut = linear_lut(100, 199, fill=500)
     self.assertEqual(len(lut), 500)
コード例 #11
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_fill_true2(self):
     lut = linear_lut(100, 3000, fill=True)
     self.assertEqual(len(lut), 3001)
コード例 #12
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_fill_true1(self):
     lut = linear_lut(100, 199, fill=True)
     self.assertEqual(len(lut), 256)
コード例 #13
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_fill_false1(self):
     lut = linear_lut(100, 199)
     self.assertEqual(len(lut), 200)
コード例 #14
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_dtype_uint16(self):
     lut = linear_lut(dtype='uint16')
     self.assertEqual(lut.dtype, np.uint16)
     self.assertTrue(np.all(lut == np.arange(2**16, dtype='uint16')))
コード例 #15
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_all_defaults(self):
     lut = linear_lut()
     self.assertEqual(lut.dtype, np.uint8)
     self.assertTrue(np.all(lut == np.arange(2**8, dtype='uint8')))
コード例 #16
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_fill_true1(self):
     lut = linear_lut(100, 199, fill=True)
     self.assertEqual(len(lut), 256)
コード例 #17
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_fill_true2(self):
     lut = linear_lut(100, 3000, fill=True)
     self.assertEqual(len(lut), 3001)
コード例 #18
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_scale(self):
     lut = linear_lut(0, 511)
     expected_lut = np.arange(256)
     expected_lut = np.repeat(expected_lut, 2)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #19
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_fill2(self):
     lut = linear_lut(100, 3000, fill=500)
     self.assertEqual(len(lut), 3001)
コード例 #20
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_omin(self):
     lut = linear_lut(0, 399, omin=10, omax=209)
     expected_lut = np.arange(200)
     expected_lut = np.repeat(expected_lut, 2) + 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #21
0
ファイル: test_lut.py プロジェクト: avalentino/gsdview
 def test_scale(self):
     lut = linear_lut(0, 511)
     expected_lut = np.arange(256)
     expected_lut = np.repeat(expected_lut, 2)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
コード例 #22
0
ファイル: test_lut.py プロジェクト: giumas/gsdview
 def test_omin(self):
     lut = linear_lut(0, 399, omin=10, omax=209)
     expected_lut = np.arange(200)
     expected_lut = np.repeat(expected_lut, 2) + 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))