You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When allowed_tels is set for HDF5EventSource, events with no telescopes remaining in the selection are skipped, thus changing the total number of array events.
Currently, __len__ simply looks at the number of array events in the input table, thus resulting in a too large number if allowed_tels is given.
To Reproduce
Steps to reproduce the behavior:
Run ctapipe-process -i dataset://gamma_prod5.simtel.zst -o /tmp/test.dl1.h5
❯ ctapipe-process -i dataset://gamma_prod5.simtel.zst -o /tmp/test.dl1.h5 --progress
2023-05-09 17:33:13,462 WARNING [ctapipe.core.telescope_component] (telescope_component.attach_subarray): TelescopeParameter type argument 'SST_1M_*' did not match any known telescope types
SimTelEventSource: 7ev [00:06, 1.07ev/s]
❯ ctapipe-process -i /tmp/test.dl1.h5 -o /tmp/test2.dl1.h5 --EventSource.allowed_tels=1 --EventSource.allowed_tels=2 --EventSource.allowed_tels=3 --EventSource.allowed_tels=4 --progress
2023-05-09 17:34:38,508 WARNING [ctapipe.core.telescope_component] (telescope_component.attach_subarray): TelescopeParameter type argument 'MST_*' did not match any known telescope types
2023-05-09 17:34:38,508 WARNING [ctapipe.core.telescope_component] (telescope_component.attach_subarray): TelescopeParameter type argument 'SST_1M_*' did not match any known telescope types
HDF5EventSource: 14%|███████▋ | 1/7 [00:01<00:09, 1.56s/ev]
Observe that the progress bar thinks there will be 7 events but only 1 is actually encountered.
Expected behavior __len__ provides the correct length
The text was updated successfully, but these errors were encountered:
I like having a __len__ attribute, even if it is not totally reliable, as it still gives useful information. So I'd prefer either keeping it the way it is (in which case the progress bar is an upper limit, I guess, but still somewhat useful), or implement suggestion 2 or 3.
Describe the bug
When
allowed_tels
is set forHDF5EventSource
, events with no telescopes remaining in the selection are skipped, thus changing the total number of array events.Currently,
__len__
simply looks at the number of array events in the input table, thus resulting in a too large number ifallowed_tels
is given.To Reproduce
Steps to reproduce the behavior:
Run
ctapipe-process -i dataset://gamma_prod5.simtel.zst -o /tmp/test.dl1.h5
Observe that the progress bar thinks there will be 7 events but only 1 is actually encountered.
Expected behavior
__len__
provides the correct lengthThe text was updated successfully, but these errors were encountered: