diff --git a/pyebsdindex/tripletvote.py b/pyebsdindex/tripletvote.py index 14e25f3..2c5871a 100644 --- a/pyebsdindex/tripletvote.py +++ b/pyebsdindex/tripletvote.py @@ -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, ...] @@ -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())