handling of derived datatypes/structs
currently required for orientation
This commit is contained in:
parent
f30cbde99e
commit
c9b1944493
|
@ -65,7 +65,7 @@ for filename in options.filenames:
|
||||||
x = results.get_dataset_location(label)
|
x = results.get_dataset_location(label)
|
||||||
if len(x) == 0:
|
if len(x) == 0:
|
||||||
continue
|
continue
|
||||||
array = results.read_dataset(x,0)
|
array = results.read_dataset(x,0,plain=True)
|
||||||
d = int(np.product(np.shape(array)[1:]))
|
d = int(np.product(np.shape(array)[1:]))
|
||||||
data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1)
|
data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1)
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ for filename in options.filenames:
|
||||||
x = results.get_dataset_location(label)
|
x = results.get_dataset_location(label)
|
||||||
if len(x) == 0:
|
if len(x) == 0:
|
||||||
continue
|
continue
|
||||||
array = results.read_dataset(x,0)
|
array = results.read_dataset(x,0,plain=True)
|
||||||
d = int(np.product(np.shape(array)[1:]))
|
d = int(np.product(np.shape(array)[1:]))
|
||||||
data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1)
|
data = np.concatenate((data,np.reshape(array,[np.product(results.grid),d])),1)
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@ class DADF5():
|
||||||
return f[self.get_dataset_location('orientation')[0]].attrs['Lattice'].astype('str') # np.bytes_ to string
|
return f[self.get_dataset_location('orientation')[0]].attrs['Lattice'].astype('str') # np.bytes_ to string
|
||||||
|
|
||||||
|
|
||||||
def read_dataset(self,path,c=0):
|
def read_dataset(self,path,c=0,plain=False):
|
||||||
"""
|
"""
|
||||||
Dataset for all points/cells.
|
Dataset for all points/cells.
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ class DADF5():
|
||||||
a=a.reshape([a.shape[0],1])
|
a=a.reshape([a.shape[0],1])
|
||||||
dataset[p,:] = a[u,:]
|
dataset[p,:] = a[u,:]
|
||||||
|
|
||||||
return dataset
|
return dataset if not plain else dataset.view(('float64',len(dataset.dtype.names)))
|
||||||
|
|
||||||
|
|
||||||
def cell_coordinates(self):
|
def cell_coordinates(self):
|
||||||
|
|
Loading…
Reference in New Issue