def writeTimeCuboid(self, ch, corner, resolution, timerange, cuboiddata):
    """Write an image through the Web service"""

    # dim is in xyz, data is in zyx order
    dim = cuboiddata.shape[::-1][:-1]

    # get the size of the image and cube
    [xcubedim, ycubedim, zcubedim] = cubedim = self.datasetcfg.cubedim [ resolution ] 

    # Round to the nearest larger cube in all dimensions
    zstart = corner[2]/zcubedim
    ystart = corner[1]/ycubedim
    xstart = corner[0]/xcubedim

    znumcubes = (corner[2]+dim[2]+zcubedim-1)/zcubedim - zstart
    ynumcubes = (corner[1]+dim[1]+ycubedim-1)/ycubedim - ystart
    xnumcubes = (corner[0]+dim[0]+xcubedim-1)/xcubedim - xstart

    zoffset = corner[2]%zcubedim
    yoffset = corner[1]%ycubedim
    xoffset = corner[0]%xcubedim

    databuffer = np.zeros([timerange[1]-timerange[0]]+[znumcubes*zcubedim, ynumcubes*ycubedim, xnumcubes*xcubedim], dtype=cuboiddata.dtype )
    databuffer[:, zoffset:zoffset+dim[2], yoffset:yoffset+dim[1], xoffset:xoffset*dim[0]] = cuboiddata 

    self.kvio.startTxn()
 
    try:
      for z in range(znumcubes):
        for y in range(ynumcubes):
          for x in range(xnumcubes):
            for timestamp in range(timerange[0], timerange[1], 1):

              zidx = ocplib.XYZMorton([x+xstart,y+ystart,z+zstart])
              cube = self.getTimeCube(ch, zidx, timestamp, resolution, update=True)
              # overwrite the cube
              cube.overwrite(databuffer[timestamp-timerange[0], z*zcubedim:(z+1)*zcubedim, y*ycubedim:(y+1)*ycubedim, x*xcubedim:(x+1)*xcubedim])
              # update in the database
              self.putTimeCube(ch, zidx, timestamp, resolution, cube)

    except:
      self.kvio.rollback()
      raise

    self.kvio.commit()
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.writeTimeCuboid/operator `+` -> `*`