|
|
RTIS Dev Documentation - Table of Content
|
|
|
General Example
|
|
|
Classes
|
|
|
RTISMeasurement
|
|
|
RTISSettings
|
|
|
MeasureExternalTriggerQueueThread
|
|
|
MeasureExternalTriggerCallbackThread
|
|
|
Methods
|
|
|
open_connection
|
|
|
close_connection
|
|
|
set_recording_settings
|
|
|
set_processing_settings
|
|
|
get_current_settings
|
|
|
clear_current_settings
|
|
|
get_settings
|
|
|
set_settings_from_class
|
|
|
get_premade_processing_settings_list
|
|
|
get_premade_recording_settings_list
|
|
|
get_microphone_layout_list
|
|
|
prepare_processing
|
|
|
unload_processing
|
|
|
get_raw_measurement
|
|
|
get_signal_measurement
|
|
|
get_processed_measurement
|
|
|
process_measurement
|
|
|
set_counter
|
|
|
set_behaviour
|
|
|
get_firmware_version
|
|
|
create_measure_external_trigger_queue
|
|
|
create_measure_external_trigger_callback
|
|
|
create_processing_workers
|
|
|
toggle_amplifier
|
|
|
toggle_external_triggers
|
|
|
reset_device
|
|
|
set_log_mode
|
|
|
set_custom_logger
|
|
|
General Example
|
|
|
# **RTIS Dev Documentation - Table of Content**
|
|
|
|
|
|
- [General Example](#general-example)
|
|
|
- [Classes](#classes)
|
|
|
- [RTISMeasurement](#rtismeasurement)
|
|
|
- [RTISSettings](#rtissettings)
|
|
|
- [MeasureExternalTriggerQueueThread](#measureexternaltriggerqueuethread)
|
|
|
- [MeasureExternalTriggerCallbackThread](#measureexternaltriggercallbackthread)
|
|
|
- [Methods](#methods)
|
|
|
- [open_connection](#open_connection)
|
|
|
- [close_connection](#close_connection)
|
|
|
- [set_recording_settings](#set_recording_settings)
|
|
|
- [set_processing_settings](#set_processing_settings)
|
|
|
- [get_current_settings](#get_current_settings)
|
|
|
- [clear_current_settings](#clear_current_settings)
|
|
|
- [get_settings](#get_settings)
|
|
|
- [set_settings_from_class](#set_settings_from_class)
|
|
|
- [get_premade_processing_settings_list](#get_premade_processing_settings_list)
|
|
|
- [get_premade_recording_settings_list](#get_premade_recording_settings_list)
|
|
|
- [get_microphone_layout_list](#get_microphone_layout_list)
|
|
|
- [prepare_processing](#prepare_processing)
|
|
|
- [unload_processing](#unload_processing)
|
|
|
- [get_raw_measurement](#get_raw_measurement)
|
|
|
- [get_signal_measurement](#get_signal_measurement)
|
|
|
- [get_processed_measurement](#get_processed_measurement)
|
|
|
- [process_measurement](#process_measurement)
|
|
|
- [set_counter](#set_counter)
|
|
|
- [set_behaviour](#set_behaviour)
|
|
|
- [get_firmware_version](#get_firmware_version)
|
|
|
- [create_measure_external_trigger_queue](#create_measure_external_trigger_queue)
|
|
|
- [create_measure_external_trigger_callback](#create_measure_external_trigger_callback)
|
|
|
- [create_processing_workers](#create_processing_workers)
|
|
|
- [toggle_amplifier](#toggle_amplifier)
|
|
|
- [toggle_external_triggers](#toggle_external_triggers)
|
|
|
- [reset_device](#reset_device)
|
|
|
- [set_log_mode](#set_log_mode)
|
|
|
- [set_custom_logger](#set_custom_logger)
|
|
|
|
|
|
# **General Example**
|
|
|
|
|
|
Here is a small example that goes over most basic steps:
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
import matplotlib.pyplot as plt
|
|
|
import numpy as np
|
... | ... | @@ -106,53 +110,123 @@ for microphone_index_i in range(0, 8): |
|
|
axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
|
|
|
plt.show()
|
|
|
fig.suptitle("RTIS Dev - Microphone Signals")
|
|
|
Classes
|
|
|
RTISMeasurement
|
|
|
class RTISMeasurement(id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None) [source]
|
|
|
|
|
|
Class storing all data and information on an RTIS device measurement.
|
|
|
|
|
|
Attributes: id : string
|
|
|
The unique identifier to identify this RTIS Client by.
|
|
|
|
|
|
timestamp : float
|
|
|
The epoch timestamp of the measurement.
|
|
|
|
|
|
behaviour : bool
|
|
|
The sonar behaviour (active or passive).
|
|
|
|
|
|
index : int
|
|
|
The internal measurement index.
|
|
|
|
|
|
rawData : Numpy ndarray
|
|
|
This stores the raw data returned by the RTIS Device. This is stored as a list of uint32 values.
|
|
|
|
|
|
processedData : Numpy ndarray
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
|
|
|
Methods
|
|
|
update_processed_data(self, processedData: np.ndarray) [source]
|
|
|
|
|
|
If only the attribute processedData needs to be updated, use this function.
|
|
|
```
|
|
|
|
|
|
Parameters: processedData : Numpy ndarray (None by default)
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
# **Classes**
|
|
|
|
|
|
RTISSettings
|
|
|
class RTISSettings(firmwareVersion, configName='') [source]
|
|
|
## **RTISMeasurement**
|
|
|
|
|
|
Class describing all the processing and recording settings related to RTIS devices. Too many variables to describe here. Check the source-code for more information on which variables are available. Can be converted to a dictionary.
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L321">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
MeasureExternalTriggerQueueThread
|
|
|
class MeasureExternalTriggerQueueThread(*args, **kwargs) [source]
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger. To set the data queue correctly use set_queue(dataQueue) function. the RTISMeasurement objects will then be put on this queue. To start the thread use the start() function. To stop use the stop_thread() function. By default using a signal.SIGINT exit (ex. using CTRL+C) will gracefully end the script.
|
|
|
Class storing all data and information on an RTIS device measurement.
|
|
|
|
|
|
Use create_measure_external_trigger_queue(dataQueue) to make an easy to use the class.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Attributes:</b></td>
|
|
|
<td class="field-body" width="100%"><b>id : <i>string</i></b>
|
|
|
<p class="attr">
|
|
|
The unique identifier to identify this RTIS Client by.
|
|
|
</p>
|
|
|
<b>timestamp : <i>float</i></b>
|
|
|
<p class="attr">
|
|
|
The epoch timestamp of the measurement.
|
|
|
</p>
|
|
|
<b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
The sonar behaviour (active or passive).
|
|
|
</p>
|
|
|
<b>index : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The internal measurement index.
|
|
|
</p>
|
|
|
<b>rawData : <i>Numpy ndarray</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the raw data returned by the RTIS Device. This is stored as a list of uint32 values.
|
|
|
</p>
|
|
|
<b>processedData : <i>Numpy ndarray</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>update_processed_data</b>(<i>self, processedData: np.ndarray</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L377">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
If only the attribute `processedData` needs to be updated, use this function.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>processedData : <i>Numpy ndarray (None by default)</i></b>
|
|
|
<p class="attr">
|
|
|
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **RTISSettings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L390">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing all the processing and recording settings related to RTIS devices.
|
|
|
Too many variables to describe here. Check the source-code for more information on which variables are available.
|
|
|
Can be converted to a dictionary.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
## **MeasureExternalTriggerQueueThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerQueueThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L545">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the data queue correctly use `set_queue(dataQueue)` function.
|
|
|
the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects will then be put on this queue.
|
|
|
To start the thread use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_queue) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Examples
|
|
|
Create a queue to save the measurement to and assign it to the thread.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Manager
|
|
|
import rtisdev
|
|
|
|
... | ... | @@ -166,36 +240,111 @@ dataQueue = manager.Queue() |
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
Methods
|
|
|
set_queue(self, dataQueue) [source]
|
|
|
```
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L581">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the dataQueue to be used by the Thread to store the incoming RTISMeasurement objects on.
|
|
|
Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on.
|
|
|
|
|
|
Parameters: dataQueue : multiprocessing.Manager.Queue
|
|
|
This is the data queue that will be used to store the RTISMeasurement objects on.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>dataQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
This is the data queue that will be used to store the RTISMeasurement objects on.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
stop_thread(self) [source]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L592">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
|
|
|
|
|
stopped(self) [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L599">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
|
|
|
|
|
run(self) [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L605">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use start() instead.
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
MeasureExternalTriggerCallbackThread
|
|
|
class MeasureExternalTriggerCallbackThread(*args, **kwargs) [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger. To set the callback function correctly use set_callback(callback) function. Your callback function should only have one argument, the RTISMeasurement data package. To start the thread use the start() function. To stop use the stop_thread() function. By default using a signal.SIGINT exit (ex. using CTRL+C) will gracefully end the script.
|
|
|
</table>
|
|
|
|
|
|
Use create_measure_external_trigger_callback(callback) to make an easy to use the class.
|
|
|
|
|
|
Examples
|
|
|
|
|
|
## **MeasureExternalTriggerCallbackThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerCallbackThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L653">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the callback function correctly use `set_callback(callback)` function.
|
|
|
Your callback function should only have one argument, the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) data package.
|
|
|
To start the thread use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use `create_measure_external_trigger_callback(callback)` to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a callback to save the measurement to disk.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
... | ... | @@ -216,97 +365,236 @@ def save_callback(measurement=None): |
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
Methods
|
|
|
set_callback(self, callback) [source]
|
|
|
```
|
|
|
|
|
|
Parameters: callback : method with one argument (RTISMeasurement)
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the RTISMeasurement object containing the measurement data.
|
|
|
#### Methods
|
|
|
|
|
|
stop_thread(self) [source]
|
|
|
|
|
|
Stop the measurement thread gracefully.
|
|
|
|
|
|
stopped(self) [source]
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L696">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
|
|
|
|
|
run(self) [source]
|
|
|
|
|
|
Main thread function to run continuously. Should not be used. Use start() instead.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>callback : <i>method with one argument (RTISMeasurement)</i></b>
|
|
|
<p class="attr">
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> object containing the measurement data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
Methods
|
|
|
open_connection
|
|
|
def open_connection(port: string='/dev/ttyACM0', allowDebugMode: bool=False ) [source]
|
|
|
|
|
|
Connect to the port of the RTIS Hardware.
|
|
|
|
|
|
Parameters: port : string (default = '/dev/ttyACM0')
|
|
|
Name of the port.
|
|
|
|
|
|
allowDebugMode : bool (default = False)
|
|
|
When enabled, if a connection can not be made to a real RTIS Device to the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing a exception. This is mostly for debugging and testing of the library.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L707">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
close_connection
|
|
|
def close_connection() [source]
|
|
|
Stop the measurement thread gracefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
Manually close the connection to the RTIS device. Normally, when your script ends without exceptions the connection will automatically be closed gracefully.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
set_recording_settings
|
|
|
def set_recording_settings(premade: str=None, jsonPath: str=None, callCustom: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, configName: str= '', applyToDevice: bool=True) [source]
|
|
|
|
|
|
Set the recording settings. All parameters are optional and most have default values. Please read their decription carefully.
|
|
|
|
|
|
Parameters: premade : String (default = Not used)
|
|
|
When using get_premade_recording_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L714">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the thread if it should be stopped or not.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
jsonPath : String (default = Not used)
|
|
|
One can also store the recording settings in a json file. To load the recording settings from a json file, please use the absolute path to this json file with this argument. See the examples for more information.
|
|
|
</table>
|
|
|
|
|
|
callCustom : String (default = Not used)
|
|
|
One can use a custom call pulse to emmit from the RTIS Device in active mode. To load the custom pulse, use the absolute path to the csv file with this argument. See the examples for more information.
|
|
|
|
|
|
microphoneSamples : int (default = 163840)
|
|
|
The amount of microphone samples. Must be dividable by 32768.
|
|
|
|
|
|
microphoneSampleFrequency : int (default = 4500000)
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
|
|
|
callSampleFrequency : int (default = 450000)
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
|
|
|
callDuration : float (default = 2.5)
|
|
|
The duration in miliseconds of the call.
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L720">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
callMinimumFrequency : int (default = 25000)
|
|
|
The minimum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
Main thread function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
callMaximumFrequency : int (default = 50000)
|
|
|
The maximum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
callEmissions : int (default = 1)
|
|
|
The amount of times the pulse should be emitted during one measurement.
|
|
|
</table>
|
|
|
|
|
|
configName : String (default = "")
|
|
|
String to identify these settings with. If set to empty (as it is by default), it will become the name set for premade. If no premade settings are used it will default to RTISSettings.
|
|
|
|
|
|
applyToDevice : bool (default = True)
|
|
|
A configuration toggle to optionally disable applying the recording settings to the RTIS Device.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
# **Methods**
|
|
|
|
|
|
Examples
|
|
|
Create settings from a premade setup. You can get the available premade settings with get_premade_recording_settings_list().
|
|
|
## **open_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0', allowDebugMode: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2129">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Connect to the port of the RTIS Hardware.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>port : <i>string (default = '/dev/ttyACM0')</i></b>
|
|
|
<p class="attr">
|
|
|
Name of the port.
|
|
|
</p>
|
|
|
<b>allowDebugMode : <i>bool (default = False)</i></b>
|
|
|
<p class="attr">
|
|
|
When enabled, if a connection can not be made to a real RTIS Device to the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing a exception. This is mostly for debugging and testing of the library.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **close_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>close_connection</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2190">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Manually close the connection to the RTIS device.
|
|
|
Normally, when your script ends without exceptions the connection will automatically
|
|
|
be closed gracefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_recording_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_recording_settings</b>(<i>premade: str=None, jsonPath: str=None, callCustom: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, configName: str= '', applyToDevice: bool=True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2219">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the recording settings. All parameters are optional and most have default values.
|
|
|
Please read their decription carefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>premade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_recording_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>jsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the recording settings in a json file. To load the recording settings from a json file, please use the absolute path to this json file with this argument. See the examples for more information.
|
|
|
</p>
|
|
|
<b>callCustom : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom call pulse to emmit from the RTIS Device in active mode. To load the custom pulse, use the absolute path to the csv file with this argument. See the examples for more information.
|
|
|
</p>
|
|
|
<b>microphoneSamples : <i>int (default = 163840)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of microphone samples. Must be dividable by 32768.
|
|
|
</p>
|
|
|
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
|
|
|
<p class="attr">
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
</p>
|
|
|
<b>callSampleFrequency : <i>int (default = 450000)</i></b>
|
|
|
<p class="attr">
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
</p>
|
|
|
<b>callDuration : <i>float (default = 2.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The duration in miliseconds of the call.
|
|
|
</p>
|
|
|
<b>callMinimumFrequency : <i>int (default = 25000)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callMaximumFrequency : <i>int (default = 50000)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callEmissions : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of times the pulse should be emitted during one measurement.
|
|
|
</p>
|
|
|
<b>configName : <i>String (default = "")</i></b>
|
|
|
<p class="attr">
|
|
|
String to identify these settings with. If set to empty (as it is by default), it will become the name set for premade. If no premade settings are used it will default to <em>RTISSettings</em>.
|
|
|
</p>
|
|
|
<b>applyToDevice : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to optionally disable applying the recording settings to the RTIS Device.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(premade="short_20_80")
|
|
|
Create settings from a json file. This expects a json to be available with a format such as seen below. Here we use auto-generated pulse call to emit.
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated pulse call to emit.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 294912,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
... | ... | @@ -316,9 +604,19 @@ Create settings from a json file. This expects a json to be available with a for |
|
|
"callMaximumFrequency" : 50000,
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
Create settings from a json file. This expects a json to be available with a format such as seen below. Here we use manually generated call. It has to be available on the given path and have the right format. An example of such a custom call can be found here.
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated call.
|
|
|
It has to be available on the given path and have the right format.
|
|
|
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv).
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 16777216,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
... | ... | @@ -326,81 +624,141 @@ Create settings from a json file. This expects a json to be available with a for |
|
|
"callCustom": "mycall.csv",
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000,
|
|
|
callMaximumFrequency=80000)
|
|
|
Load in manually generated call. This requires the file to exist on the path and have the right format. An example of such a custom call can be found here.
|
|
|
|
|
|
rtisdev.set_processing_settings(callCustom="mycall.csv")
|
|
|
set_processing_settings
|
|
|
def set_processing_settings(premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True) [source]
|
|
|
|
|
|
Set the processing settings. All parameters are optional and most have default values. Please read their decription carefully.
|
|
|
|
|
|
Parameters: premade : String (default = Not used)
|
|
|
When using get_premade_processing_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
|
|
|
jsonPath : String (default = Not used)
|
|
|
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument. See the examples for more information.
|
|
|
|
|
|
customPath : String (default = Not used)
|
|
|
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located. See the examples for more information.
|
|
|
|
|
|
microphoneLayout : String (default = eRTIS_v3D1)
|
|
|
Identifier of the microphone layout used for this configuration.
|
|
|
|
|
|
mode : int (default = 1)
|
|
|
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal plane layout will be generated. When set to 0 a 3D equal distance layout will be generated for the frontal hemisphere of the sensor.
|
|
|
```
|
|
|
|
|
|
directions : int (default = 181)
|
|
|
Defines how many directions the layout should generate.
|
|
|
|
|
|
minRange : float (default = 0.5)
|
|
|
The minimum distance in meters of the energyscape to generate.
|
|
|
|
|
|
maxRange : float (default = 5)
|
|
|
The maximum distance in meters of the energyscape to generate.
|
|
|
|
|
|
microphoneSampleFrequency : int (default = 4500000)
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
|
|
|
pdmEnable : bool (default = True)
|
|
|
Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
matchedFilterEnable : bool (default = True)
|
|
|
Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
beamformingEnable : bool (default = True)
|
|
|
Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
enveloppeEnable : bool (default = True)
|
|
|
Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
cleanEnable : bool (default = True)
|
|
|
Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
preloadToggle : bool (default = True)
|
|
|
Toggle for using RTIS CUDA preloading
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
Examples
|
|
|
Create settings from a premade setup with all processing steps on. You can get the available premade settings with get_premade_recording_settings_list().
|
|
|
Load in manually generated call. This requires the file to exist on the path and have the right format.
|
|
|
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(callCustom="mycall.csv")
|
|
|
```
|
|
|
|
|
|
## **set_processing_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2405">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the processing settings. All parameters are optional and most have default values.
|
|
|
Please read their decription carefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>premade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_processing_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>jsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument. See the examples for more information.
|
|
|
</p>
|
|
|
<b>customPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located. See the examples for more information.
|
|
|
</p>
|
|
|
<b>microphoneLayout : <i>String (default = eRTIS_v3D1)</i></b>
|
|
|
<p class="attr">
|
|
|
Identifier of the microphone layout used for this configuration.
|
|
|
</p>
|
|
|
<b>mode : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal plane layout will be generated. When set to 0 a 3D equal distance layout will be generated for the frontal hemisphere of the sensor.
|
|
|
</p>
|
|
|
<b>directions : <i>int (default = 181)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines how many directions the layout should generate.
|
|
|
</p>
|
|
|
<b>minRange : <i>float (default = 0.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>maxRange : <i>float (default = 5)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
|
|
|
<p class="attr">
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
</p>
|
|
|
<b>pdmEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>matchedFilterEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>beamformingEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>enveloppeEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>cleanEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>preloadToggle : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for using RTIS CUDA preloading
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup with all processing steps on.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True,
|
|
|
beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=True)
|
|
|
```
|
|
|
|
|
|
You don't have to define all the processing steps, as they are all on by default.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000")
|
|
|
Create settings from a premade setup with only part of the processing steps enabled and no preloading. You can get the available premade settings with get_premade_recording_settings_list().
|
|
|
```
|
|
|
|
|
|
Create settings from a premade setup with only part of the processing steps enabled and no preloading.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list).
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181", pdmEnable=True, matchedFilterEnable=True,
|
|
|
beamformingEnable=False, enveloppeEnable=False, cleanEnable=False)
|
|
|
Create settings from a json file with full processing settings on. This expects a json to be available with a format such as seen below. Here we use auto-generated processing files.
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated processing files.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
... | ... | @@ -409,9 +767,19 @@ Create settings from a json file with full processing settings on. This expects |
|
|
"directions": 181,
|
|
|
"2D": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
Create settings from a json file with full processing settings on. This expects a json to be available with a format such as seen below. Here we use manually generated processing files. They have to be available on these paths and have the right format. An example of such custom processing files can be found here.
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated processing files.
|
|
|
They have to be available on these paths and have the right format.
|
|
|
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/).
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
... | ... | @@ -419,177 +787,393 @@ Create settings from a json file with full processing settings on. This expects |
|
|
"delayMatrixCustom": ".premade/delaymatrix.csv",
|
|
|
"rangesCustom": ".premade/ranges.csv"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(mode = 0, directions = 1337, minRange = 0.5, maxRange = 10)
|
|
|
Load in manually generated processing files. This requires 3 files to exist in the given path: delaymatrix.csv, directions.csv and ranges.csv. An example of such custom processing files can be found here.
|
|
|
|
|
|
rtisdev.set_processing_settings(customPath="mysettingsfolder")
|
|
|
get_current_settings
|
|
|
def get_current_settings() [source]
|
|
|
|
|
|
Returns the RTISSettings object of the current settings for processing and recording.
|
|
|
```
|
|
|
|
|
|
Returns: settings : RTISSettings
|
|
|
The complete class containing all RTIS settings for recording and processing. Returns 'None' or will raise an exception on failure.
|
|
|
Load in manually generated processing files. This requires 3 files to exist in the given path:
|
|
|
delaymatrix.csv, directions.csv and ranges.csv.
|
|
|
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/).
|
|
|
|
|
|
clear_current_settings
|
|
|
def clear_current_settings() [source]
|
|
|
|
|
|
Clear the current applied RTISSettings configuration.
|
|
|
|
|
|
get_settings
|
|
|
def get_settings(recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str='') [source]
|
|
|
|
|
|
Returns an RTISSettings object with all chosen recording and processing settings based on the given arguments. It will not set these settings to the RTIS Device or activate processing. It only creates the settings object. For examples of what some of these settings do and how to use them, please see the set_recording_settings() and set_processing_settings() examples.
|
|
|
|
|
|
Parameters: recordingPremade : String (default = Not used)
|
|
|
When using get_premade_recording_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
|
|
|
recordingJsonPath : String (default = Not used)
|
|
|
One can also store the recording settings in a json file. To load the recording settings from a json file, please use the absolute path to this json file with this argument.
|
|
|
|
|
|
recordingCallCustom : String (default = Not used)
|
|
|
One can use a custom call pulse to emmit from the RTIS Device in active mode. To load the custom pulse, use the absolute path to the csv file with this argument.
|
|
|
|
|
|
processingPremade : String (default = Not used)
|
|
|
When using get_premade_processing_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
|
|
|
processingJsonPath : String (default = Not used)
|
|
|
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument.
|
|
|
|
|
|
processingCustomPath : String (default = Not used)
|
|
|
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located.
|
|
|
|
|
|
microphoneSamples : int (default = 163840)
|
|
|
The amount of microphone samples. Must be dividable by 32768.
|
|
|
|
|
|
microphoneSampleFrequency : int (default = 4500000)
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
|
|
|
callSampleFrequency : int (default = 450000)
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
|
|
|
callDuration : float (default = 2.5)
|
|
|
The duration in miliseconds of the call.
|
|
|
|
|
|
callMinimumFrequency : int (default = 25000)
|
|
|
The minimum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
|
|
|
callMaximumFrequency : int (default = 50000)
|
|
|
The maximum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
|
|
|
callEmissions : int (default = 1)
|
|
|
The amount of times the pulse should be emitted during one measurement.
|
|
|
|
|
|
microphoneLayout : String (default = eRTIS_v3D1)
|
|
|
Identifier of the microphone layout used for this configuration.
|
|
|
|
|
|
mode : int (default = 1)
|
|
|
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal plane layout will be generated. When set to 0 a 3D equal distance layout will be generated for the frontal hemisphere of the sensor.
|
|
|
|
|
|
directions : int (default = 181)
|
|
|
Defines how many directions the layout should generate.
|
|
|
|
|
|
minRange : float (default = 0.5)
|
|
|
The minimum distance in meters of the energyscape to generate.
|
|
|
|
|
|
maxRange : float (default = 5)
|
|
|
The maximum distance in meters of the energyscape to generate.
|
|
|
|
|
|
pdmEnable : bool (default = True)
|
|
|
Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
matchedFilterEnable : bool (default = True)
|
|
|
Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
beamformingEnable : bool (default = True)
|
|
|
Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
enveloppeEnable : bool (default = True)
|
|
|
Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
cleanEnable : bool (default = True)
|
|
|
Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
|
|
|
preloadToggle : bool (default = True)
|
|
|
Toggle for using RTIS CUDA preloading
|
|
|
|
|
|
configName : String (default = "")
|
|
|
String to identify these settings with. If set to empty (as it is by default), it will become the name set for recordingPremade. If no premade recording settings are used it will default to RTISSettings.
|
|
|
|
|
|
Returns: settings : RTISSettings
|
|
|
The complete class containing all RTIS settings for recording and processing. Returns 'None' or will raise an exception on failure.
|
|
|
|
|
|
set_settings_from_class
|
|
|
def set_settings_from_class(settings: RTISSettings, applyToDevice: bool=True ) [source]
|
|
|
|
|
|
Set the wanted settings from an RTISSettings object. These can be created with the get_settings() or get_current_settings() methods.
|
|
|
|
|
|
Parameters: settings : RTISSettings
|
|
|
The complete class containing all RTIS settings for recording and processing that needs to be set.
|
|
|
|
|
|
applyToDevice : bool (default = True)
|
|
|
A configuration toggle to optionally disable applying the recording settings to the RTIS Device.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
get_premade_processing_settings_list
|
|
|
def get_premade_processing_settings_list() [source]
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(customPath="mysettingsfolder")
|
|
|
```
|
|
|
|
|
|
## **get_current_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2618">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for recording and processing. Returns 'None' or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **clear_current_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2635">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_settings**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_settings</b>(<i>recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2644">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Returns an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object with all chosen recording and processing settings based on the
|
|
|
given arguments. It will not set these settings to the RTIS Device or activate processing. It only creates
|
|
|
the settings object. For examples of what some of these settings do and how to use them, please see
|
|
|
the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#set_recording_settings) and [`set_processing_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#set_processing_settings) examples.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>recordingPremade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_recording_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>recordingJsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the recording settings in a json file. To load the recording settings from a json file, please use the absolute path to this json file with this argument.
|
|
|
</p>
|
|
|
<b>recordingCallCustom : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom call pulse to emmit from the RTIS Device in active mode. To load the custom pulse, use the absolute path to the csv file with this argument.
|
|
|
</p>
|
|
|
<b>processingPremade : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
When using get_premade_processing_settings() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
|
|
|
</p>
|
|
|
<b>processingJsonPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument.
|
|
|
</p>
|
|
|
<b>processingCustomPath : <i>String (default = Not used)</i></b>
|
|
|
<p class="attr">
|
|
|
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located.
|
|
|
</p>
|
|
|
<b>microphoneSamples : <i>int (default = 163840)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of microphone samples. Must be dividable by 32768.
|
|
|
</p>
|
|
|
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
|
|
|
<p class="attr">
|
|
|
The microphone sample frequency (without subsampling of PDM). The frequency must be 4.5 MHz(ultrasound) or 1.125 MHz(audible) depending on the wanted mode.
|
|
|
</p>
|
|
|
<b>callSampleFrequency : <i>int (default = 450000)</i></b>
|
|
|
<p class="attr">
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
</p>
|
|
|
<b>callDuration : <i>float (default = 2.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The duration in miliseconds of the call.
|
|
|
</p>
|
|
|
<b>callMinimumFrequency : <i>int (default = 25000)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callMaximumFrequency : <i>int (default = 50000)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum frequency in Hz of the call sweep used for generating the pulse.
|
|
|
</p>
|
|
|
<b>callEmissions : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of times the pulse should be emitted during one measurement.
|
|
|
</p>
|
|
|
<b>microphoneLayout : <i>String (default = eRTIS_v3D1)</i></b>
|
|
|
<p class="attr">
|
|
|
Identifier of the microphone layout used for this configuration.
|
|
|
</p>
|
|
|
<b>mode : <i>int (default = 1)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal plane layout will be generated. When set to 0 a 3D equal distance layout will be generated for the frontal hemisphere of the sensor.
|
|
|
</p>
|
|
|
<b>directions : <i>int (default = 181)</i></b>
|
|
|
<p class="attr">
|
|
|
Defines how many directions the layout should generate.
|
|
|
</p>
|
|
|
<b>minRange : <i>float (default = 0.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The minimum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>maxRange : <i>float (default = 5)</i></b>
|
|
|
<p class="attr">
|
|
|
The maximum distance in meters of the energyscape to generate.
|
|
|
</p>
|
|
|
<b>pdmEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>matchedFilterEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>beamformingEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>enveloppeEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>cleanEnable : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
|
|
|
</p>
|
|
|
<b>preloadToggle : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
Toggle for using RTIS CUDA preloading
|
|
|
</p>
|
|
|
<b>configName : <i>String (default = "")</i></b>
|
|
|
<p class="attr">
|
|
|
String to identify these settings with. If set to empty (as it is by default), it will become the name set for recordingPremade. If no premade recording settings are used it will default to <em>RTISSettings</em>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for recording and processing. Returns 'None' or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_settings_from_class**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_settings_from_class</b>(<i>settings: RTISSettings, applyToDevice: bool=True </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2845">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the wanted settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object. These can be created
|
|
|
with the [`get_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_settings) or [`get_current_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_current_settings) methods.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for recording and processing that needs to be set.
|
|
|
</p>
|
|
|
<b>applyToDevice : <i>bool (default = True)</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to optionally disable applying the recording settings to the RTIS Device.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_premade_processing_settings_list**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_premade_processing_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2879">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get a list of names of all the available premade settings for processing.
|
|
|
|
|
|
Returns: recordingSettings : list[str]
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>recordingSettings : <i>list[str]</i></b>
|
|
|
<p class="attr">
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
get_premade_recording_settings_list
|
|
|
def get_premade_recording_settings_list() [source]
|
|
|
|
|
|
Get a list of names of all the available premade settings for recording.
|
|
|
|
|
|
Returns: recordingSettings : list[str]
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
|
|
|
get_microphone_layout_list
|
|
|
def get_microphone_layout_list() [source]
|
|
|
## **get_premade_recording_settings_list**
|
|
|
|
|
|
Get a list of names of all the available microphone layouts that are available for recording.
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_premade_recording_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2894">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Returns: microphoneLayouts : list[str]
|
|
|
A list holding all the names of available microphone layouts that can be loaded.
|
|
|
|
|
|
prepare_processing
|
|
|
def prepare_processing() [source]
|
|
|
|
|
|
Start the CUDA workers for looped measurements with processing enabled. It is not required to run this method for doing processing but it will speed up the workflow significantly if doing many processed measurements at a high frequency. Furthermore, if using the default settings for processing this is enabled already.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
Get a list of names of all the available premade settings for recording.
|
|
|
|
|
|
unload_processing
|
|
|
def unload_processing() [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>recordingSettings : <i>list[str]</i></b>
|
|
|
<p class="attr">
|
|
|
A list holding all the names of available settings that can be loaded.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
Stop all CUDA workers. Only required if actually using preloading of CUDA workers. CUDA workers are also automatically stopped when your script ends.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
get_raw_measurement
|
|
|
def get_raw_measurement(behaviour: bool=False) [source]
|
|
|
## **get_microphone_layout_list**
|
|
|
|
|
|
Start an RTIS sonar measurement and return the raw data in an RTISMeasurement object. This means that it will only record and not perform any processing.
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_microphone_layout_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2908">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Parameters: behaviour : bool
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
Get a list of names of all the available microphone layouts that are available for recording.
|
|
|
|
|
|
Returns: measurement : RTISMeasurement
|
|
|
The data class holding the raw measurement of the RTIS device with the raw binary data under measurement.rawData.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>microphoneLayouts : <i>list[str]</i></b>
|
|
|
<p class="attr">
|
|
|
A list holding all the names of available microphone layouts that can be loaded.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **prepare_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2922">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start the CUDA workers for looped measurements with processing enabled.
|
|
|
It is not required to run this method for doing processing but it will speed up the workflow
|
|
|
significantly if doing many processed measurements at a high frequency.
|
|
|
Furthermore, if using the default settings for processing this is enabled already.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **unload_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2949">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop all CUDA workers.
|
|
|
Only required if actually using preloading of CUDA workers. CUDA workers are also automatically
|
|
|
stopped when your script ends.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_raw_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2964">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start an RTIS sonar measurement and return the raw data in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
|
|
|
This means that it will only record and not perform any processing.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the raw measurement of the RTIS device with the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Examples
|
|
|
Create a connection, set recording settings and make a raw measurement with passive behaviour.
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
... | ... | @@ -597,60 +1181,132 @@ rtisdev.set_processing_settings(premade="2D_5m_181") |
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
get_signal_measurement
|
|
|
def get_signal_measurement(behaviour: bool=False) [source]
|
|
|
```
|
|
|
|
|
|
## **get_signal_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3001">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start an RTIS sonar measurement and process it with only PDM filtering
|
|
|
and subsampling enabled to get the microphone signals returned in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
|
|
|
This means it will overwrite the enabled and disabled processing steps that the user might
|
|
|
have set. But will still use the other chosen recording and processing settings.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the signal measurement of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Start an RTIS sonar measurement and process it with only PDM filtering and subsampling enabled to get the microphone signals returned in an RTISMeasurement object. This means it will overwrite the enabled and disabled processing steps that the user might have set. But will still use the other chosen recording and processing settings.
|
|
|
|
|
|
Parameters: behaviour : bool
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
|
|
|
Returns: measurement : RTISMeasurement
|
|
|
The data class holding the signal measurement of the RTIS device under measurement.processedData and the raw binary data under measurement.rawData.
|
|
|
|
|
|
Examples
|
|
|
Create a connection, set recording and processing settings and make a signal measurement with active behaviour.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
get_processed_measurement
|
|
|
def get_processed_measurement(behaviour: bool=False) [source]
|
|
|
|
|
|
Start an RTIS sonar measurement and process it and return the raw and processed data in an RTISMeasurement object. This will use the chosen recording and processing settings.
|
|
|
|
|
|
Parameters: behaviour : bool
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
|
|
|
Returns: measurement : RTISMeasurement
|
|
|
The data class holding the processed measurement (the microphone signals) of the RTIS device under measurement.processedData and the raw binary data under measurement.rawData.
|
|
|
```
|
|
|
|
|
|
## **get_processed_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3043">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start an RTIS sonar measurement and process it and return the raw and processed data
|
|
|
in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object. This will use the chosen recording and processing settings.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>behaviour : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
A configuration toggle to set the required sonar behaviour (active or passive).
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the processed measurement (the microphone signals) of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Examples
|
|
|
Create a connection, set recording and processing settings and make a processed measurement with active behaviour.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
process_measurement
|
|
|
def process_measurement(measurement: RTISMeasurement) [source]
|
|
|
|
|
|
Process a previously recorded raw RTIS sonar measurement from a RTISMeasurement object and return same measurement with processed data in a new RTISMeasurement object.
|
|
|
|
|
|
Parameters: measurement : RTISMeasurement
|
|
|
The data class holding the raw measurement of the RTIS device.
|
|
|
|
|
|
Returns: measurement : RTISMeasurement object
|
|
|
The data class holding the processed measurement of the RTIS device under measurement.processedData and the raw binary data under measurement.rawData.
|
|
|
|
|
|
Examples
|
|
|
Create a connection, set recording and processing settings and make a raw measurement with active behaviour. Then afterwards process it.
|
|
|
|
|
|
```
|
|
|
|
|
|
## **process_measurement**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3084">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
|
|
|
and return same measurement with processed data in a new [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the raw measurement of the RTIS device.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement object</i></b>
|
|
|
<p class="attr">
|
|
|
The data class holding the processed measurement of the RTIS device under <code>measurement.processedData</code> and the raw binary data under <code>measurement.rawData</code>.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a raw measurement with active behaviour.
|
|
|
Then afterwards process it.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
... | ... | @@ -658,50 +1314,132 @@ rtisdev.set_recording_settings(premade="default_25_50") |
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
set_counter
|
|
|
def set_counter(newCount: int=0) [source]
|
|
|
```
|
|
|
|
|
|
Set the internal measurement counter of the sonar hardware.
|
|
|
|
|
|
Parameters: newCount : int (default = 0)
|
|
|
The new count index to set.
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
## **set_counter**
|
|
|
|
|
|
set_behaviour
|
|
|
def set_behaviour(mode: bool) [source]
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_counter</b>(<i>newCount: int=0</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3125">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external measurement triggers. As using the normal RTIS Dev functions of get_raw_measurement(behaviour), get_signal_measurement(behaviour) and get_processed_measurement(behaviour) will use the given function argument to define the sonar behaviour.
|
|
|
|
|
|
Parameters: mode : bool
|
|
|
the behaviour mode chosen. False = passive True = active
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
Set the internal measurement counter of the sonar hardware.
|
|
|
|
|
|
get_firmware_version
|
|
|
def get_firmware_version() [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>newCount : <i>int (default = 0)</i></b>
|
|
|
<p class="attr">
|
|
|
The new count index to set.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_behaviour**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_behaviour</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3148">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
|
|
|
measurement triggers. As using the normal RTIS Dev functions of [`get_raw_measurement(behaviour)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_raw_measurement),
|
|
|
[`get_signal_measurement(behaviour)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_signal_measurement) and [`get_processed_measurement(behaviour)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_processed_measurement) will use the given function
|
|
|
argument to define the sonar behaviour.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the behaviour mode chosen. False = passive True = active
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **get_firmware_version**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_firmware_version</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3173">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get the firmware version of the internal RTIS firmware used on the device.
|
|
|
|
|
|
Returns: firmwareVersion : string
|
|
|
returns the firmware version as a string in 'vMajor.Minor.Bugfix' format. Returns 'undefined' or will raise an exception on failure.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>firmwareVersion : <i>string</i></b>
|
|
|
<p class="attr">
|
|
|
returns the firmware version as a string in 'vMajor.Minor.Bugfix' format. Returns 'undefined' or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **create_measure_external_trigger_queue**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3188">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
|
|
the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>dataQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
On this queue the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects will be put after an external trigger starts a new measurement.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerQueueThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Thread super class that can then be started with '.start()' and waited for with <code>.join()</code> for example. It can be closed gracefully with the '.stop_thread()' function. This will also be done automatically when <code>signal.SIGINT</code> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
create_measure_external_trigger_queue
|
|
|
def create_measure_external_trigger_queue(dataQueue: Queue ) [source]
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
|
|
|
Parameters: dataQueue : multiprocessing.Manager.Queue
|
|
|
On this queue the RTISMeasurement objects will be put after an external trigger starts a new measurement.
|
|
|
|
|
|
Returns: th : MeasureExternalTriggerQueueThread
|
|
|
Class instance of the Thread super class that can then be started with '.start()' and waited for with .join() for example. It can be closed gracefully with the '.stop_thread()' function. This will also be done automatically when signal.SIGINT (ex. CTRL+C) is triggered.
|
|
|
|
|
|
Examples
|
|
|
Create a queue to save the measurement to and assign it to the thread.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Manager
|
|
|
import rtisdev
|
|
|
|
... | ... | @@ -715,20 +1453,43 @@ dataQueue = manager.Queue() |
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
create_measure_external_trigger_callback
|
|
|
def create_measure_external_trigger_callback(callback: Callable[[ RTISMeasurement], any]) [source]
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
```
|
|
|
|
|
|
## **create_measure_external_trigger_callback**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3231">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Thread that will be waiting for an external trigger to measure from
|
|
|
the RTIS Device and afterwards put this measurement on a data queue.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>callback : <i>method with one argument of type RTISMeasurement</i></b>
|
|
|
<p class="attr">
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> object containing the measurement data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerCallbackThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Thread super class that can then be started with <code>.start()</code> and waited for with <code>.join()</code> for example. It can be closed gracefully with the <code>.stop_thread()</code> function. This will also be done automatically when <em>signal.SIGINT</em> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Parameters: callback : method with one argument of type RTISMeasurement
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the RTISMeasurement object containing the measurement data.
|
|
|
|
|
|
Returns: th : MeasureExternalTriggerCallbackThread
|
|
|
Class instance of the Thread super class that can then be started with .start() and waited for with .join() for example. It can be closed gracefully with the .stop_thread() function. This will also be done automatically when signal.SIGINT (ex. CTRL+C) is triggered.
|
|
|
|
|
|
Examples
|
|
|
Create a callback to save the measurement to disk.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
... | ... | @@ -749,28 +1510,58 @@ def save_callback(measurement=None): |
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
create_processing_workers
|
|
|
def create_processing_workers(workerCount: int, inputQueue: Queue, outputQueue: Queue) [source]
|
|
|
|
|
|
This will create and return a Multiprocessing Pool that will generating a chosen amount of processing workers to handle incoming RTISMeasurement objects on the input Multiprocessing Queue and after processing place them on the output Multiprocessing Queue.
|
|
|
|
|
|
Please set the preloadToggle argument to False when using set_processing_settings() and/or make sure to not use set_processing_settings() before this point as it will cause an error or result in a potential crash of RTIS Dev!
|
|
|
|
|
|
Parameters: workerCount : int
|
|
|
The amount of worker processes to create and keep active in the Pool.
|
|
|
|
|
|
inputQueue : multiprocessing.Manager.Queue
|
|
|
This is the data queue that will be used to receive the recorded RTISMeasurement objects on.
|
|
|
|
|
|
outputQueue : multiprocessing.Manager.Queue
|
|
|
This is the data queue that will be used to store the processed RTISMeasurement objects on.
|
|
|
|
|
|
Returns: workersPool : multiprocessing.Pool
|
|
|
Class instance of the Pool super class. It can be closed gracefully with the .terminate() function. This will also be done automatically when signal.SIGINT (ex. CTRL+C) is triggered. The workers will be automatically started when calling this function.
|
|
|
|
|
|
Examples
|
|
|
Create the data queues, setup the worker pool with 4 workers, generate some measurements and afterwards parse all these measurements by getting them from the output queue. Once the work is done, terminate the workers gracefully.
|
|
|
|
|
|
```
|
|
|
|
|
|
## **create_processing_workers**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3284">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Multiprocessing Pool that will generating a chosen amount of processing
|
|
|
workers to handle incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on the input Multiprocessing Queue
|
|
|
and after processing place them on the output Multiprocessing Queue.
|
|
|
|
|
|
Please set the `preloadToggle` argument to `False` when using [`set_processing_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#set_processing_settings)
|
|
|
and/or make sure to not use [`set_processing_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#prepare_processing) before this point as it will cause an error or result in a
|
|
|
potential crash of RTIS Dev!
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>workerCount : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The amount of worker processes to create and keep active in the Pool.
|
|
|
</p>
|
|
|
<b>inputQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
This is the data queue that will be used to receive the recorded <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
|
|
|
</p>
|
|
|
<b>outputQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
This is the data queue that will be used to store the processed <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>workersPool : <i>multiprocessing.Pool</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Pool super class. It can be closed gracefully with the <code>.terminate()</code> function. This will also be done automatically when <em>signal.SIGINT</em> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered. The workers will be automatically started when calling this function.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create the data queues, setup the worker pool with 4 workers, generate some measurements and afterwards parse
|
|
|
all these measurements by getting them from the output queue.
|
|
|
Once the work is done, terminate the workers gracefully.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Manager
|
|
|
import rtisdev
|
|
|
|
... | ... | @@ -792,51 +1583,146 @@ for measurement_index in range(0, 30): |
|
|
measurement = outputQueue.get()
|
|
|
|
|
|
workersPool.terminate()
|
|
|
toggle_amplifier
|
|
|
def toggle_amplifier(mode: bool) [source]
|
|
|
|
|
|
Enable/disable the high voltage amplifier's step up controller. It is enabled by default so has to be manually disabled if wanted. This will save on power usage and heat production.
|
|
|
|
|
|
Parameters: mode : bool
|
|
|
the amplifier mode chosen. False = disable True = enable
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
toggle_external_triggers
|
|
|
def toggle_external_triggers(mode: bool) [source]
|
|
|
|
|
|
Enable/disable external triggers being able to start a measurement on the RTIS device. They are disabled by default so have to be manually enabled.
|
|
|
|
|
|
Parameters: mode : bool
|
|
|
the external trigger mode chosen. False = disable True = enable
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
|
|
|
reset_device
|
|
|
def reset_device(stm32pin: int=7) [source]
|
|
|
```
|
|
|
|
|
|
## **toggle_amplifier**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_amplifier</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3357">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable the high voltage amplifier's step up controller.
|
|
|
It is enabled by default so has to be manually disabled if wanted. This will save on power usage and heat production.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the amplifier mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **toggle_external_triggers**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3380">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable external triggers being able to start a measurement on the RTIS device.
|
|
|
They are disabled by default so have to be manually enabled.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the external trigger mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **reset_device**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>reset_device</b>(<i>stm32pin: int=7</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3403">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to reset the RTIS device hardware.
|
|
|
|
|
|
Parameters: stm32pin : Integer (default = 7)
|
|
|
Change the GPIO pin used for the STM32 connection. Please ask a CoSys-Lab member for the correct pin number if not working as intended with the default value.
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>stm32pin : <i>Integer (default = 7)</i></b>
|
|
|
<p class="attr">
|
|
|
Change the GPIO pin used for the STM32 connection. Please ask a CoSys-Lab member for the correct pin number if not working as intended with the default value.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>success : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
returns <code>True</code> on successful completion, returns <code>False</code> or will raise an exception on failure.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **set_log_mode**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_log_mode</b>(<i>mode: int</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3451">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Returns: success : bool
|
|
|
returns True on successful completion, returns False or will raise an exception on failure.
|
|
|
The function to set the logging level of the RTIS Dev module.
|
|
|
|
|
|
set_log_mode
|
|
|
def set_log_mode(mode: int) [source]
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
Disable or configure log the level. 0 = off 1 = only warnings and errors 2(default) = includes info 3 = includes debug
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
The function to set the logging level of the RTIS Dev module.
|
|
|
|
|
|
Parameters: mode : int
|
|
|
Disable or configure log the level. 0 = off 1 = only warnings and errors 2(default) = includes info 3 = includes debug
|
|
|
|
|
|
set_custom_logger
|
|
|
def set_custom_logger(customLogger: logging.Logger) [source]
|
|
|
## **set_custom_logger**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>set_custom_logger</b>(<i>customLogger: logging.Logger</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3482">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set a custom logger to be used by RTIS Dev.
|
|
|
|
|
|
Parameters: customLogger : logging.Logger
|
|
|
The custom logger to be used by RTIS Dev. |
|
|
\ No newline at end of file |
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>customLogger : <i>logging.Logger</i></b>
|
|
|
<p class="attr">
|
|
|
The custom logger to be used by RTIS Dev.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|