Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generateSuperZindex(self, zidx, resolution):
"""Generate super zindex from a given zindex"""
[[ximagesz, yimagesz, zimagesz], timerange] = self.db.proj.datasetcfg.imageSize(resolution)
[xcubedim, ycubedim, zcubedim] = cubedim = self.db.proj.datasetcfg.getCubeDims()[resolution]
[xoffset, yoffset, zoffset] = self.db.proj.datasetcfg.getOffset()[resolution]
[xsupercubedim, ysupercubedim, zsupercubedim] = super_cubedim = self.db.proj.datasetcfg.getSuperCubeDims()[resolution]
# super_cubedim = map(mul, cubedim, SUPERCUBESIZE)
[x, y, z] = ndlib.MortonXYZ(zidx)
corner = map(mul, ndlib.MortonXYZ(zidx), cubedim)
[x,y,z] = map(div, corner, super_cubedim)
# print zidx, corner, [x,y,z], ndlib.XYZMorton([x,y,z])
return ndlib.XYZMorton([x,y,z])
def generateURL2(zidx):
[x,y,z] = MortonXYZ(zidx)
p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE)
return 'http://{}/{}/{}/blosc/{}/{},{}/{},{}/{},{}/'.format(SITE_HOST, p.token, ','.join(p.channels), p.resolution, *p.args)
def generateURL(zidx):
"""Run the Benchmark."""
i = zidx
[x,y,z] = MortonXYZ(i)
p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE)
image_data = np.ones([1,ZSIZE,SIZE,SIZE], dtype=np.uint32) * random.randint(0,255)
return postBlosc(p, image_data)
def generateSuperZindex(self, zidx, resolution):
"""Generate super zindex from a given zindex"""
[[ximagesz, yimagesz, zimagesz], timerange] = self.db.proj.datasetcfg.imageSize(resolution)
[xcubedim, ycubedim, zcubedim] = cubedim = self.db.proj.datasetcfg.getCubeDims()[resolution]
[xoffset, yoffset, zoffset] = self.db.proj.datasetcfg.getOffset()[resolution]
[xsupercubedim, ysupercubedim, zsupercubedim] = super_cubedim = self.db.proj.datasetcfg.getSuperCubeDims()[resolution]
# super_cubedim = map(mul, cubedim, SUPERCUBESIZE)
[x, y, z] = ndlib.MortonXYZ(zidx)
corner = map(mul, ndlib.MortonXYZ(zidx), cubedim)
[x,y,z] = map(div, corner, super_cubedim)
# print zidx, corner, [x,y,z], ndlib.XYZMorton([x,y,z])
return ndlib.XYZMorton([x,y,z])