Skip to content

Commit

Permalink
Bugfix in voxel import
Browse files Browse the repository at this point in the history
  • Loading branch information
AHartmaier committed Feb 12, 2024
1 parent 3d7079e commit e97a8ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/kanapy/input_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def import_voxels(file, path='./'):
grain_phase_dict = dict()
gr_arr = grains.flatten(order='F')
if 'Grains' in data.keys():
if 'Orientation' in data['Grains'][grain_keys[0]].keys():
if 'Orientation' in data['Grains'][grain_keys[-1]].keys():
grain_ori_dict = dict()
else:
grain_ori_dict = None
Expand All @@ -437,8 +437,8 @@ def import_voxels(file, path='./'):
nv = len(ind)
ip = data['Grains'][str(igr)]['Phase']
phase_vf[ip] += nv
grain_dict[igr] = ind + 1
grain_phase_dict[igr] = ip
grain_dict[int(igr)] = ind + 1
grain_phase_dict[int(igr)] = ip
ngrain[ip] += 1
phases[ind] = ip
if grain_ori_dict is not None:
Expand All @@ -456,8 +456,8 @@ def import_voxels(file, path='./'):
nphases = 1
for igr in gr_numbers:
ind = np.nonzero(gr_arr == igr)[0]
grain_dict[igr] = ind + 1
grain_phase_dict[igr] = 0
grain_dict[int(igr)] = ind + 1
grain_phase_dict[int(igr)] = 0
ngrain = [len(grain_keys)]
phase_vf = [1.]

Expand Down

0 comments on commit e97a8ec

Please sign in to comment.