fixed include ordering in h5_readFlash. Expanded limits of kdtree. Better support for NETCDF4/HDF5.

This commit is contained in:
Guilhem Lavaux 2015-06-09 20:01:56 +02:00
parent 59b1b12be8
commit b668f9947d
7 changed files with 60 additions and 47 deletions

View file

@ -72,7 +72,7 @@ def writeWhitePhase(filename, field):
f.write(struct.pack("IIIIII", checkPoint, Nx, Ny, Nz, 0, checkPoint))
field = field.reshape(field.shape, order='F')
checkPoint = struct.pack("I", 4*Nx*Ny)
checkPoint = struct.pack("I", 4*Ny*Nz)
for i in range(Nx):
f.write(checkPoint)
f.write(field[i].astype(np.float32).tostring())
@ -91,7 +91,10 @@ def readWhitePhase(filename):
if struct.unpack("I", f.read(4))[0] != checkPoint_ref:
raise ValueError("Invalid unformatted access")
a[i, :, :] = np.fromfile(f, dtype=np.float32, count=Ny*Nz).reshape((Ny, Nz), order='F')
b = np.fromfile(f, dtype=np.float32, count=Ny*Nz).reshape((Ny, Nz))
if i==0:
print(b)
a[i, : ,:] = b
if struct.unpack("I", f.read(4))[0] != checkPoint_ref:
raise ValueError("Invalid unformatted access")