odin-detector / odin-data

DAQ software libraries for capturing and storing data from parallel detector systems
https://odin-detector.github.io/odin-data/
Apache License 2.0
8 stars 10 forks source link

Add an option for setting HDF5 file postfix. #292

Closed ajgdls closed 2 years ago

ajgdls commented 2 years ago

For a case where data is stored into file with geographical separation instead of round robin of frames it makes sense for the file names to be labelled with slightly different names and all retain the same numbering (e.g.): file_A_000001.h5 file_B_000001.h5 This change allows the specification of a file postfix (_A or _B in the example above) placed before the automatic numbering.

ajgdls commented 2 years ago

This would be a good time to make that change! Is it a boolean flag that you would like to be able to set (turn on or off numbering)? Also I remember someone (maybe William) suggesting the file numbering should start from a configured number so we could have the files starting with index 0 instead of 1. Shall I stick that in too?

timcnicholls commented 2 years ago

This would be a good time to make that change! Is it a boolean flag that you would like to be able to set (turn on or off numbering)? Also I remember someone (maybe William) suggesting the file numbering should start from a configured number so we could have the files starting with index 0 instead of 1. Shall I stick that in too?

I think having both ia boolean enable and a start index would be perfect thanks. We can make them default to the current behaviour (enabled/starting at 1) so it doesn't surprise anyone.

ajgdls commented 2 years ago

There is now a starting index configuration parameter and a numbering on/off configuration parameter. The defaults are for indexing to be 0 indexed (which really is the most used indexing) instead of 1 indexed, and for the numbers to be turned on by default.

ajgdls commented 2 years ago

Yay finally I believe the tests are all passing, and I have implemented the additional config items for setting the starting file index and turning off file numbering. @timcnicholls @GDYendell I think this is now ready for review again.