Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • RTIS Dev RTIS Dev
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • RTIS Software
  • RTIS DevRTIS Dev
  • Wiki
  • Home

Home · Changes

Page history
Update home authored Feb 09, 2022 by Wouter Jansen's avatar Wouter Jansen
Show whitespace changes
Inline Side-by-side
home.md
View page @ 7d0a8260
# **RTIS Dev Documentation - Table of Content** RTIS Dev Documentation - Table of Content
General Example
- [General Example](#general-example) Classes
- [Classes](#classes) RTISMeasurement
- [RTISMeasurement](#rtismeasurement) RTISSettings
- [RTISSettings](#rtissettings) MeasureExternalTriggerQueueThread
- [MeasureExternalTriggerQueueThread](#measureexternaltriggerqueuethread) MeasureExternalTriggerCallbackThread
- [MeasureExternalTriggerCallbackThread](#measureexternaltriggercallbackthread) Methods
- [Methods](#methods) open_connection
- [open_connection](#open_connection) close_connection
- [close_connection](#close_connection) set_recording_settings
- [set_recording_settings](#set_recording_settings) set_processing_settings
- [set_processing_settings](#set_processing_settings) get_current_settings
- [get_current_settings](#get_current_settings) clear_current_settings
- [clear_current_settings](#clear_current_settings) get_settings
- [get_settings](#get_settings) set_settings_from_class
- [set_settings_from_class](#set_settings_from_class) get_premade_processing_settings_list
- [get_premade_processing_settings_list](#get_premade_processing_settings_list) get_premade_recording_settings_list
- [get_premade_recording_settings_list](#get_premade_recording_settings_list) get_microphone_layout_list
- [get_microphone_layout_list](#get_microphone_layout_list) prepare_processing
- [prepare_processing](#prepare_processing) unload_processing
- [unload_processing](#unload_processing) get_raw_measurement
- [get_raw_measurement](#get_raw_measurement) get_signal_measurement
- [get_signal_measurement](#get_signal_measurement) get_processed_measurement
- [get_processed_measurement](#get_processed_measurement) process_measurement
- [process_measurement](#process_measurement) set_counter
- [set_counter](#set_counter) set_behaviour
- [set_behaviour](#set_behaviour) get_firmware_version
- [get_firmware_version](#get_firmware_version) create_measure_external_trigger_queue
- [create_measure_external_trigger_queue](#create_measure_external_trigger_queue) create_measure_external_trigger_callback
- [create_measure_external_trigger_callback](#create_measure_external_trigger_callback) create_processing_workers
- [create_processing_workers](#create_processing_workers) toggle_amplifier
- [toggle_amplifier](#toggle_amplifier) toggle_external_triggers
- [toggle_external_triggers](#toggle_external_triggers) reset_device
- [reset_device](#reset_device) set_log_mode
- [set_log_mode](#set_log_mode) set_custom_logger
- [set_custom_logger](#set_custom_logger) General Example
# **General Example**
Here is a small example that goes over most basic steps: Here is a small example that goes over most basic steps:
```python
import rtisdev import rtisdev
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
...@@ -110,123 +106,53 @@ for microphone_index_i in range(0, 8): ...@@ -110,123 +106,53 @@ for microphone_index_i in range(0, 8):
axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude") axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
plt.show() plt.show()
fig.suptitle("RTIS Dev - Microphone Signals") 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]
# **Classes** Class storing all data and information on an RTIS device measurement.
## **RTISMeasurement** Attributes: id : string
The unique identifier to identify this RTIS Client by.
<p class="func-header"> timestamp : float
<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> The epoch timestamp of the measurement.
</p>
Class storing all data and information on an RTIS device 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.
RTISSettings
class RTISSettings(firmwareVersion, configName='') [source]
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"> MeasureExternalTriggerQueueThread
<col class="field-name" /> class MeasureExternalTriggerQueueThread(*args, **kwargs) [source]
<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
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.
Use create_measure_external_trigger_queue(dataQueue) to make an easy to use the class.
Examples
Create a queue to save the measurement to and assign it to the thread. Create a queue to save the measurement to and assign it to the thread.
```python
from multiprocessing import Manager from multiprocessing import Manager
import rtisdev import rtisdev
...@@ -240,111 +166,36 @@ dataQueue = manager.Queue() ...@@ -240,111 +166,36 @@ dataQueue = manager.Queue()
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue) measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
measure_thread.start() measure_thread.start()
measure_thread.join() 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`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on. Set the dataQueue to be used by the Thread to store the incoming RTISMeasurement objects on.
<table class="docutils field-list field-table" frame="void" rules="none"> Parameters: dataQueue : multiprocessing.Manager.Queue
<col class="field-name" /> This is the data queue that will be used to store the RTISMeasurement objects on.
<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. Stop the measurement thread gracefully.
<table class="docutils field-list field-table" frame="void" rules="none"> stopped(self) [source]
<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. Get status of the thread if it should be stopped or not.
<table class="docutils field-list field-table" frame="void" rules="none"> run(self) [source]
<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.
<table class="docutils field-list field-table" frame="void" rules="none"> MeasureExternalTriggerCallbackThread
<col class="field-name" /> class MeasureExternalTriggerCallbackThread(*args, **kwargs) [source]
<col class="field-body" />
<tbody valign="top">
</table> 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.
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. Create a callback to save the measurement to disk.
```python
import rtisdev import rtisdev
rtisdev.open_connection() rtisdev.open_connection()
...@@ -365,236 +216,97 @@ def save_callback(measurement=None): ...@@ -365,236 +216,97 @@ def save_callback(measurement=None):
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback) measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
measure_thread.start() measure_thread.start()
measure_thread.join() measure_thread.join()
``` Methods
set_callback(self, callback) [source]
#### Methods
<p class="func-header"> Parameters: callback : method with one argument (RTISMeasurement)
<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> 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.
</p>
<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>
stop_thread(self) [source]
Stop the measurement thread gracefully.
stopped(self) [source]
Get status of the thread if it should be stopped or not.
<p class="func-header"> run(self) [source]
<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>
Stop the measurement thread gracefully. Main thread function to run continuously. Should not be used. Use start() instead.
<table class="docutils field-list field-table" frame="void" rules="none"> Methods
<col class="field-name" /> open_connection
<col class="field-body" /> def open_connection(port: string='/dev/ttyACM0', allowDebugMode: bool=False ) [source]
<tbody valign="top">
</table> 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.
close_connection
def close_connection() [source]
<p class="func-header"> Manually close the connection to the RTIS device. Normally, when your script ends without exceptions the connection will automatically be closed gracefully.
<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. Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
<table class="docutils field-list field-table" frame="void" rules="none"> set_recording_settings
<col class="field-name" /> 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]
<col class="field-body" />
<tbody valign="top">
</table> 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.
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.
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.
<p class="func-header"> microphoneSampleFrequency : int (default = 4500000)
<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> 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>
Main thread function to run continuously. Should not be used. Use `start()` instead. callSampleFrequency : int (default = 450000)
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
<table class="docutils field-list field-table" frame="void" rules="none"> callDuration : float (default = 2.5)
<col class="field-name" /> The duration in miliseconds of the call.
<col class="field-body" />
<tbody valign="top">
</table> 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.
# **Methods** 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.
## **open_connection** applyToDevice : bool (default = True)
A configuration toggle to optionally disable applying the recording settings to the RTIS Device.
<p class="func-header"> Returns: success : bool
<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> returns True on successful completion, returns False or will raise an exception on failure.
</p>
Connect to the port of the RTIS Hardware. Examples
Create settings from a premade setup. You can get the available premade settings with get_premade_recording_settings_list().
<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") 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, "microphoneSamples" : 294912,
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
...@@ -604,19 +316,9 @@ Here we use auto-generated pulse call to emit. ...@@ -604,19 +316,9 @@ Here we use auto-generated pulse call to emit.
"callMaximumFrequency" : 50000, "callMaximumFrequency" : 50000,
"callEmissions": 1 "callEmissions": 1
} }
```
```python
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json") 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, "microphoneSamples" : 16777216,
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
...@@ -624,141 +326,81 @@ An example of such a custom call can be found [here](https://cosysgit.uantwerpen ...@@ -624,141 +326,81 @@ An example of such a custom call can be found [here](https://cosysgit.uantwerpen
"callCustom": "mycall.csv", "callCustom": "mycall.csv",
"callEmissions": 1 "callEmissions": 1
} }
```
```python
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json") 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. 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, rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000,
callMaximumFrequency=80000) 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.
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") 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_processing_settings**
Set the processing settings. All parameters are optional and most have default values. Please read their decription carefully.
<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> Parameters: premade : String (default = Not used)
</p> 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.
Set the processing settings. All parameters are optional and most have default values. jsonPath : String (default = Not used)
Please read their decription carefully. 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.
<table class="docutils field-list field-table" frame="void" rules="none"> customPath : String (default = Not used)
<col class="field-name" /> 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.
<col class="field-body" />
<tbody valign="top"> microphoneLayout : String (default = eRTIS_v3D1)
<tr class="field"> Identifier of the microphone layout used for this configuration.
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>premade : <i>String (default = Not used)</i></b> mode : int (default = 1)
<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.
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> directions : int (default = 181)
<b>jsonPath : <i>String (default = Not used)</i></b> Defines how many directions the layout should generate.
<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. minRange : float (default = 0.5)
</p> The minimum distance in meters of the energyscape to generate.
<b>customPath : <i>String (default = Not used)</i></b>
<p class="attr"> maxRange : float (default = 5)
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. The maximum distance in meters of the energyscape to generate.
</p>
<b>microphoneLayout : <i>String (default = eRTIS_v3D1)</i></b> microphoneSampleFrequency : int (default = 4500000)
<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.
Identifier of the microphone layout used for this configuration.
</p> pdmEnable : bool (default = True)
<b>mode : <i>int (default = 1)</i></b> Toggle for PDM filtering part of the RTIS processing pipeline using RTIS CUDA.
<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. matchedFilterEnable : bool (default = True)
</p> Toggle for matched filter part of the RTIS processing pipeline using RTIS CUDA.
<b>directions : <i>int (default = 181)</i></b>
<p class="attr"> beamformingEnable : bool (default = True)
Defines how many directions the layout should generate. Toggle for beamforming part of the RTIS processing pipeline using RTIS CUDA.
</p>
<b>minRange : <i>float (default = 0.5)</i></b> enveloppeEnable : bool (default = True)
<p class="attr"> Toggle for enveloppe part of the RTIS processing pipeline using RTIS CUDA.
The minimum distance in meters of the energyscape to generate.
</p> cleanEnable : bool (default = True)
<b>maxRange : <i>float (default = 5)</i></b> Toggle for cleaning part of the RTIS processing pipeline using RTIS CUDA.
<p class="attr">
The maximum distance in meters of the energyscape to generate. preloadToggle : bool (default = True)
</p> Toggle for using RTIS CUDA preloading
<b>microphoneSampleFrequency : <i>int (default = 4500000)</i></b>
<p class="attr"> Returns: success : bool
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. returns True on successful completion, returns False or will raise an exception on failure.
</p>
<b>pdmEnable : <i>bool (default = True)</i></b> Examples
<p class="attr"> Create settings from a premade setup with all processing steps on. You can get the available premade settings with get_premade_recording_settings_list().
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, rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True,
beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=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. 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") 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, rtisdev.set_processing_settings(premade="2D_5m_181", pdmEnable=True, matchedFilterEnable=True,
beamformingEnable=False, enveloppeEnable=False, cleanEnable=False) 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", "microphoneLayout" : "eRTIS_v3D1",
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
...@@ -767,19 +409,9 @@ Here we use auto-generated processing files. ...@@ -767,19 +409,9 @@ Here we use auto-generated processing files.
"directions": 181, "directions": 181,
"2D": 1 "2D": 1
} }
```
```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json") 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", "microphoneLayout" : "eRTIS_v3D1",
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
...@@ -787,393 +419,177 @@ An example of such custom processing files can be found [here](https://cosysgit. ...@@ -787,393 +419,177 @@ An example of such custom processing files can be found [here](https://cosysgit.
"delayMatrixCustom": ".premade/delaymatrix.csv", "delayMatrixCustom": ".premade/delaymatrix.csv",
"rangesCustom": ".premade/ranges.csv" "rangesCustom": ".premade/ranges.csv"
} }
```
```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json") 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. 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) 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.
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/).
```python
rtisdev.set_processing_settings(customPath="mysettingsfolder") rtisdev.set_processing_settings(customPath="mysettingsfolder")
``` get_current_settings
def get_current_settings() [source]
## **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 the RTISSettings object of the current settings for processing and recording.
<table class="docutils field-list field-table" frame="void" rules="none"> Returns: settings : RTISSettings
<col class="field-name" /> The complete class containing all RTIS settings for recording and processing. Returns 'None' or will raise an exception on failure.
<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>
clear_current_settings
def clear_current_settings() [source]
Clear the current applied RTISSettings configuration.
## **get_premade_recording_settings_list** 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]
<p class="func-header"> 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.
<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>
Get a list of names of all the available premade settings for recording. 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.
<table class="docutils field-list field-table" frame="void" rules="none"> recordingJsonPath : String (default = Not used)
<col class="field-name" /> 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.
<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>
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.
## **get_microphone_layout_list** 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.
<p class="func-header"> processingCustomPath : String (default = Not used)
<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> 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>
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]
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.
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 a list of names of all the available microphone layouts that are available for recording. Get a list of names of all the available microphone layouts that are available for recording.
<table class="docutils field-list field-table" frame="void" rules="none"> Returns: microphoneLayouts : list[str]
<col class="field-name" /> A list holding all the names of available microphone layouts that can be loaded.
<col class="field-body" />
<tbody valign="top"> prepare_processing
<tr class="field"> def prepare_processing() [source]
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>microphoneLayouts : <i>list[str]</i></b> 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.
<p class="attr">
A list holding all the names of available microphone layouts that can be loaded. Returns: success : bool
</p></td> returns True on successful completion, returns False or will raise an exception on failure.
</tr>
</tbody> unload_processing
</table> def unload_processing() [source]
Stop all CUDA workers. Only required if actually using preloading of CUDA workers. CUDA workers are also automatically stopped when your script ends.
## **prepare_processing** Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
<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> get_raw_measurement
</p> def get_raw_measurement(behaviour: bool=False) [source]
Start the CUDA workers for looped measurements with processing enabled. 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.
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. Parameters: behaviour : bool
Furthermore, if using the default settings for processing this is enabled already. A configuration toggle to set the required sonar behaviour (active or passive).
<table class="docutils field-list field-table" frame="void" rules="none"> Returns: measurement : RTISMeasurement
<col class="field-name" /> The data class holding the raw measurement of the RTIS device with the raw binary data under measurement.rawData.
<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. Create a connection, set recording settings and make a raw measurement with passive behaviour.
```python
rtisdev.open_connection() rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") rtisdev.set_processing_settings(premade="2D_5m_181")
...@@ -1181,132 +597,60 @@ rtisdev.set_processing_settings(premade="2D_5m_181") ...@@ -1181,132 +597,60 @@ rtisdev.set_processing_settings(premade="2D_5m_181")
rtisdev.open_connection() rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") rtisdev.set_recording_settings(premade="default_25_50")
measurement = rtisdev.get_raw_measurement(True) 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. Create a connection, set recording and processing settings and make a signal measurement with active behaviour.
```python
import rtisdev import rtisdev
rtisdev.open_connection() rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") rtisdev.set_processing_settings(premade="2D_5m_181")
signal_measurement = rtisdev.get_signal_measurement(True) signal_measurement = rtisdev.get_signal_measurement(True)
``` get_processed_measurement
def get_processed_measurement(behaviour: bool=False) [source]
## **get_processed_measurement**
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.
<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> Parameters: behaviour : bool
</p> A configuration toggle to set the required sonar behaviour (active or passive).
Start an RTIS sonar measurement and process it and return the raw and processed data Returns: measurement : RTISMeasurement
in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object. This will use the chosen recording and processing settings. 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.
<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. Create a connection, set recording and processing settings and make a processed measurement with active behaviour.
```python
import rtisdev import rtisdev
rtisdev.open_connection() rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") rtisdev.set_processing_settings(premade="2D_5m_181")
processed_measurement = rtisdev.get_processed_measurement(True) processed_measurement = rtisdev.get_processed_measurement(True)
``` process_measurement
def process_measurement(measurement: RTISMeasurement) [source]
## **process_measurement**
Process a previously recorded raw RTIS sonar measurement from a RTISMeasurement object and return same measurement with processed data in a new RTISMeasurement object.
<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> Parameters: measurement : RTISMeasurement
</p> The data class holding the raw measurement of the RTIS device.
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object Returns: measurement : RTISMeasurement object
and return same measurement with processed data in a new [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object. The data class holding the processed measurement of the RTIS device under measurement.processedData and the raw binary data under measurement.rawData.
<table class="docutils field-list field-table" frame="void" rules="none"> Examples
<col class="field-name" /> Create a connection, set recording and processing settings and make a raw measurement with active behaviour. Then afterwards process it.
<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 import rtisdev
rtisdev.open_connection() rtisdev.open_connection()
...@@ -1314,132 +658,50 @@ rtisdev.set_recording_settings(premade="default_25_50") ...@@ -1314,132 +658,50 @@ rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") rtisdev.set_processing_settings(premade="2D_5m_181")
measurement = rtisdev.get_raw_measurement(True) measurement = rtisdev.get_raw_measurement(True)
processed_measurement = rtisdev.process_measurement(measurement) processed_measurement = rtisdev.process_measurement(measurement)
``` set_counter
def set_counter(newCount: int=0) [source]
## **set_counter** Set the internal measurement counter of the sonar hardware.
<p class="func-header"> Parameters: newCount : int (default = 0)
<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> The new count index to set.
</p>
Set the internal measurement counter of the sonar hardware. Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
set_behaviour
def set_behaviour(mode: bool) [source]
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.
<table class="docutils field-list field-table" frame="void" rules="none"> get_firmware_version
<col class="field-name" /> def get_firmware_version() [source]
<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. Get the firmware version of the internal RTIS firmware used on the device.
<table class="docutils field-list field-table" frame="void" rules="none"> Returns: firmwareVersion : string
<col class="field-name" /> returns the firmware version as a string in 'vMajor.Minor.Bugfix' format. Returns 'undefined' or will raise an exception on failure.
<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. Create a queue to save the measurement to and assign it to the thread.
```python
from multiprocessing import Manager from multiprocessing import Manager
import rtisdev import rtisdev
...@@ -1453,43 +715,20 @@ dataQueue = manager.Queue() ...@@ -1453,43 +715,20 @@ dataQueue = manager.Queue()
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue) measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
measure_thread.start() measure_thread.start()
measure_thread.join() measure_thread.join()
``` create_measure_external_trigger_callback
def create_measure_external_trigger_callback(callback: Callable[[ RTISMeasurement], any]) [source]
## **create_measure_external_trigger_callback**
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.
<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. Create a callback to save the measurement to disk.
```python
import rtisdev import rtisdev
rtisdev.open_connection() rtisdev.open_connection()
...@@ -1510,56 +749,28 @@ def save_callback(measurement=None): ...@@ -1510,56 +749,28 @@ def save_callback(measurement=None):
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback) measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
measure_thread.start() measure_thread.start()
measure_thread.join() measure_thread.join()
``` create_processing_workers
def create_processing_workers(workerCount: int, inputQueue: Queue, outputQueue: Queue) [source]
## **create_processing_workers**
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.
<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> 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!
</p>
Parameters: workerCount : int
This will create and return a Multiprocessing Pool that will generating a chosen amount of processing The amount of worker processes to create and keep active in the Pool.
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. inputQueue : multiprocessing.Manager.Queue
Please disable 'preloadToggle' or make sure to not use 'prepare_processing()' before this point as it will This is the data queue that will be used to receive the recorded RTISMeasurement objects on.
cause an error to prevent crashing.
outputQueue : multiprocessing.Manager.Queue
<table class="docutils field-list field-table" frame="void" rules="none"> This is the data queue that will be used to store the processed RTISMeasurement objects on.
<col class="field-name" />
<col class="field-body" /> Returns: workersPool : multiprocessing.Pool
<tbody valign="top"> 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.
<tr class="field">
<th class="field-name"><b>Parameters:</b></td> Examples
<td class="field-body" width="100%"><b>workerCount : <i>int</i></b> 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.
<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 from multiprocessing import Manager
import rtisdev import rtisdev
...@@ -1581,146 +792,51 @@ for measurement_index in range(0, 30): ...@@ -1581,146 +792,51 @@ for measurement_index in range(0, 30):
measurement = outputQueue.get() measurement = outputQueue.get()
workersPool.terminate() workersPool.terminate()
``` toggle_amplifier
def toggle_amplifier(mode: bool) [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#L3355">[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#L3378">[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#L3401">[source]</a>
</p>
The function to reset the RTIS device hardware. 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"> Parameters: mode : bool
<col class="field-name" /> the amplifier mode chosen. False = disable True = enable
<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#L3449">[source]</a>
</p>
The function to set the logging level of the RTIS Dev module. Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
<table class="docutils field-list field-table" frame="void" rules="none"> toggle_external_triggers
<col class="field-name" /> def toggle_external_triggers(mode: bool) [source]
<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>
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
## **set_custom_logger** Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
<p class="func-header"> reset_device
<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#L3480">[source]</a> def reset_device(stm32pin: int=7) [source]
</p>
The function to set a custom logger to be used by RTIS Dev. 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.
Returns: success : bool
returns True on successful completion, returns False or will raise an exception on failure.
set_log_mode
def set_log_mode(mode: int) [source]
<table class="docutils field-list field-table" frame="void" rules="none"> The function to set the logging level of the RTIS Dev module.
<col class="field-name" />
<col class="field-body" /> Parameters: mode : int
<tbody valign="top"> Disable or configure log the level. 0 = off 1 = only warnings and errors 2(default) = includes info 3 = includes debug
<tr class="field">
<th class="field-name"><b>Parameters:</b></td> set_custom_logger
<td class="field-body" width="100%"><b>customLogger : <i>logging.Logger</i></b> def set_custom_logger(customLogger: logging.Logger) [source]
<p class="attr">
The custom logger to be used by RTIS Dev. The function to set a custom logger to be used by RTIS Dev.
</p></td>
</tr>
</tbody>
</table>
Parameters: customLogger : logging.Logger
The custom logger to be used by RTIS Dev.
\ No newline at end of file
Clone repository
  • 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