-
Notifications
You must be signed in to change notification settings - Fork 11
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
Reader cannot read runs with a single gain #34
Comments
Thank you for reporting this. It should be easy to fix. I can look into it next week if there isn't anybody beating me to it ;) |
This is on hold until the pull request addressing issue #32 is merged |
Hi @sizun, could you please be more specific about the problem you are experiencing? I tried reading run 3889 with the current version of the reader and could do it successfully.
The waveform shape is (1855,60), as expected after gain selection, and the plotted waveform looks reasonable. However, if there is a more fundamental problem in reading the files please let me know and I'll look into it. I suspect there is no fundamental difference for runs where only some events have gain-selection according to their trigger type because the r0 and r1 containers are filled on an event-by-event basis. |
Hello @tibaldo from ctapipe.io import EventSource, EventSeeker
path = 'NectarCAM.Run3889.0000.fits.fz'
reader=EventSource(input_url=path)
seeker = EventSeeker(reader)
evt = seeker.get_event_index(25)
print(evt.r0.tel[0].waveform is None) |
Hi @sizun, yes, that's what I explained. The logic in the code is that if gain selection has already happened than the entire r0->r1 calibration has already happened and the content of the file is dumped into the r1 container. The r0 container is not filled because the code assumes there are no r0 data if the gain selection has been applied. |
I still do not understand the contents of evt.r1.tel[0].waveform. The 60 samples plotted above are not integers, why? Has any processing been applied to the data stored in the ZFITS file? |
Well spotted! I checked calibration.py and realized that by the way the code is written the default flatfield coefficients are applied in this case. While we think of a possible improvement in the code conception you can read the raw waveforms by disabling all the r0->r1 corrections.
Please let me know if this works for you. |
Hello @jlenain |
Hi @tibaldo , |
Related to #15. Current NectarCAMEventSource cannot even read runs like run 3889 with a single gain (where gain selection is enabled for all trigger bits).
The text was updated successfully, but these errors were encountered: