I'll preface this question by noting that I'm happy to consider alternatives to pytables, but I would prefer to use pytables in order to benefit from the numexpr features.
I'm looking for a solution for storing/exploring/analyzing my data, for example of the following form: suppose I have many Event
objects, representing some experimental measurement at a certain instant in time. Each Event
contains some scalar fields, as well as a variable number of Particle
objects, each of which contain some scalar fields of their own. See my "drawing" below.
My first thought was to have each Event
as a row in a table. I understand that there is a VLArray
type in pytables, but it seems that these can only store primitive data types. Is there some way to store this data with pytables?
I also considered having each Event
be its own group, with a Particle
table containing a variable number of rows. However, I anticipate many millions of Events
, and I would like to be able to e.g. select events and plot certain fields, as one would do with rows in a table.
If it's not possible to accomplish this with pytables, what are some alternative solutions?
+-------------------------+
+-------------------------+ |
+--------- Event ---------+ | |
| timestamp (int) | | |
| temperature (float) | | |
| latitude (float) | | |
| longitude (float) | | |
| ... [etc]... | | |
| | | |
| +-- Particle<1> --+ | | |
| | idx (int) | | | |
| | energy (float) | | | |
| | x (float) | | | |
| | y (float) | | | |
| | z (float) | | | |
| | ... [etc] ... | | | |
| +-----------------+ | | |
| ... | | |
| +-- Particle<N> --+ | | |
| | idx (int) | | | |
| | energy (float) | | | |
| | x (float) | | | |
| | y (float) | | | |
| | z (float) | | | |
| | ... [etc] ... | | | +
| +-----------------+ | +
+-------------------------+