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

IndexError: Cannot choose from an empty sequence #19

Closed
kbruegge opened this issue Apr 27, 2018 · 1 comment
Closed

IndexError: Cannot choose from an empty sequence #19

kbruegge opened this issue Apr 27, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@kbruegge
Copy link
Member

I'm having trouble extracting images from simtel files.
One of the files I'm looking at is
proton_20deg_0deg_run20089___cta-prod3-merged_desert-2150m-Paranal-3HB89-NGFD.simtel.gz

I get the following stacktrace:

(fact) [kbruegge@vollmond image-extractor]$ python image-extractor/image_extractor.py run_list.txt ./test.h5 
WARNING: AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory [__main__]
WARNING:astropy:AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory

gzip: stdout: Broken pipe
WARNING: AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory [__main__]
WARNING:astropy:AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory
WARNING:ctapipe.io.hessioeventsource.HESSIOEventSource:Only one pyhessio event_source allowed at a time. Previous hessio file will be closed.

gzip: stdout: Broken pipe
WARNING: AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory [__main__]
WARNING:astropy:AstropyDeprecationWarning: prefer the use of an EventSource or EventSourceFactory
WARNING:ctapipe.io.hessioeventsource.HESSIOEventSource:Only one pyhessio event_source allowed at a time. Previous hessio file will be closed.

gzip: stdout: Broken pipe
Traceback (most recent call last):
  File "image-extractor/image_extractor.py", line 641, in <module>
    extractor.process_data(data_file, args.max_events)
  File "image-extractor/image_extractor.py", line 273, in process_data
    random_tel_id = random.choice(selected_tels[tel_type])
  File "/home/kbruegge/.conda/envs/fact/lib/python3.6/random.py", line 258, in choice
    raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
Closing remaining open files:./test.h5...done
@bryankim96 bryankim96 added the bug label Sep 4, 2018
@bryankim96 bryankim96 self-assigned this Sep 21, 2018
@bryankim96 bryankim96 added this to the v0.6.0 milestone Sep 25, 2018
@bryankim96
Copy link
Member

Sorry for the extremely late reply. This bug was due to inconsistencies in telescope type naming, which caused no telescopes to actually be read from the event_source. It has been fixed with e2b40f2.

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

2 participants