- #1
- 3,509
- 1,071
- TL;DR Summary
- How to best organise data?
We are working on new software for one of our measurement systems (written in Python). The new system is capable of measuring more devices simultaneously than before so keeping track of what we are doing is important; it will also be more automated.
One of the things we want to implement is better handling of device parameter data,
The latter can mean parameters for one of the devices-under-test (DUT) as well as for some of the components used in the measurement chain (which needs to be re-calibrated once a day or so)
My problem is I can't figure what the best to handle the data is.
One of the things we want to implement is better handling of device parameter data,
The latter can mean parameters for one of the devices-under-test (DUT) as well as for some of the components used in the measurement chain (which needs to be re-calibrated once a day or so)
My problem is I can't figure what the best to handle the data is.
- The number of devices are relatively small (maybe 20-40) at any given time but we will of course change DUTs between runs and we need a way to keep track of data for each DUT
- Each device will probably have 5-10 parameters. Mostly floating point numbers but it would be nice to have the option to also save arrays.
- The values of the parameters for each devices will change over time and will then need to be updated; either because we measure them for the first time; or because they are updated when they are re-calibration . We always need to know the "active" parameter, but being able to also store the history would be a big plus. For the components in the measurement chain it would also be nice to be able to look at trends over long times (months)
- Long terms storage is very important; we will need to be able to find the data that belong to a specific device in a few years.
- The data must be in format that is easy to read and understand
- The software is in reality a number of Python scripts, we will never run more than one script at a time but it is important that reading/writing data is straightforward.
- Just saving each data for each device in a unique file in a hierarchical file structure. The file format would be e.g. JSON of XML. Drawback: There is no obvious way to store history, the structure could end up being very messy.
- The same as above but save data in HDF5 files (a format we already use); by saving parameters in arrays (updated vs time) to give us the ability to track history.
- Use a database. We probably don't need a fully featured database but could use say sqlite. This looks quite good on paper, but saving all data in a single file makes me nervous, It would also make it harder for users to find and extract data unless they were very familiar with the database