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

Error when SubarrayDescription.select_subarray is given unknown telescope ids could be better #1924

Closed
aknierim opened this issue Jun 3, 2022 · 0 comments
Labels

Comments

@aknierim
Copy link
Contributor

aknierim commented Jun 3, 2022

When using more than one allowed telescope in your config file and the pedestal dataset only contains data for a specific telescope id you get the following, imprecise error message:

ERROR [ctapipe.ctapipe-process] (tool.run): Caught unexpected exception: 2
Traceback (most recent call last):
File "/ctasoft/ctapipe/ctapipe/core/tool.py", line 336, in run
    self.setup()
  File "/ctasoft/ctapipe/ctapipe/tools/process.py", line 150, in setup
    self.event_source = EventSource(parent=self)
  File "/ctasoft/ctapipe/ctapipe/io/simteleventsource.py", line 243, in __init__
    self._subarray_info = self.prepare_subarray_info(
  File "/ctasoft/ctapipe/ctapipe/io/simteleventsource.py", line 364, in prepare_subarray_info
    subarray = subarray.select_subarray(self.allowed_tels)
  File "/ctasoft/ctapipe/ctapipe/instrument/subarray.py", line 319, in select_subarray
    tel_positions = {tid: self.positions[tid] for tid in tel_ids}
  File "/ctasoft/ctapipe/ctapipe/instrument/subarray.py", line 319, in <dictcomp>
    tel_positions = {tid: self.positions[tid] for tid in tel_ids}
KeyError: 2

An error message telling the user what telescope id's are allowed would be helpful for future use.

@aknierim aknierim added the bug label Jun 3, 2022
@maxnoe maxnoe changed the title Imprecise error message when loading pedestal data with ctapipe-process Error when SubarrayDescription.select_subarray is given unknown telescope ids could be better Jun 3, 2022
@maxnoe maxnoe closed this as completed in 7a3ee93 Jun 7, 2022
maxnoe added a commit that referenced this issue Jun 7, 2022
Better error message in case unknown telescopes are selected, fixes #1924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant