auviewer.file module

class auviewer.file.File(projparent, id, origFilePathObj, procFilePathObj)[source]

Bases: object

Represents a project file. File may operate in file- or realtime-mode. In file-mode, all data is written to & read from a file. In realtime-mode, no file is dealt with and instead everything is kept in memory. If no filename parameter is passed to the constructor, File will operate in realtime-mode.

addSeriesData(seriesData)[source]

Takes new data to add to one or more data series for the file (currently works only in realtime-mode). The new data is assumed to occur after any existing data. The parameter, seriesData, should be a dict of dicts of lists as follows:

{
‘seriesName’: {

‘times’: [ t1, t2, … , tn ], ‘values’: [ v1, v2, … , vn ]

}, …

}

Parameters:

seriesData – dict of dicts

Returns:

updated file data for transmission to realtime subscribers

close()[source]

Use this for closing original and processed .h5 without removing File object from memory

createAnnotation(user_id, left=None, right=None, top=None, bottom=None, seriesID='', label='', pattern_id=None)[source]

Create an annotation for the file

deleteAnnotation(user_id, id)[source]

Deletes the annotation with the given ID, after some checks. Returns true or false to indicate success.

detectPatterns(type, series, thresholdlow=None, thresholdhigh=None, duration=None, persistence=None, maxgap=None, expected_frequency=0, min_density=0, drop_values_below=None, drop_values_above=None, drop_values_between=None)[source]
property f
getEvents()[source]

Returns all event series

getInitialPayload(user_id)[source]

Produces JSON output for all series in the file at the maximum time range.

getMetadata()[source]

Returns a dict of file metadata.

getSeries(seriesid)[source]

Returns the series instance corresponding to the provided series ID, or None if the series cannot be found. The seriesid format is [full_series_path]:[value_column], e.g. /data/numerics/HR:value.

getSeriesNames()[source]

Returns a list of series names available in the file.

getSeriesOrCreate(seriesid)[source]

Retreves or creates & returns the series corresponding to the provided series ID.

getSeriesRangedOutput(seriesids, start, stop)[source]

Produces JSON output for a given list of series in the file at a specified time range.

load()[source]

Loads the necessary data into memory for an already-processed data file (does not load data though). Sets up classes for all series from file but does not load series data into memory).

loadSeriesFromDataset(ds)[source]

Load all available series from a dataset

mode()[source]

Returns the mode in which File is operating, either “file” or “realtime”.

property pf
process()[source]

Process and store all downsamples for all series for the file.

updateAnnotation(user_id, id, left=None, right=None, top=None, bottom=None, seriesID='', label='')[source]

Update an annotation with new values