lspestrip / striptease

Strip TEst Analysis for System Evaluation
MIT License
4 stars 3 forks source link

Save run-length encoded times in HDF5 files #98

Open ziotom78 opened 1 year ago

ziotom78 commented 1 year ago

Currently the code is extremely slow in loading scientific data from HDF5 files. Even if you are interested in a few seconds of data and know the extrema of the time interval, the whole timestream of data (~4 hours) needs to be loaded in memory.

This PR adds the ability to save a Run-Length Encoded (RLE) version of the time stream of each polarimeter in the same HDF5 file. It is typically done when the SQLite3 database used by DataStorage is created. Once the RLE timeline is saved, it will be used whenever scientific data for a specific range of time are requested either by DataFile.load_sci or DataStorage.load_sci. This should reduce the time needed for I/O considerably, expecially if the chunk of data is small.