Skip to content

Commit

Permalink
Fixed array indexing issue.
Browse files Browse the repository at this point in the history
Signed-off by: David Rowenhorst <[email protected]>
  • Loading branch information
drowenhorst-nrl committed Nov 4, 2024
1 parent 98b80e8 commit 2e28d3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyebsdindex/tripletvote.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ def bandindex(self, band_norms, band_intensity = None, band_widths=None, verbose
self._assign_bands_nb(libPolesCart, libAngTable, libFamIndx, nFam, angTol, n_band_early, bandnorms, bandRank_arg, bandFam)

# check how often the indexed band matched the top voting band family.
acc_correct = np.sum(np.array((polevalid > 0) & (self.completelib['familyid'][polematch] == bandFam), dtype=int),axis=1).astype(np.int32)
acc_correct = np.sum(np.array((polevalid > 0) & #take valid poles
(self.completelib['familyid'][polematch.clip(0)] == bandFam), # AND with matching correctly
dtype=int),axis=1).astype(np.int32) # and sum.


# accumulator = accumulator[0, ...]
Expand Down Expand Up @@ -870,11 +872,11 @@ def _calc_quest_weights( libComFamID, accumulator, accumulator_nw,
for s in srt6:
weights[p, s] = band_intensity[p, s]


#weights[p, :] *= 2.0/weights[p,:].max()
#weights[p, :] = 0.5*(1+np.tanh(8.0 * (weights[p, :] - 1.0)))

weights[p, :] *= 1.0 / weights[p, :].max()
weights[p, :] = np.exp(2*weights[p, :])-1.0
weights[p, :] = np.exp(2 * weights[p, :])-1.0

weights[p, :] /= weights[p, :].max()
#print(weights[p,:]/weights[p,:].max())
Expand Down

0 comments on commit 2e28d3f

Please sign in to comment.