Skip to content
Snippets Groups Projects
Commit 12e7bdb8 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

remove unneeded code

parent b4a44ebd
No related branches found
No related tags found
1 merge request!228Feat/batch prioritization darks
...@@ -1291,16 +1291,24 @@ class AgipdCorrections: ...@@ -1291,16 +1291,24 @@ class AgipdCorrections:
return_index=True, return_index=True,
return_counts=True) return_counts=True)
# Validate calculated CORR INDEX contents. # Validate calculated CORR INDEX contents by checking difference between
# trainId stored in RAW data and trains from
train_diff = np.isin(np.array(self.infile["/INDEX/trainId"]), uq, invert=True) train_diff = np.isin(np.array(self.infile["/INDEX/trainId"]), uq, invert=True)
# Insert zeros for missing trains. # Insert zeros for missing trains.
# fidxv and cntsv should have same length as
# raw INDEX/.../image/first and INDEX/.../image/count,
# respectively
for i, diff in enumerate(train_diff): for i, diff in enumerate(train_diff):
if diff: if diff:
if i < len(cntsv): if i < len(cntsv):
cntsv = np.insert(cntsv, i, 0) cntsv = np.insert(cntsv, i, 0)
fidxv = np.insert(fidxv, i, 0) if i == 0:
fidxv = np.insert(fidxv, i, 0)
else:
fidxv = np.insert(fidxv, i, fidxv[i-1])
else: else:
# append if at the end of the array
cntsv = np.append(cntsv, 0) cntsv = np.append(cntsv, 0)
fidxv = np.append(fidxv, 0) fidxv = np.append(fidxv, 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment