Skip to content

Commit 52599e2

Browse files
committed
small bugs and nb
1 parent e2c6cae commit 52599e2

3 files changed

Lines changed: 1343 additions & 7 deletions

File tree

dl1_data_handler/image_mapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def __init__(
704704
self.num_patches = len(self.trigger_patches)
705705
self.patch_size = len(self.index_map[0])
706706

707-
elif geometry.name == "LSTCam":
707+
else:
708708
neighbor_matrix = geometry.neighbor_matrix
709709
num_pixels = neighbor_matrix.shape[0]
710710
neighbor_lists = []
@@ -716,6 +716,7 @@ def __init__(
716716
self.cam_neighbor_array = np.full((num_pixels, 7), -1, dtype=int)
717717
for i, neighbors in enumerate(neighbor_lists):
718718
self.cam_neighbor_array[i, :len(neighbors)] = neighbors
719+
print("Computed neighbor array is", self.cam_neighbor_array)
719720

720721
def get_reordered_patch(self, raw_vector, patch_index):
721722
# Retrieve the patch needed

dl1_data_handler/reader.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,14 +1222,15 @@ def __init__(
12221222

12231223
# Set the input shape based on the selected mode
12241224
if self.mode == "mono":
1225-
if self.image_mappers[self.cam_name].cam_neighbor_array is not None and self.image_mappers[self.cam_name].index_matrix is None:
1225+
if self.image_mappers[self.cam_name].cam_neighbor_array is None:
12261226
self.input_shape = (
12271227
self.image_mappers[self.cam_name].image_shape,
12281228
self.image_mappers[self.cam_name].image_shape,
12291229
len(self.channels),
12301230
)
12311231
else:
12321232
self.input_shape = (self.image_mappers[self.cam_name].geometry.n_pixels, len(self.channels))
1233+
12331234
elif self.mode == "stereo":
12341235
self.input_shape = {}
12351236
for tel_type in self.selected_telescopes:
@@ -1512,11 +1513,14 @@ def __init__(
15121513

15131514
# Set the input shape based on the selected mode
15141515
if self.mode == "mono":
1515-
self.input_shape = (
1516-
self.image_mappers[self.cam_name].image_shape,
1517-
self.image_mappers[self.cam_name].image_shape,
1518-
self.sequence_length,
1519-
)
1516+
if self.image_mappers[self.cam_name].cam_neighbor_array is None:
1517+
self.input_shape = (
1518+
self.image_mappers[self.cam_name].image_shape,
1519+
self.image_mappers[self.cam_name].image_shape,
1520+
self.sequence_length,
1521+
)
1522+
else:
1523+
self.input_shape = (self.image_mappers[self.cam_name].geometry.n_pixels, self.sequence_length)
15201524
elif self.mode == "stereo":
15211525
self.input_shape = {}
15221526
for tel_type in self.selected_telescopes:

0 commit comments

Comments
 (0)