Open morcuended opened 3 years ago
But it's getting more and more common.
Then we should also open an issue with the DAQ people, right? This should not happen in the first place.
A simple check would be event_id == 0
, since that starts at 1.
The question is should we stop processing at the first of such "empty" events or just skip them?
But it's getting more and more common.
Then we should also open an issue with the DAQ people, right? This should not happen in the first place.
I will open a ticket in Redmine.
The question is should we stop processing at the first of such "empty" events or just skip them?
Right now I simply discard the whole file even if there are also good events. There is no other way to do it right now.
Are there good events after the empty ones? Or are the empty ones always at the back?
No idea. Did not check that.
Can you try with that? https://github.com/cta-observatory/ctapipe_io_lst/pull/99
Let me try
Redmine page: https://forge.in2p3.fr/issues/44538
@maxnoe, the fix in cta-observatory/ctapipe_io_lst#99 worked fine in those two files.
Ok, then let's merge that and make a new release for ctapipe_io_lst
.
Ah, already done by @rlopezcoto, great!
Although it worked almost all the time. I spotted a different error related to this in run 04135.0157
(last file of the run):
...
Event with event_id=0 found, skipping
Event with event_id=0 found, skipping
Traceback (most recent call last):
File "/fefs/aswg/software/virtual_env/anaconda3/envs/osa/bin/lstchain_data_r0_to_dl1", line 8, in <module>
sys.exit(main())
File "/fefs/aswg/software/virtual_env/anaconda3/envs/osa/lib/python3.7/site-packages/lstchain/scripts/lstchain_data_r0_to_dl1.py", line 185, in main
custom_config=config,
File "/fefs/aswg/software/virtual_env/anaconda3/envs/osa/lib/python3.7/site-packages/lstchain/reco/r0_to_dl1.py", line 575, in r0_to_dl1
new_ped, new_ff = calibration_calculator.output_interleaved_results(event)
UnboundLocalError: local variable 'event' referenced before assignment
That happens when there are no events at all.
The code is very problematic. Mixing calculation with storing it in the event with the IO at the end. I would try to fix that, but for the moment, I would only check that at least one event has been processed.
Just for the record. Sometimes the r0 to dl1 step fails for the last files of given runs. This error happens for example in the last two subruns 170 and 171 of run 4343 from 2021-04-08.
@maxnoe checked this some time ago showing that those events are filled with zeros. The first 4544 events have waveform with length 74200 (one gain), only the last 25 have 148400.
The problem is probably related to the process of stopping the run during data taking. But it's getting more and more common.
Right now the solution is to discard those runs after seeing that they fail with this error.
Command
Error: