本文整理汇总了Python中cube.Cube.getCubeData方法的典型用法代码示例。如果您正苦于以下问题:Python Cube.getCubeData方法的具体用法?Python Cube.getCubeData怎么用?Python Cube.getCubeData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cube.Cube
的用法示例。
在下文中一共展示了Cube.getCubeData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getrawdata
# 需要导入模块: from cube import Cube [as 别名]
# 或者: from cube.Cube import getCubeData [as 别名]
def getrawdata(self, ci, timestep, datafield):
cubesize = [ci.zlen, ci.ylen, ci.xlen]
filterwidth = ci.filter
corner = [ci.xstart, ci.ystart, ci.zstart]
step = [ci.xstep, ci.ystep, ci.zstep]
cube = Cube(corner, cubesize,step, filterwidth, 3 )
cube.getCubeData(ci, datafield, timestep)
return cube.data
示例2: getfilecube
# 需要导入模块: from cube import Cube [as 别名]
# 或者: from cube.Cube import getCubeData [as 别名]
def getfilecube(self, args):
corners =args[0]
ci =args[1]
cubesize =args[2]
timestep =args[3]
step = args[4]
filterwidth = args[5]
components = args[6]
datafield = args[7]
print ("Setting cube: ", corners[0], corners[1], corners[2])
cube = Cube(corners, cubesize, step, filterwidth, components)
#mortonstart = jhtdblib.JHTDBLib().createmortonindex(corners[0], corners[1], corners[2])
#mortonend = jhtdblib.JHTDBLib().createmortonindex(corners[0] + cubesize[0], corners[1] + cubesize[1], corners[2] + cubesize[2])
#start = time.time()
print ("getting cube: ", corners[0], corners[1], corners[2])
#It appears this sometimes fails when parallel processing, so we try up to 3 times...
retries =3
attempt = 0
#while (attempt < retries ):
# if (cube.getCubeData(ci, datafield, timestep) != True):
# attempt = attempt + 1
# print("Retrying cube.")
# else:
# attempt = 3
# print("Completed cube")
if (cube.getCubeData(ci, datafield, timestep) != True):
print("Success cube")
print("Saving cube", corners[0], corners[1], corners[2])
#tmp = NamedTemporaryFile(suffix='.RAW', mode='w+b', dir='/tmp', delete=False)
#Save object
#pickle.dump(cube, tmp, pickle.HIGHEST_PROTOCOL)
#cPickle.dump(cube, tmp, cPickle.HIGHEST_PROTOCOL)
return cube