Skip to content

Commit cccb606

Browse files
committed
[ci skip] remove debugging lines from python script
1 parent 853a5ec commit cccb606

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

examples/ROOT_files/ROOT_STIR_consistency/DebugScripts/debug_view_offset_consistency.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,7 @@ def print_axis_biases():
201201
:return: None
202202
"""
203203

204-
class TotalBias:
205-
def __init__(self):
206-
self.total_bias = np.zeros(shape=(3,))
207-
208-
def add_bias(self, bias):
209-
self.total_bias += bias
210-
211-
total_bias = TotalBias()
204+
total_bias = np.zeros(shape=(3,))
212205

213206
# Construct the table header
214207
header_entries = ["SourceID", "x (offset)", "y (offset)", "z (offset)"]
@@ -230,7 +223,7 @@ def add_bias(self, bias):
230223
f"{round_sig(z, 3)} ({round_sig(err_z, 3)})"]
231224

232225
# Add the bias to the total bias
233-
total_bias.add_bias(np.array([err_x, err_y, err_z]))
226+
total_bias += np.array([err_x, err_y, err_z])
234227

235228
# Get the max entry length of both the heading entries or row entries
236229
string_length = 2 + max(max([len(entry) for entry in header_entries]),
@@ -259,9 +252,9 @@ def add_bias(self, bias):
259252
print(f"\nTOTAL BIAS IN EACH AXIS"
260253
f"\n{header_string}\n"
261254
f"{'-' * len(header_string)}")
262-
row = [round_sig(total_bias.total_bias[0] / num_entries, 3),
263-
round_sig(total_bias.total_bias[1] / num_entries, 3),
264-
round_sig(total_bias.total_bias[2] / num_entries, 3)]
255+
row = [round_sig(total_bias[0] / num_entries, 3),
256+
round_sig(total_bias[1] / num_entries, 3),
257+
round_sig(total_bias[2] / num_entries, 3)]
265258
row_string = table_row_as_string(row, string_length)
266259
print(f"{row_string}")
267260

@@ -285,8 +278,6 @@ def add_bias(self, bias):
285278
# Loop over all files in the working directory and load the data into the point_sources_data dictionary
286279
for i in range(1, 12, 1):
287280
point_sources_data[i] = ViewOffsetConsistencyClosestLORInfo(f"{filename_prefix}{i}{filename_suffix}")
288-
if i == 1:
289-
plot_1D_distance_histogram(point_sources_data[i].entrywise_l2_norm, pretitle=f"Point {i}:")
290281

291282
# Print the number of events, number of failed events and failure percentage for each point source
292283
print_pass_and_fail()

0 commit comments

Comments
 (0)