def test_11(self): """TestLogHeaderLAS.test_11(): Plot as top of log with CONS data.""" myLh = LogHeader.APIHeaderLAS(isTopOfLog=True) fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[56].fileName) tl = Coord.Pt(Coord.Dim(0.5, 'in'), Coord.Dim(0.25, 'in')) viewPort = myLh.viewPort(tl) with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS: myLh.plot(xS, tl, self._lasFile)
def test_05(self): """TestLogHeaderLAS.test_05(): Plot as not top of log.""" myLh = LogHeader.APIHeaderLAS(isTopOfLog=False) fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[50].fileName) tl = Coord.Pt(Coord.Dim(0.0, 'in'), Coord.Dim(0.0, 'in')) viewPort = myLh.viewPort(tl) with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS: myLh.plot(xS, tl)
def test_10(self): """TestLogHeader.test_10(): Plot as not top of log with CONS data.""" myLh = LogHeader.APIHeaderLIS(isTopOfLog=False) fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[45].fileName) tl = Coord.Pt(Coord.Dim(0.25, 'in'), Coord.Dim(0.5, 'in')) viewPort = myLh.viewPort(tl) with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS: myLh.plot(xS, tl, [self._lrCONS,])
def test_02(self): """TestLogHeader.test_02(): MNEM count and LogHeader.lrDataCount().""" self.assertEqual(53, len(self._lrCONS)) myLh = LogHeader.APIHeaderLIS(isTopOfLog=True) self.assertEqual(53, myLh.lrDataCount([self._lrCONS,])) # print() # print(myLh.missingFields([self._lrCONS,])) self.assertEqual((set(), set()), myLh.missingFields([self._lrCONS,]))
def test_04(self): """TestLogHeader.test_04(): APIHeaderLIS.viewPort().""" myLh = LogHeader.APIHeaderLIS(isTopOfLog=False) self.assertEqual( Coord.Box(width=Coord.Dim(value=6.25, units='in'), depth=Coord.Dim(value=8.0, units='in')), myLh.size(), ) tl = Coord.Pt(Coord.Dim(0.25, 'in'), Coord.Dim(0.5, 'in')) self.assertEqual( Coord.Box(width=Coord.Dim(value=6.5, units='in'), depth=Coord.Dim(value=8.5, units='in')), myLh.viewPort(tl), )
def test_23(self): """TestLogHeader.test_23(): Fails with Logical Record that is missing 'VALU' column.""" myB = [ bytes([34, 0]), bytes([73, 65, 4, 0]), bytes('TYPE', 'ascii'), bytes(' ', 'ascii'), bytes('CONS', 'ascii'), ] myB.append(bytes([0, 65, 4, 0])) myB.append(b'MNEM') myB.append(b' ') myB.append(b'HIDE') myB.append(bytes([69, 65, 4, 0])) myB.append(b'valu') myB.append(b' ') myB.append(b'Well') myF = self._retFilePrS(b''.join(myB)) myLrCONS = LogiRec.LrTableRead(myF) myLh = LogHeader.APIHeaderLIS(isTopOfLog=False) tl = Coord.Pt(Coord.Dim(0.0, 'in'), Coord.Dim(0.0, 'in')) self.assertRaises(LogHeader.ExceptionLogHeader, myLh.plot, None, tl, [myLrCONS,])