Commit d28ee65f authored by Forquet Nicolas's avatar Forquet Nicolas

fixing issue #10

parent fcffdef9
...@@ -53,12 +53,19 @@ def switch_mux(quadripole): ...@@ -53,12 +53,19 @@ def switch_mux(quadripole):
# function to find rows with identical values in different columns # function to find rows with identical values in different columns
def find_identical_in_line(array_object): def find_identical_in_line(array_object):
output = [] output = []
for i in range(len(array_object[:,1])): if array_object.ndim == 1:
temp = numpy.zeros(len(array_object[1,:])) temp = numpy.zeros(4)
for j in range(len(array_object[1,:])): for i in range(len(array_object)):
temp[j] = numpy.count_nonzero(array_object[i,:] == array_object[i,j]) temp[i] = numpy.count_nonzero(array_object == array_object[i])
if any(temp > 1): if any(temp > 1):
output.append(i) output.append(0)
else:
for i in range(len(array_object[:,1])):
temp = numpy.zeros(len(array_object[1,:]))
for j in range(len(array_object[1,:])):
temp[j] = numpy.count_nonzero(array_object[i,:] == array_object[i,j])
if any(temp > 1):
output.append(i)
return output return output
# read quadripole file and apply tests # read quadripole file and apply tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment