Python Library for OKN Data Updater
Project description
OKN_PY_UPDATER
A python library to be used for live updating the okn data before sending into new version of okn detector.
Installation requirements and guide
Anaconda
To install this program, Anaconda python distributing program
and Anaconda Powershell Prompt
are needed.
If you do not have Anaconda
, please use the following links to download and install:
Download link: https://www.anaconda.com/products/distribution
Installation guide link: https://docs.anaconda.com/anaconda/install/
PIP install
The library name is called okn_py_updater
.
To install okn_py_updater
, you have to use Anaconda Powershell Prompt
.
In Anaconda Powershell Prompt
:
pip install okn_py_updater
Usage
example_updater = Updater(`config to be used`, `length of circular buffer`, `header array`, `drop rate`)
- config to be used: must be dictionary type of
gazefilters.json
which contains information such asMappers
,filters
andGraph
. - length of circular buffer: must be integer type to define the length of buffer to be used.
- header array: must be array which contains strings which will specify the individual data name of the data array to be updated. Examples: header_array = ['x_value', 'y_value', 'x_nom', 'y_nom', 'record_timestamp', 'sensor_timestamp', 'frame_rate', 'is_event', 'event_id', 'direction']
- drop rate: must be integer type. If it is zero, all data will be used. If it is more than 1, every 1 data will be collected then it will drop the amount of drop rate. For example: If the drop rate is 2, every 1 data will be collected then 2 data will be dropped.
Example Usage
config_to_be_used = load_commented_json("gazefilters.json")
header_array = ['x_value', 'y_value', 'x_nom', 'y_nom', 'record_timestamp', 'sensor_timestamp', 'frame_rate',
'is_event', 'event_id', 'direction']
example_updater = Updater(config_to_be_used, 100, header_array, 3)
out_put = example_updater.update(data)
Updater Class Specifications
Attributes
- config: The dictionary version of
gazefilters.json
which contains information such asMappers
,filters
andGraph
. - filter_config: The filter information of the config.
- circular_buffer: The circular buffer with max length which will be defined by user.
- self.buffer_max_length: The max length of buffer.
- self.header_array: The header array which will be defined by user.
- self.data_drop_rate: The drop rate which will be defined by user.
- count: The count to be used as a counter if data drop rate is greater than zero.
Methods
- update(self, data_input): To store incoming data into circular buffer, update the buffer and return the last element of buffer.
- set_buffer(self, new_buffer_length): To update buffer.
- set_header_array(self, new_header_array): To update header array.
- set_drop_rate(self, new_drop_rate): To update drop rate.
- get_output_header_array(self): To get output header array.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file okn_py_updater-2.0.1.tar.gz
.
File metadata
- Download URL: okn_py_updater-2.0.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5499197b52f60cf1585bb2055bd487adff9095e74a7e8c26267b0f4155cc0e58 |
|
MD5 | 88f3c7fd77327fbe2e59b2408bfa133f |
|
BLAKE2b-256 | 312e6b527f0557ab956d4fe44831a765ec7fd66f180c034ad3a9efd6c5b9d57d |
File details
Details for the file okn_py_updater-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: okn_py_updater-2.0.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b25ca892567a54ba996d6f128a0aa5d178f938346d5019cad701e514aea6b8 |
|
MD5 | 7353cdd965d0031cb20a781be88284d2 |
|
BLAKE2b-256 | 42968421c2d8f49c2ec9a8f269eb3d9bee31207f1564e777f551eb33c5ff8454 |