Skip to content

Commit

Permalink
removed v5.0.0 support for real data and images
Browse files Browse the repository at this point in the history
  • Loading branch information
TjarkMiener committed Aug 8, 2024
1 parent 8964328 commit f174575
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions dl1_data_handler/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,12 @@ def __init__(
self.process_type = self._v_attrs["CTA PROCESS TYPE"]
self.data_format_version = self._v_attrs["CTA PRODUCT DATA MODEL VERSION"]

# Temp fix until ctapipe can process LST-1 data writing into data format v6.0.0.
# For dl1 images we can process real data with version v5.0.0 without any problems.
# TODO: Remove v5.0.0 once v6.0.0 is available
if self.process_type == "Observation" and image_settings is not None:
if int(self.data_format_version.split(".")[0].replace("v", "")) < 5:
raise IOError(
f"Provided ctapipe data format version is '{self.data_format_version}' (must be >= v.5.0.0 for LST-1 data)."
)
else:
if int(self.data_format_version.split(".")[0].replace("v", "")) < 6:
raise IOError(
f"Provided ctapipe data format version is '{self.data_format_version}' (must be >= v.6.0.0)."
)
# Add check for real data processing that only a single file is provided.
# Check for the minimum ctapipe data format version (v6.0.0)
if int(self.data_format_version.split(".")[0].replace("v", "")) < 6:
raise IOError(
f"Provided ctapipe data format version is '{self.data_format_version}' (must be >= v.6.0.0)."
)
# Check for real data processing that only a single file is provided.
if self.process_type == "Observation" and len(self.files) != 1:
raise ValueError(
f"When processing real observational data, please provide a single file (currently: '{len(self.files)}')."
Expand Down

0 comments on commit f174575

Please sign in to comment.