auviewer.file module
- class auviewer.file.File(projparent, id, origFilePathObj, procFilePathObj)[source]
Bases:
objectRepresents 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
- getInitialPayload(user_id)[source]
Produces JSON output for all series in the file at the maximum time range.
- 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.
- 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).
- property pf