From c413eadc9049d2ad3d047d2ed1f9b51b6593eeaa Mon Sep 17 00:00:00 2001 From: Michael Stumpf Date: Thu, 9 Apr 2020 12:27:03 +0200 Subject: [PATCH] bugfix: always construct a scalar grid --- python/ucf/ucf.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/ucf/ucf.py b/python/ucf/ucf.py index 790a945..70eeeac 100644 --- a/python/ucf/ucf.py +++ b/python/ucf/ucf.py @@ -490,9 +490,10 @@ def readGrid(file,verbosity=False,debug=False): output.append(data[0:nx]) output.append(data[nx:nx+ny]) output.append(data[nx+ny:nx+ny+nz]) - obj.close() - if obj.UCFVersion<2: + #if obj.UCFVersion<2: + if obj.NumDataset<5: output.extend(output[-3:]) + obj.close() return output def readProcgrid(file,verbosity=False,debug=False): @@ -509,9 +510,10 @@ def readProcgrid(file,verbosity=False,debug=False): output.append(data[2*nxp+nyp:2*nxp+2*nyp]) # jend output.append(data[2*nxp+2*nyp:2*nxp+2*nyp+nzp]) # kbeg output.append(data[2*nxp+2*nyp+nzp:2*nxp+2*nyp*2*nzp]) # kend - obj.close() - if obj.UCFVersion<2: + #if obj.UCFVersion<2: + if obj.NumDataset<5: output.extend(output[-6:]) + obj.close() return output def readFieldChunk(file,step=1,dset=-1,verbosity=False,debug=False):