Save pixels charge and peak time arrays in 'DL1' h5 tables #2339
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
This is not "crazy" at all and is even already supported. |
Beta Was this translation helpful? Give feedback.
-
This should be no problem, even in an older version of ctapipe. You simply need to fill a Container with that information and pass it to a TableWriter, which can take a list of containers to write to a single table (all Containers in the list get combined into a single output table). The only problem you might have when writing these to a single table is that the length of each table cell must be the same always, meaning that you can't write e.g. 2000 pixels to one cell, and then a different number of pixels to the next: the TableWriter assumes fixed-length arrays (for reasons of speed optimization). I only mention that because it could be the cause of a problem if you try to write the images from mixed telescope types to the same table. As it sounds like you did this, can you explain better what you tried? And also explain better what didn't work? It's hard to give a good answer without more information. |
Beta Was this translation helpful? Give feedback.
-
The code is something like:
I cut it to remove all the unnecessary steps (cleaning, Hillas parameters...). For each event, and for each telescope, the array length is the same (~8000 pixels) because I set to 0 the ones not surviving cleaning instead of deleting them from the array. If you need more information, I will try to provide it (sorry, they asked me to do this and I never departed from our standard data format before, so I must disturb you) |
Beta Was this translation helpful? Give feedback.
-
Not really. It's much more fundamental than just an assumption for speed: the underlying library |
Beta Was this translation helpful? Give feedback.
-
You call the What you need to pass to the writer is directly the So the correct code would look something like this:
This is all handled in recent versions of ctapipe in the |
Beta Was this translation helpful? Give feedback.
-
Thank you, this seems working (at least, now, arrays are in the tables; I must still work on retrieving them). Sorry, I was trying to save them where they could not be saved🤦 BTW, please try to preserve back compatibility while producing new releases: we could already use ctapipe 0.19 but we would have no LST data😅😅 |
Beta Was this translation helpful? Give feedback.
-
Yes the purpose of introducing the
|
Beta Was this translation helpful? Give feedback.
-
To add some more lstchain perspective:
But even just extending the |
Beta Was this translation helpful? Give feedback.
You call the
DL1Container
, which is a container for all telescopesdl1tel
and set one of its members to aDL1CameraContainer
.What you need to pass to the writer is directly the
DL1CameraContainer
, you need to write it to a table per telescope (or at least per telescope type) due to the fixed length limitation.So the correct code would look something like this:
This is all handled in recent versions of ctapipe in the
DataWriter
class.