lucabaldini / hexsample

Solid-state hybrid detectors with hexagonal sampling.
https://lucabaldini.github.io/hexsample/
GNU General Public License v3.0
2 stars 0 forks source link

Add all the necessary metadata to the output HDF5 files #14

Closed lucabaldini closed 9 months ago

lucabaldini commented 9 months ago

We should keep track of all the simulation settings in the simulation output, and carry this over to the recon files, adding the configuration used for the reconstruction.

Here is a link at a repo that we might be able to use for inspiration https://github.com/lmassach/tj-monopix2-daq

lucabaldini commented 9 months ago

I took a cursory look at the rep above, and it looks like their strategy to write the configuration is to create a table like

class RunConfigTable(tb.IsDescription):
    attribute = tb.StringCol(64)
    value = tb.StringCol(512)

and then fill the table a row at a time. I am not sure this is what we want, as I'd rather have values of the proper type---not all strings.

lucabaldini commented 9 months ago

Looking at the pytables documentation https://www.pytables.org/usersguide/tutorials.html it looks like the way to go, here, might be to use attributes.

lucabaldini commented 9 months ago

I have merged on the main a pull request that goes a long way in implementing this: https://github.com/lucabaldini/hexsample/pull/17

At this point all the command-line switches are saved as user attributes in a specific group called header.

The other thing that might be worth doing would be to copy the digi header into the corresponding reconstructed file.

lucabaldini commented 9 months ago

Shipped in 0.2.0