volume.py (pymol-open-source-2.2.0) | : | volume.py (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 675 | skipping to change at line 675 | |||
def setHistogram(self, histogram): | def setHistogram(self, histogram): | |||
""" | """ | |||
Sets histogram of the volume. | Sets histogram of the volume. | |||
@param histogram: Volume histogram: min value, max value, avg value, | @param histogram: Volume histogram: min value, max value, avg value, | |||
std deviation, value0, value1, value2... | std deviation, value0, value1, value2... | |||
@type histogram: list of floats | @type histogram: list of floats | |||
""" | """ | |||
self.vmin = histogram[0] | self.vmin = histogram[0] | |||
self.vmax = histogram[1] | self.vmax = histogram[1] | |||
# check for flat data (useless, but avoid errors in GUI) | ||||
if self.vmin == self.vmax: | ||||
self.vmin -= 1.0 | ||||
self.vmax += 1.0 | ||||
self.original_vmin = self.vmin | self.original_vmin = self.vmin | |||
self.original_vmax = self.vmax | self.original_vmax = self.vmax | |||
self.path = [] | self.path = [] | |||
if len(histogram[4:]) == 0: | if len(histogram[4:]) == 0: | |||
return | return | |||
xstep = 1.0 / len(histogram[4:]) | xstep = 1.0 / len(histogram[4:]) | |||
max_value = max(histogram[4:]) | max_value = max(histogram[4:]) | |||
if max_value == 0.0: | if max_value == 0.0: | |||
return | return | |||
ynorm = 1.0 / max_value | ynorm = 1.0 / max_value | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added |