Skip to content

Commit

Permalink
Remove hardcoded TableLoader parameters, enforce only images loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mexanick committed Jan 28, 2025
1 parent 9f8268f commit 1c88ebc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/ctapipe/tools/calculate_pixel_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def setup(self):
raise ToolConfigurationError(
"Input and output files are same. Fix your configuration / cli arguments."
)
if "dl1_images" in self.input_data.config.TableLoader:
if not self.input_data.dl1_images:
raise ToolConfigurationError(
"The TableLoader must read dl1 images. Set 'dl1_images' to True."
)
self.input_data.dl1_images = True
# Load the subarray description from the input file
subarray = SubarrayDescription.from_hdf(self.input_data.input_url)
# Get the telescope ids from the input data or use the allowed_tels configuration
Expand All @@ -111,15 +117,6 @@ def start(self):
telescopes=[
tel_id,
],
dl1_images=True,
dl1_parameters=False,
dl1_muons=False,
dl2=False,
simulated=False,
true_images=False,
true_parameters=False,
instrument=False,
pointing=False,
)[tel_id]
# Check if the chunk size does not exceed the table length of the input data
if self.stats_calculator.stats_aggregators[
Expand Down

0 comments on commit 1c88ebc

Please sign in to comment.