From d3c3015fc82efe11521e41dc4b696ae396474e1d Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 3 Aug 2017 12:13:48 +0100 Subject: [PATCH] Instrument/MeasurementCSV: Add support for recording sample rate. If performing post processing on a MeasurementCsv file, if a timestamp is not available then the recorded sample rate can be used as a substitute. --- devlib/instrument/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devlib/instrument/__init__.py b/devlib/instrument/__init__.py index 46f9c3e..9f8ac00 100644 --- a/devlib/instrument/__init__.py +++ b/devlib/instrument/__init__.py @@ -143,9 +143,10 @@ class Measurement(object): class MeasurementsCsv(object): - def __init__(self, path, channels=None): + def __init__(self, path, channels=None, sample_rate_hz=None): self.path = path self.channels = channels + self.sample_rate_hz = sample_rate_hz self._fh = open(path, 'rb') if self.channels is None: self._load_channels()