fix extract opti

This commit is contained in:
Valentin Valls 2019-03-14 17:09:27 +01:00
parent 6a6301ec68
commit 4392a4cbb4
1 changed files with 5 additions and 5 deletions

View File

@ -148,9 +148,8 @@ class RingExtractor(object):
"""
assert(numpy.logical_xor(peaks is not None, geometryModel is not None))
if ringNumbers is None:
ringNumbers = []
ringNumbers = set(ringNumbers)
if ringNumbers is not None:
ringNumbers = set(ringNumbers)
if peaks is not None:
# Energy from from experiment settings
@ -202,8 +201,9 @@ class RingExtractor(object):
ms = marchingsquares.MarchingSquaresMergeImpl(ttha, self.__mask, use_minmax_cache=True)
for i in range(tth.size):
if i not in ringNumbers:
continue
if ringNumbers is not None:
if i not in ringNumbers:
continue
if rings >= maxRings:
break
mask = numpy.logical_and(ttha >= tth_min[i], ttha < tth_max[i])