PYTHON: Create empty chunk fields for chunks with no dblocks.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
5eec85e598
commit
07fc5c20b0
@ -158,14 +158,19 @@ class AmunXML(Amun):
|
||||
bounds = numpy.reshape(bounds, [2, 3, self.attributes['nleafs']])
|
||||
|
||||
for n in range(self.attributes['nchunks']):
|
||||
ids = self.__read_binary_data('ids', n, dtype='int32')
|
||||
if self.chunks[n]['dblocks'] > 0:
|
||||
ids = self.__read_binary_data('ids', n, dtype='int32')
|
||||
|
||||
self.chunks[n]['levels'] = numpy.array([level[ids[p]] for p in range(self.chunks[n]['dblocks'])])
|
||||
self.chunks[n]['coords'] = numpy.array([coord[ids[p]] for p in range(self.chunks[n]['dblocks'])]).T
|
||||
self.chunks[n]['levels'] = numpy.array([level[ids[p]] for p in range(self.chunks[n]['dblocks'])])
|
||||
self.chunks[n]['coords'] = numpy.array([coord[ids[p]] for p in range(self.chunks[n]['dblocks'])]).T
|
||||
|
||||
ii = [ index[ids[p]] for p in range(self.chunks[n]['dblocks']) ]
|
||||
ii = [ index[ids[p]] for p in range(self.chunks[n]['dblocks']) ]
|
||||
|
||||
self.chunks[n]['bounds'] = numpy.array([bounds[:,:,ii[p]].T for p in range(self.chunks[n]['dblocks'])]).T
|
||||
self.chunks[n]['bounds'] = numpy.array([bounds[:,:,ii[p]].T for p in range(self.chunks[n]['dblocks'])]).T
|
||||
else:
|
||||
self.chunks[n]['levels'] = numpy.empty((1), dtype = numpy.int32)
|
||||
self.chunks[n]['coords'] = numpy.empty((3,1), dtype = numpy.int32)
|
||||
self.chunks[n]['bounds'] = numpy.empty((2,3,1), dtype = numpy.float64)
|
||||
|
||||
|
||||
def __read_binary_data__(self, dataset_name, chunk_number):
|
||||
|
Loading…
x
Reference in New Issue
Block a user