Data Structures¶
As this package predominantly deals with time series we have the following main structure.
Time-series Container¶
The idea is to bundle all datapoints that were measures during one experiment.
- class glucose_ts.data.GlucoseTS(points_in_time, voltages, real_concentration, comment='')¶
The data structure that represents one glucose sensor experiment.
- Parameters
points_in_time (np.array) – an array that represents the number of minutes from the start of the experiment
voltages (np.array) – an array of voltage numbers that correspond to the points in time when the voltage was measured
real_concentration (float) – the “real” concentration of the glucose compound during the experiment
comment (str) – anything you want
This data structure can be obtained from excel file that are produced in the lab:
- glucose_ts.data.read_glucose_ts(path, comment='')¶
Reads an exel file to obtain all relevant values for a Glucose time-series.
- Parameters
path (str) – a path to a respective exel file
- Returns
a glucose time-series
- Return type
Manipulating Time-series¶
One common operation we need for making predictions is to cut the time-series.
- glucose_ts.data.cut_time_series(glucose_ts, cutoff_time)¶
Creates a subset of a glucose time-series by cutting it off after a certain point in time.
- Parameters
glucose_ts (glucose_ts.data.GlucoseTS) – the glucose time-series to create a cut-off from
cutoff_time (float) – the point in time until we want to keep the time-series
- Returns
a glucose time-series
- Return type