本文整理汇总了Python中org.python.util.PythonObjectInputStream.readObject方法的典型用法代码示例。如果您正苦于以下问题:Python PythonObjectInputStream.readObject方法的具体用法?Python PythonObjectInputStream.readObject怎么用?Python PythonObjectInputStream.readObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.python.util.PythonObjectInputStream
的用法示例。
在下文中一共展示了PythonObjectInputStream.readObject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadPainting3Data
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def loadPainting3Data(imageFile):
fileName = "/Users/cengelsm/Test/pgsinterp3.p3"
fis = FileInputStream(fileName)
ois = PythonObjectInputStream(fis)
p3 = ois.readObject()
fis.close()
image = readImage(imageFile)
n1, n2, n3 = s1.count, s2.count, s3.count
d1, d2, d3 = s1.delta, s2.delta, s3.delta
f1, f2, f3 = s1.first, s2.first, s3.first
l1, l2, l3 = s1.last, s2.last, s3.last
ipg = ImagePanelGroup2(s1, s2, s3, image, p3.getPaint())
ipg.setColorModel1(ColorMap.getGray())
ipg.setColorModel2(ColorMap.getJet(0.5))
ipg.setSlices(700, 50, 80)
sf = SimpleFrame()
world = sf.getWorld()
world.addChild(ipg)
sf.setSize(1250, 900)
view = sf.getOrbitView()
zscale = 0.75 * max(n2 * d2, n3 * d3) / (n1 * d1)
view.setAxesScale(1.0, 1.0, zscale)
view.setScale(1.3)
view.setAzimuth(-65.0)
view.setWorldSphere(BoundingSphere(BoundingBox(f3, f2, f1, l3, l2, l1)))
示例2: readTensors
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readTensors():
tensorsFile = "st"+str(int(sigmaTensor))
fis = FileInputStream(dataDir+dataPref+tensorsFile+".dat")
ois = PythonObjectInputStream(fis)
tensors = ois.readObject()
fis.close()
return tensors
示例3: readTensors
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readTensors(name):
"""
Reads tensors from file with specified basename; e.g., "tpet".
"""
fis = FileInputStream(PATH+name)
ois = PythonObjectInputStream(fis)
tensors = ois.readObject()
fis.close()
return tensors
示例4: readTensors
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readTensors(name):
"""
Reads tensors from file with specified basename; e.g., "f3et".
"""
fis = FileInputStream(f3dDataSetDir+name+".dat")
ois = PythonObjectInputStream(fis)
tensors = ois.readObject()
fis.close()
return tensors
示例5: loadPaintingSlice
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def loadPaintingSlice(imageFile):
fileName = "/Users/cengelsm/Test/paintings/pgs_02.p3"
fis = FileInputStream(fileName)
ois = PythonObjectInputStream(fis)
p3 = ois.readObject()
fis.close()
image = readImage(imageFile)
print s1.count, s2.count
sl = 30
xz = image[sl]
pxz = p3.getPaint()[sl]
panel = PlotPanel(PlotPanel.Orientation.X1DOWN_X2RIGHT)
pv1 = panel.addPixels(s1, s2, xz)
pv1.setPercentiles(1, 99)
pv2 = panel.addPixels(s1, s2, pxz)
pv2.setColorModel(ColorMap.getJet(0.5))
panel.setVLabel("Depth (km)")
panel.setHLabel("Distance (km)")
frame = PlotFrame(panel)
frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE)
frame.setSize(1800, 1000)
frame.setVisible(True)
frame.setFontSizeForSlide(1, 1)
frame.paintToPng(300, 6, "/Users/cengelsm/Desktop/test2.png")
示例6: readObject
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readObject(name):
fis = FileInputStream(seismicDir+name+".dat")
ois = PythonObjectInputStream(fis)
obj = ois.readObject()
ois.close()
return obj
示例7: readTensors
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readTensors(tensorsFile):
fis = FileInputStream(tensorsFile)
ois = PythonObjectInputStream(fis)
tensors = ois.readObject()
fis.close()
return tensors
示例8: readTensors
# 需要导入模块: from org.python.util import PythonObjectInputStream [as 别名]
# 或者: from org.python.util.PythonObjectInputStream import readObject [as 别名]
def readTensors(name):
fis = FileInputStream(seismicDir+name+".dat")
ois = PythonObjectInputStream(fis)
tensors = ois.readObject()
fis.close()
return tensors