Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dla1b to take v0.9 dl1 files as input #1329

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lstchain/scripts/lstchain_dl1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
apply_time_delta_cleaning,
)
from ctapipe.instrument import SubarrayDescription
from ctapipe_io_lst import constants
from ctapipe_io_lst import constants, OPTICS, load_camera_geometry


from lstchain.calib.camera.pixel_threshold_estimation import get_threshold_from_dl1_file
from lstchain.image.cleaning import apply_dynamic_cleaning
Expand Down Expand Up @@ -223,10 +224,16 @@
if "delta_time" in config[clean_method_name]:
delta_time = config[clean_method_name]["delta_time"]

subarray_info = SubarrayDescription.from_hdf(args.input_file)
tel_id = config["allowed_tels"][0] if "allowed_tels" in config else 1
optics = subarray_info.tel[tel_id].optics
camera_geom = subarray_info.tel[tel_id].camera.geometry
try:
subarray_info = SubarrayDescription.from_hdf(args.input_file)
optics = subarray_info.tel[tel_id].optics
camera_geom = subarray_info.tel[tel_id].camera.geometry
except OSError:
moralejo marked this conversation as resolved.
Show resolved Hide resolved
print("Subarray description table is not readable because of version incompatibility.")
print("The standard LST optics and camera geometry will be used.")
moralejo marked this conversation as resolved.
Show resolved Hide resolved
optics = OPTICS
camera_geom = load_camera_geometry()

Check warning on line 236 in lstchain/scripts/lstchain_dl1ab.py

View check run for this annotation

Codecov / codecov/patch

lstchain/scripts/lstchain_dl1ab.py#L232-L236

Added lines #L232 - L236 were not covered by tests

dl1_container = DL1ParametersContainer()
parameters_to_update = {
Expand Down
Loading