#NEWLINE# def addCutout( p , f ) : #NEWLINE# #INDENT# 'Add a cube of data to the HDF5 file' #NEWLINE# h5f = h5py . File ( f . name ) #NEWLINE# ( xlow , xhigh , ylow , yhigh , zlow , zhigh ) = p . args #NEWLINE# anndata = np . ones ( [ ( zhigh - zlow ) , ( yhigh - ylow ) , ( xhigh - xlow ) ] , dtype = np . uint32 ) #NEWLINE# idgrp = self . h5fh [ str ( annid ) ] #NEWLINE# idgrp . create_dataset ( 'RESOLUTION' , ( 1 , ) , np . uint32 , data = resolution ) #NEWLINE# idgrp . create_dataset ( 'XYZOFFSET' , ( 3 , ) , dtype = np . uint32 , data = [ xlow , ylow , zlow ] ) #NEWLINE# idgrp . create_dataset ( 'CUTOUT' , h5f . shape , dtype = anndata . dtype , data = anndata ) #NEWLINE# h5f . flush ( )