def toNPZ ( self ):
    try:
      # Create the compressed cube
      fileobj = cStringIO.StringIO ()
      np.save ( fileobj, self.data )
      return  zlib.compress (fileobj.getvalue())
    except:
      logger.error ("Failed to compress database cube.  Data integrity concern.")
      raise
Pickle and zip the object
dataset/ETHPy150Open neurodata/ndstore/ocpca/cube.py/Cube.toNPZ