PYTHON: Reduce dimensions for 2D datasets in AmunH5.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
9a7235b72d
commit
0d4e955eb0
@ -137,4 +137,8 @@ class AmunH5(Amun):
|
||||
|
||||
cname = os.path.join(self.dirname, self.chunks[chunk_number]['filename'])
|
||||
with h5py.File(cname, 'r') as h5:
|
||||
return numpy.array(h5['variables'][dataset_name])
|
||||
dset = numpy.array(h5['variables'][dataset_name])
|
||||
if self.attributes['ndims'] == 3:
|
||||
return dset
|
||||
else:
|
||||
return dset[0,:,:,:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user