def find_loose_thresholds(self, percentile=0.99):
        results = []
        for c in range(len(self.sensor.band_names)):
            (threshold, params) = (self.thresholds[c], self.distributions[c])
            if params != None:
                t = self.__cdf_percentile(params, percentile, self.backscatter_model[c])
                if self.sensor.log_scale:
                    t = 10 ** t
                results.append(t)
            else:
                # if finding dip or peak, find next local min / max as threshold
                if self.sensor.log_scale:
                    threshold = math.log10(threshold)
                start = self.histograms[c][0]
                width = self.histograms[c][1]
                values = self.histograms[c][2]
                i = int((threshold - start) / width) + 1
                if self.backscatter_model[c] == RadarHistogram.BACKSCATTER_MODEL_DIP:
                    while i < len(values) - 3:
                        if values[i] > values[i+1] and values[i] > values[i+2] and values[i] > values[i+3]:
                            break
                        i += 1
                else:
                    # find the local minimum after the mode
                    while i < len(values) - 3:
                        if values[i] < values[i+1] and values[i] < values[i+2] and values[i] < values[i+3]:
                            break
                        i += 1
                t = start + i * width
                if self.sensor.log_scale:
                    t = 10 ** t
                results.append(t)
        return results
dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/radar/histogram.py/RadarHistogram.find_loose_thresholds/original