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 Sep 26, 2025 by Wouter Jansen's avatar Wouter Jansen
Hide whitespace changes
Inline Side-by-side
home.md
View page @ 43cc00ac
......@@ -63,1767 +63,6 @@ config_uuid = rtisdev.set_recording_settings(microphoneSamples=163840, callMinim
Enable all processing steps and preload them with RTIS CUDA. This will produce a 2D energyscape with 91 directions
with a maximum distance of 6m:
```python
success_settings_processing = rtisdev.set_processing_settings(directions=91, maxRange=5, configName=config_uuid)
```
Get the used settings as a RTISSettings object:
```python
settings = rtisdev.get_current_settings(configName=config_uuid)
```
Get an ACTIVE measurement (protect your ears!) in raw data:
```python
measurement = rtisdev.get_raw_measurement(True, configName=config_uuid)
```
Store the raw data of that measurement as a binary file. This can be opened in another application for further work:
```python
raw_data_sonar = measurement.rawData.tobytes()
file_handle_data = open("test_measurement_" + str(measurement.index) + ".bin", "wb")
file_handle_data.write(raw_data_sonar)
file_handle_data.close()
```
Process that raw measurement to an energyscape using the configuration chosen earlier:
```python
processed_measurement = rtisdev.process_measurement(measurement, configName=config_uuid)
```
Get a new ACTIVE measurement (protect your ears!) in both raw and processed data formats directly:
```python
new_processed_measurement = rtisdev.get_processed_measurement(True, configName=config_uuid)
```
Plot the 2D energyscape of this processed measurement using matplotlib:
```python
plt.imshow(np.transpose(new_processed_measurement.processedData), cmap="hot", interpolation='nearest')
plt.xlabel("Directions (degrees)")
plt.ylabel("Range (meters)")
indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20)
labels_x = np.round(np.rad2deg(settings.directions[indexes_x, 0])).astype(int)
indexes_y = np.arange(0, new_processed_measurement.processedData.shape[1], 100)
labels_y = settings.ranges[indexes_y]
fmt_x = lambda x: "{:.0f}°".format(x)
fmt_y = lambda x: "{:.2f}m".format(x)
plt.xticks(indexes_x, [fmt_x(i) for i in labels_x])
plt.yticks(indexes_y, [fmt_y(i) for i in labels_y])
plt.title("RTIS Dev - 2D Energyscape Example")
ax = plt.gca()
ax.invert_yaxis()
ax.set_aspect("auto")
plt.show()
```
Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly:
```python
signal_measurement = rtisdev.get_signal_measurement(True, configName=config_uuid)
```
Plot the microphone signals of this measurement:
```python
fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True)
for microphone_index_i in range(0, 8):
for microphone_index_j in range(0, 4):
axs[microphone_index_i, microphone_index_j].set_title(str(microphone_index_j+(microphone_index_i*4)+1))
axs[microphone_index_i, microphone_index_j].plot(signal_measurement.processedData[microphone_index_j+(microphone_index_i*4),:])
if microphone_index_j != 0:
plt.setp(axs[microphone_index_i, microphone_index_j], yticklabels=[])
if microphone_index_i != 7:
plt.setp(axs[microphone_index_i, microphone_index_j], xticklabels=[])
if microphone_index_i == 7:
axs[microphone_index_i, microphone_index_j].set_xlabel("Time (Samples)")
if microphone_index_j == 0:
axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
plt.show()
fig.suptitle("RTIS Dev - Microphone Signals")
```
# **Classes**
## **RTISMeasurement**
<p class="func-header">
<i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L359">[source]</a>
</p>
Class storing all data and information on an RTIS device measurement.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Attributes:</b></td>
<td class="field-body" width="100%"><b>id : <i>string</i></b>
<p class="attr">
The unique identifier to identify this RTIS Client by.
</p>
<b>timestamp : <i>float</i></b>
<p class="attr">
The epoch timestamp of the measurement.
</p>
<b>behaviour : <i>bool</i></b>
<p class="attr">
The sonar behaviour (active or passive).
</p>
<b>index : <i>int</i></b>
<p class="attr">
The internal measurement index.
</p>
<b>rawData : <i>Numpy ndarray</i></b>
<p class="attr">
This stores the raw data returned by the RTIS Device. This is stored as a list of uint32 values.
</p>
<b>processedData : <i>Numpy ndarray</i></b>
<p class="attr">
This stores the (partially) processed data that has gone through the processing pipeline as configured by the user.
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration used for this measurement (and its processing).
</p></td>
</tr>
</tbody>
</table>
## **RTISSettings**
<p class="func-header">
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion: str, configName: str</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L435">[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#L700">[source]</a>
</p>
The class based on a Multiprocessing Process 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 process 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>
## **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#L863">[source]</a>
</p>
The class based on a Multiprocessing Process 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 process 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(save_callback)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_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>
# **Methods**
## **open_connection**
<p class="func-header">
<i>def</i> <b>open_connection</b>(<i>port: str='/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#L2938">[source]</a>
</p>
Connect to the port of the RTIS Hardware.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>port : <i>string (default = '/dev/ttyACM0')</i></b>
<p class="attr">
Name of the port.
</p>
<b>allowDebugMode : <i>bool (default = False)</i></b>
<p class="attr">
When enabled, if a connection can not be made to a real RTIS Device to the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing an 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#L3042">[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. This will also unload all RTIS CUDA workers.
<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#L3077">[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_list() 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 be larger than 160 KHz and smaller than 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 it will default to a unique UUID.
</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>configName : <i>string</i></b>
<p class="attr">
returns the given configuration name or generated UUID on successful completion or will raise an exception on failure.
</p></td>
</tr>
</tbody>
</table>
#### Examples
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).
Create settings from a premade setup:
```python
config_uuid = 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.
More examples can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/recording/).
An example json:
```json
{
"microphoneSamples" : 294912,
"microphoneSampleFrequency" : 4500000,
"callSampleFrequency" : 450000,
"callDuration" : 2.5,
"callMinimumFrequency" : 25000,
"callMaximumFrequency" : 50000,
"callEmissions": 1
}
```
```python
config_uuid = 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](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/recording/)flutter.csv:
```json
{
"microphoneSamples" : 16777216,
"microphoneSampleFrequency" : 4500000,
"callSampleFrequency" : 450000,
"callCustom": "mycall.csv",
"callEmissions": 1
}
```
```python
config_uuid = rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
```
Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
```python
config_uuid = rtisdev.set_recording_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000, callMaximumFrequency=80000)
```
Load in manually generated call. This requires the file to exist on the path and have the right format.
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/recording/)flutter.csv:
```python
config_uuid = rtisdev.set_recording_settings(callCustom="mycall.csv")
```
Note that when multiple recording configurations are loaded, the module will automatically
load the settings as asked for by the configName argument to the RTIS device before performing a new measurement.
## **set_processing_settings**
<p class="func-header">
<i>def</i> <b>set_processing_settings</b>(<i>configName: str, premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool= True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool=True, preFilter: np.ndarray =None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3256">[source]</a>
</p>
Set the processing settings. All parameters are optional and most have default values.
Please read their decription carefully.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>configName : <i>String</i></b>
<p class="attr">
String to identify these settings with.
</p>
<b>premade : <i>String (default = Not used)</i></b>
<p class="attr">
When using get_premade_processing_settings_list() you can get a set of premade configurations with a unique identifier as name. To use one of those use that identifier name with this argument.
</p>
<b>jsonPath : <i>String (default = Not used)</i></b>
<p class="attr">
One can also store the processing settings in a json file. To load the processing settings from a json file, please use the absolute path to this json file with this argument. See the examples for more information.
</p>
<b>customPath : <i>String (default = Not used)</i></b>
<p class="attr">
One can use a custom set of processing files (delaymatrix.csv, directions.csv and ranges.csv). To load the custom files use the absolute path to the folder where these csvs are located. See the examples for more information.
</p>
<b>microphoneLayout : <i>String (default = eRTIS_v3D1)</i></b>
<p class="attr">
Identifier of the microphone layout used for this configuration.
</p>
<b>mode : <i>int (default = 1)</i></b>
<p class="attr">
Defines if using 3D or 2D processing. If set to 1 a 2D horizontal plane layout will be generated. When set to 0 a 3D equal distance layout will be generated for the frontal hemisphere of the sensor.
</p>
<b>directions : <i>int (default = 181)</i></b>
<p class="attr">
Defines how many directions the layout should generate.
</p>
<b>azimuthLowLimit : <i>float (default = -90)</i></b>
<p class="attr">
The lower limit of the azimuth in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>azimuthHighLimit : <i>float (default = 90)</i></b>
<p class="attr">
The higher limit of the azimuth in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevationLowLimit : <i>float (default = -90)</i></b>
<p class="attr">
The lower limit of the elevation in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevationHighLimit : <i>float (default = 90)</i></b>
<p class="attr">
The higher limit of the elevation in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevation2DAngle : <i>float (default = 0)</i></b>
<p class="attr">
The angle in degrees of the elevation in the 2D mode generation. Has to be between -90 and 90.
</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>preFilterEnable : <i>bool (default = False)</i></b>
<p class="attr">
Toggle for the optional pre-filter part of the RTIS processing pipeline using RTIS CUDA.
</p>
<b>matchedFilterEnable : <i>bool (default = True)</i></b>
<p class="attr">
Toggle for optional 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>postFilterEnable : <i>bool (default = False)</i></b>
<p class="attr">
Toggle for the optional post-beamforming filter 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>preFilter : <i>Numpy ndarray (default = Not used)</i></b>
<p class="attr">
The array holding the optional pre-filter created with scipy firwin. (shape: nprefilter x 1)
</p>
<b>postFilter : <i>Numpy ndarray (default = Not used)</i></b>
<p class="attr">
The array holding the optional post-beamforming filter created with scipy firwin. (shape: npostfilter x 1)
</p>
<b>meanEnergyRangeMultiplier : <i>float (default = 2)</i></b>
<p class="attr">
The multiplier weight used to calculate the mean energy for each range during the cleaning step.
</p>
<b>maxEnergyRangeThresholdMultiplier : <i>float (default = 0.5)</i></b>
<p class="attr">
The multiplier weight used to threshold the energy based on the maximum for each range during the cleaning step.
</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
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).
Create settings from a premade setup with all processing steps on:
```python
rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True, preFilterEnable=False, beamformingEnable=True, enveloppeEnable=True, postFilterEnable=False, cleanEnable=True, preloadToggle=True, configName=config_uuid)
```
You don't have to define all the processing steps, as they are all on by default:
```python
rtisdev.set_processing_settings(directions=91, configName=config_uuid)
```
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(pdmEnable=True, preFilterEnable=False, matchedFilterEnable=True, beamformingEnable=False, enveloppeEnable=False, cleanEnable=False, configName=config_uuid)
```
Create settings from a json file with full processing settings on.
This expects a json to be available with a premade a format such as seen below.
Note that the json does not include support for pre- and post-filters. Any other setting not defined in the
json example below should also still be set manually as argument if the default value is not desired.
An example of such json files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/processing/).
Here we use auto-generated processing files:
```json
{
"microphoneLayout" : "eRTIS_v3D1",
"minRange" : 0.5,
"maxRange" : 5,
"directions": 181,
"azimuthLowLimit": -30,
"azimuthHighLimit": 30,
"2D": 1
}
```
```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json", configName=config_uuid)
```
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.
Note that the json does not include support for pre- and post-filters. Any other setting not defined in the
json example below should also still be set manually as argument if the default value is not desired.
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/processing/) as well:
```json
{
"microphoneLayout" : "eRTIS_v3D1",
"directionsCustom": "./directions.csv",
"delayMatrixCustom": ".premade/delaymatrix.csv",
"rangesCustom": ".premade/ranges.csv"
}
```
```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json", configName=config_uuid)
```
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, configName=config_uuid)
```
Load in manually generated processing files. This requires 3 files to exist in the given path:
delaymatrix.csv, directions.csv and ranges.csv. Don't forget to also perhaps set the microphoneLayout and
microphoneSampleFrequency values correctly as these are absent in these csv files!
Note that the custom paths does not include support for pre- and post-filters.
Any other setting not should also still be set manually as argument if the default value is not desired.
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/config/premadeSettings/processing/):
```python
rtisdev.set_processing_settings(customPath="mysettingsfolder", configName=config_uuid)
```
The pre-filter is an optional filter to be performed after PDM filtering and before matched filter.
It should be created using a scipy firwin filter function as in the example below:
```python
pref = scipy.signal.firwin(513, 20000 / (450000 / 2), pass_zero=False).astype(np.float32)
rtisdev.set_processing_settings(postFilter=pref, preFilterEnable=True, configName=config_uuid)
```
Similarly, The post-beamforming filter is an optional filter to be performed after beamforming.
It should be created using a scipy firwin filter function as in the example below:
```python
postf = scipy.signal.firwin(512, [40000 / (450000 / 2), 50000 / (450000 / 2)], pass_zero=False).astype(np.float32)
rtisdev.set_processing_settings(postFilter=postf, postFilterEnable=True, configName=config_uuid)
```
## **get_current_settings_config_name_list**
<p class="func-header">
<i>def</i> <b>get_current_settings_config_name_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3551">[source]</a>
</p>
Get a list of names of all the currently loaded configurations.
<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>configNames : <i>list[str]</i></b>
<p class="attr">
A list holding all the names of currently loaded RTISSettings.
</p></td>
</tr>
</tbody>
</table>
## **get_current_settings**
<p class="func-header">
<i>def</i> <b>get_current_settings</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3563">[source]</a>
</p>
Returns all(dict) or a single [`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>Parameters:</b></td>
<td class="field-body" width="100%"><b>configName : <i>String</i></b>
<p class="attr">
String to identify these settings with. If given will only return this settings configuration if found. If not provided will return a dict of all RTISSettings objects identified by their own config name.
</p></td>
</tr>
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>settings : <i>RTISSettings or dict</i></b>
<p class="attr">
If the configName parameter is given, it will only return the complete class containing all RTIS settings for recording and processing. If this argument is not given it will return a dict of all RTISSettings objects identified by their own config name. If there is only one settings object defined it will return this one instead of a dict. 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>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3598">[source]</a>
</p>
Clear all or the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration depending on setting the configName parameter.
<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>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be cleared. If not given it will clear all settings.
</p></td>
</tr>
</tbody>
</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, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool=True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, preFilter: np.ndarray=None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3626">[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_list() 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_list() 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 be larger than 160 KHz and smaller than 2 MHz.
</p>
<b>callDuration : <i>float (default = 2.5)</i></b>
<p class="attr">
The duration in milliseconds 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>azimuthLowLimit : <i>float (default = -90)</i></b>
<p class="attr">
The lower limit of the azimuth in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>azimuthHighLimit : <i>float (default = 90)</i></b>
<p class="attr">
The higher limit of the azimuth in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevationLowLimit : <i>float (default = -90)</i></b>
<p class="attr">
The lower limit of the elevation in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevationHighLimit : <i>float (default = 90)</i></b>
<p class="attr">
The higher limit of the elevation in degrees of the directions to generate. Has to be between -90 and 90.
</p>
<b>elevation2DAngle : <i>float (default = 0)</i></b>
<p class="attr">
The angle in degrees of the elevation in the 2D mode generation. Has to be between -90 and 90.
</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>preFilter : <i>Numpy ndarray (default = Not used)</i></b>
<p class="attr">
The array holding the optional pre-filter created with scipy firwin. (shape: nprefilter x 1)
</p>
<b>matchedFilterEnable : <i>bool (default = True)</i></b>
<p class="attr">
Toggle for the optional 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>postFilterEnable : <i>bool (default = False)</i></b>
<p class="attr">
Toggle for the optional post-beamforming filter 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>preFilter : <i>Numpy ndarray (default = Not used)</i></b>
<p class="attr">
The array holding the optional pre-filter created with scipy firwin. (shape: nprefilter x 1)
</p>
<b>postFilter : <i>Numpy ndarray (default = Not used)</i></b>
<p class="attr">
The array holding the optional post-beamforming filter created with scipy firwin. (shape: npostfilter x 1)
</p>
<b>meanEnergyRangeMultiplier : <i>float (default = 2)</i></b>
<p class="attr">
The multiplier weight used to calculate the mean energy for each range during the cleaning step.
</p>
<b>maxEnergyRangeThresholdMultiplier : <i>float (default = 0.5)</i></b>
<p class="attr">
The multiplier weight used to threshold the energy based on the maximum for each range during the cleaning step.
</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 default to a unique UUID.
</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#L3876">[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#L3916">[source]</a>
</p>
Get a list of names of all the available premade settings for 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>Returns:</b></td>
<td class="field-body" width="100%"><b>recordingSettings : <i>list[str]</i></b>
<p class="attr">
A list holding all the names of available settings that can be loaded.
</p></td>
</tr>
</tbody>
</table>
## **get_premade_recording_settings_list**
<p class="func-header">
<i>def</i> <b>get_premade_recording_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3931">[source]</a>
</p>
Get a list of names of all the available premade settings for 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>recordingSettings : <i>list[str]</i></b>
<p class="attr">
A list holding all the names of available settings that can be loaded.
</p></td>
</tr>
</tbody>
</table>
## **get_microphone_layout_list**
<p class="func-header">
<i>def</i> <b>get_microphone_layout_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3946">[source]</a>
</p>
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">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>microphoneLayouts : <i>list[str]</i></b>
<p class="attr">
A list holding all the names of available microphone layouts that can be loaded.
</p></td>
</tr>
</tbody>
</table>
## **prepare_processing**
<p class="func-header">
<i>def</i> <b>prepare_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3960">[source]</a>
</p>
Start the CUDA workers for looped measurements with processing enabled.
It is not required to run this method for doing processing, but it will speed up the workflow
significantly if doing many processed measurements at a high frequency.
Furthermore, if using the default settings for processing this is enabled already.
If no config name parameter is provided it will assume only one settings configuration is available and
will prepare that one.
<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>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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>
## **unload_processing**
<p class="func-header">
<i>def</i> <b>unload_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4003">[source]</a>
</p>
Stop all CUDA workers of all workers or of one specified if the configuration name is provided.
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>Parameters:</b></td>
<td class="field-body" width="100%"><b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will stop the workers of all configurations.
</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_raw_measurement**
<p class="func-header">
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4027">[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 (default = False)</i></b>
<p class="attr">
A configuration toggle to set the required sonar behaviour (active or passive).
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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
Create a connection, set recording settings and make a raw measurement with passive behaviour:
```python
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
measurement = rtisdev.get_raw_measurement(True, configName=config_uuid)
```
Note that when multiple recording configurations are loaded, the module will automatically
load the settings as asked for by the configName argument to the RTIS device before performing a new measurement.
## **get_signal_measurement**
<p class="func-header">
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4070">[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 (default = False)</i></b>
<p class="attr">
A configuration toggle to set the required sonar behaviour (active or passive).
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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
Create a connection, set recording and processing settings and make a signal measurement with active behaviour:
```python
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
signal_measurement = rtisdev.get_signal_measurement(True, configName=config_uuid)
```
Note that when multiple recording configurations are loaded, the module will automatically
load the settings as asked for by the configName argument to the RTIS device before performing a new measurement.
## **get_processed_measurement**
<p class="func-header">
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4115">[source]</a>
</p>
Start an RTIS sonar measurement and process it and return the raw and processed data
in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object. This will use the chosen recording and processing settings.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>behaviour : <i>bool (default = False)</i></b>
<p class="attr">
A configuration toggle to set the required sonar behaviour (active or passive).
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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
Create a connection, set recording and processing settings and make
a processed measurement with active behaviour:
```python
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91, configName=config_uuid)
processed_measurement = rtisdev.get_processed_measurement(True, configName=config_uuid)
```
Note that when multiple recording configurations are loaded, the module will automatically
load the settings as asked for by the configName argument to the RTIS device before performing a new measurement.
## **process_measurement**
<p class="func-header">
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4166">[source]</a>
</p>
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
and return same measurement with processed data in a new [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>measurement : <i>RTISMeasurement</i></b>
<p class="attr">
The data class holding the raw measurement of the RTIS device.
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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 afterward process it:
```python
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91, configName=config_uuid)
measurement = rtisdev.get_raw_measurement(True, configName=config_uuid)
processed_measurement = rtisdev.process_measurement(measurement, configName=config_uuid)
```
## **set_counter**
<p class="func-header">
<i>def</i> <b>set_counter</b>(<i>newCount: int=0</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4212">[source]</a>
</p>
Set the internal measurement counter of the sonar hardware.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>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#L4235">[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#L4260">[source]</a>
</p>
Get the firmware version of the internal RTIS firmware used on the device.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>firmwareVersion : <i>string</i></b>
<p class="attr">
returns the firmware version as a string in 'vMajor.Minor.Bugfix' format. Returns 'undefined' or will raise an exception on failure.
</p></td>
</tr>
</tbody>
</table>
## **create_measure_external_trigger_queue**
<p class="func-header">
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4275">[source]</a>
</p>
This will create and return a Multiprocessing Process
that will be waiting for an external trigger to measure from
the RTIS Device and afterward put this measurement on a data queue.
This method will return a [`MeasureExternalTriggerQueueThread`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#measureexternaltriggerqueuethread).
<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>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</p></td>
</tr>
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>measure_process : <i>MeasureExternalTriggerQueueThread</i></b>
<p class="attr">
Class instance of the Multiprocessing Process 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 a queue to save the measurement to and assign it to the process:
```python
from multiprocessing import Manager
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91,configName=config_uuid)
manager = Manager()
dataQueue = manager.Queue()
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue, config_uuid)
measure_thread.start()
measure_thread.join()
```
## **create_measure_external_trigger_callback**
<p class="func-header">
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any], configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4350">[source]</a>
</p>
This will create and return a Multiprocessing Process
that will be waiting for an external trigger to measure from
the RTIS Device and afterward put this measurement on a data queue.
This method will return a [`MeasureExternalTriggerCallbackThread`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#measureexternaltriggercallbackthread).
<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>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</p></td>
</tr>
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>measure_process : <i>MeasureExternalTriggerCallbackThread</i></b>
<p class="attr">
Class instance of the Multiprocessing Process 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
Create a callback to save the measurement to disk:
```python
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91, configName=config_uuid)
index = 0
def save_callback(measurement=None):
if measurement is not None :
if measurement.rawData is not None:
data_sonar = measurement.rawData.tobytes()
file_handle_data = open(str(index) + ".bin","wb")
file_handle_data.write(data_sonar)
file_handle_data.close()
index = index + 1
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback, config_uuid)
measure_thread.start()
measure_thread.join()
```
## **create_processing_workers**
<p class="func-header">
<i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4434">[source]</a>
</p>
This will create and return a Multiprocessing Pool that will generate a chosen amount of processing
workers to handle incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on the input Multiprocessing Queue
and after processing place them on the output Multiprocessing Queue.
Please set the `preloadToggle` argument to `False` when using [`set_processing_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#set_processing_settings)
and/or make sure to not use [`set_processing_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#prepare_processing) before this point as it will cause an error or result in a
potential crash of RTIS Dev!
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>workerCount : <i>int</i></b>
<p class="attr">
The amount of worker processes to create and keep active in the Pool.
</p>
<b>inputQueue : <i>multiprocessing.Manager.Queue</i></b>
<p class="attr">
This is the data queue that will be used to receive the recorded <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
</p>
<b>outputQueue : <i>multiprocessing.Manager.Queue</i></b>
<p class="attr">
This is the data queue that will be used to store the processed <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
</p>
<b>configName : <i>string</i></b>
<p class="attr">
The identity of the settings configuration to be used. If not given it will assume only one settings configuration is defined within RTIS Dev.
</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, set up the worker pool with 4 workers, generate some measurements and afterward parse
all these measurements by getting them from the output queue.
Once the work is done, terminate the workers gracefully:
```python
from multiprocessing import Manager
import rtisdev
rtisdev.open_connection()
config_uuid = rtisdev.set_recording_settings(callMinimumFrequency=25000, callMaximumFrequency=50000)
rtisdev.set_processing_settings(directions=91, configName=config_uuid, preloadToggle=False)
manager = Manager()
inputQueue = manager.Queue()
outputQueue = manager.Queue()
workersPool = rtisdev.create_processing_workers(4, inputQueue, outputQueue, config_uuid)
for measurement_index in range(0, 30):
measurement = rtisdev.get_raw_measurement(configName=config_uuid)
inputQueue.put(measurement)
for measurement_index in range(0, 30):
measurement = outputQueue.get()
workersPool.terminate()
```
## **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#L4509">[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, pin: int=1</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4531">[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. You can also set the input pin (1 or 2).
<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 pin : Integer (default = 1) change the trigger pin to use. This has to be 1 or 2.
</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>
## **custom_command**
<p class="func-header">
<i>def</i> <b>custom_command</b>(<i>command: str</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4554">[source]</a>
</p>
Send a custom command to the RTIS device to execute over serial.
This is usually in the format of !c,i,j,k. With c being the command ID character and i,j and k being the three
comma-seperated command values.
<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>command : <i>str</i></b>
<p class="attr">
the command string to send 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>returnValue : <i>int</i></b>
<p class="attr">
returns the returned value of the RTIS device as an integer.
</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#L4575">[source]</a>
</p>
The function to reset the RTIS device hardware.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>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#L4621">[source]</a>
</p>
The function to set the logging level of the RTIS Dev module.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>mode : <i>int</i></b>
<p class="attr">
Disable or configure log the level. 0 = off, 1 = only warnings and errors, 2(default) = includes info, 3 = includes debug
</p></td>
</tr>
</tbody>
</table>
## **set_custom_logger**
<p class="func-header">
<i>def</i> <b>set_custom_logger</b>(<i>customLogger: logging.Logger</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4649">[source]</a>
</p>
The function to set a custom logger to be used by RTIS Dev.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>customLogger : <i>logging.Logger</i></b>
<p class="attr">
The custom logger to be used by RTIS Dev.
</p></td>
</tr>
</tbody>
</table>
# **RTIS Dev Documentation - Table of Content**
- [General Example](#general-example)
- [Classes](#classes)
- [RTISMeasurement](#rtismeasurement)
- [RTISSettings](#rtissettings)
- [MeasureExternalTriggerQueueThread](#measureexternaltriggerqueuethread)
- [MeasureExternalTriggerCallbackThread](#measureexternaltriggercallbackthread)
- [Methods](#methods)
- [open_connection](#open_connection)
- [close_connection](#close_connection)
- [set_recording_settings](#set_recording_settings)
- [set_processing_settings](#set_processing_settings)
- [get_current_settings_config_name_list](#get_current_settings_config_name_list)
- [get_current_settings](#get_current_settings)
- [clear_current_settings](#clear_current_settings)
- [get_settings](#get_settings)
- [set_settings_from_class](#set_settings_from_class)
- [get_premade_processing_settings_list](#get_premade_processing_settings_list)
- [get_premade_recording_settings_list](#get_premade_recording_settings_list)
- [get_microphone_layout_list](#get_microphone_layout_list)
- [prepare_processing](#prepare_processing)
- [unload_processing](#unload_processing)
- [get_raw_measurement](#get_raw_measurement)
- [get_signal_measurement](#get_signal_measurement)
- [get_processed_measurement](#get_processed_measurement)
- [process_measurement](#process_measurement)
- [set_counter](#set_counter)
- [set_behaviour](#set_behaviour)
- [get_firmware_version](#get_firmware_version)
- [create_measure_external_trigger_queue](#create_measure_external_trigger_queue)
- [create_measure_external_trigger_callback](#create_measure_external_trigger_callback)
- [create_processing_workers](#create_processing_workers)
- [toggle_amplifier](#toggle_amplifier)
- [toggle_external_triggers](#toggle_external_triggers)
- [custom_command](#custom_command)
- [reset_device](#reset_device)
- [set_log_mode](#set_log_mode)
- [set_custom_logger](#set_custom_logger)
# **General Example**
Here is a small example that goes over most basic steps:
```python
import rtisdev
import matplotlib.pyplot as plt
import numpy as np
```
Open a connection to the RTIS Device over the default serial port:
```python
success_connect = rtisdev.open_connection()
```
Set the recording settings with 163840 samples and a call sweep between 25 and 50 KHz:
```python
config_uuid = rtisdev.set_recording_settings(microphoneSamples=163840, callMinimumFrequency=25000, callMaximumFrequency=50000)
```
Enable all processing steps and preload them with RTIS CUDA. This will produce a 2D energyscape with 91 directions
with a maximum distance of 6m:
```python
success_settings_processing = rtisdev.set_processing_settings(directions=91, maxRange=6, configName=config_uuid)
```
......@@ -1994,6 +233,8 @@ Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwe
</table>
## **MeasureExternalTriggerCallbackThread**
<p class="func-header">
......@@ -2020,7 +261,7 @@ Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit
## **open_connection**
<p class="func-header">
<i>def</i> <b>open_connection</b>(<i>port: str='/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#L2994">[source]</a>
<i>def</i> <b>open_connection</b>(<i>port: str='/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#L2997">[source]</a>
</p>
Connect to the port of the RTIS Hardware.
......@@ -2055,7 +296,7 @@ Connect to the port of the RTIS Hardware.
## **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#L3098">[source]</a>
<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#L3101">[source]</a>
</p>
Manually close the connection to the RTIS device.
......@@ -2081,7 +322,7 @@ be closed gracefully. This will also unload all RTIS CUDA workers.
## **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#L3133">[source]</a>
<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#L3136">[source]</a>
</p>
Set the recording settings. All parameters are optional and most have default values.
......@@ -2221,7 +462,7 @@ load the settings as asked for by the configName argument to the RTIS device bef
## **set_processing_settings**
<p class="func-header">
<i>def</i> <b>set_processing_settings</b>(<i>configName: str, premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool= True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool=True, preFilter: np.ndarray =None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5, dmasOrder: int=0, cfEnable: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3312">[source]</a>
<i>def</i> <b>set_processing_settings</b>(<i>configName: str, premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool= True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool=True, preFilter: np.ndarray =None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5, dmasOrder: int=1, cfEnable: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3315">[source]</a>
</p>
Set the processing settings. All parameters are optional and most have default values.
......@@ -2337,9 +578,9 @@ Please read their decription carefully.
<p class="attr">
The multiplier weight used to threshold the energy based on the maximum for each range during the cleaning step.
</p>
<b>dmasOrder : <i>int (default = 0)</i></b>
<b>dmasOrder : <i>int (default = 1 (DAS))</i></b>
<p class="attr">
The order of the DMAS algorithm for beamforming.
The order of the DMAS algorithm for beamforming. 1=DAS, 2=DMAS, 3=DMAS3, 4=DMAS4, 5=DMAS5. Setting it to 0 also runs DAS but with the older RTIS CUDA method.
</p>
<b>cfEnable : <i>bool (default = False)</i></b>
<p class="attr">
......@@ -2458,7 +699,7 @@ rtisdev.set_processing_settings(postFilter=postf, postFilterEnable=True, configN
## **get_current_settings_config_name_list**
<p class="func-header">
<i>def</i> <b>get_current_settings_config_name_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3619">[source]</a>
<i>def</i> <b>get_current_settings_config_name_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3623">[source]</a>
</p>
Get a list of names of all the currently loaded configurations.
......@@ -2482,7 +723,7 @@ Get a list of names of all the currently loaded configurations.
## **get_current_settings**
<p class="func-header">
<i>def</i> <b>get_current_settings</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3631">[source]</a>
<i>def</i> <b>get_current_settings</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3635">[source]</a>
</p>
Returns all(dict) or a single [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording.
......@@ -2513,7 +754,7 @@ Returns all(dict) or a single [`RTISSettings`](https://cosysgit.uantwerpen.be/rt
## **clear_current_settings**
<p class="func-header">
<i>def</i> <b>clear_current_settings</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3666">[source]</a>
<i>def</i> <b>clear_current_settings</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3670">[source]</a>
</p>
Clear all or the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration depending on setting the configName parameter.
......@@ -2537,7 +778,7 @@ Clear all or the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be
## **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, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool=True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, preFilter: np.ndarray=None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5, configName: str='', dmasOrder: int=0, cfEnable: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3694">[source]</a>
<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, azimuthLowLimit: float=-90, azimuthHighLimit: float=90, elevationLowLimit: float=-90, elevationHighLimit: float=90, elevation2DAngle: float=0, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, preFilterEnable: bool=False, matchedFilterEnable: bool=True, beamformingEnable: bool=True, postFilterEnable: bool=False, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, preFilter: np.ndarray=None, postFilter: np.ndarray=None, meanEnergyRangeMultiplier: float=2, maxEnergyRangeThresholdMultiplier: float=0.5, configName: str='', dmasOrder: int=1, cfEnable: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3698">[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
......@@ -2695,9 +936,9 @@ the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rt
<p class="attr">
String to identify these settings with. If set to empty (as it is by default) it will default to a unique UUID.
</p>
<b>dmasOrder : <i>int (default = 0)</i></b>
<b>dmasOrder : <i>int (default = 1 (DAS))</i></b>
<p class="attr">
The order of the DMAS algorithm for beamforming.
The order of the DMAS algorithm for beamforming. 1=DAS, 2=DMAS, 3=DMAS3, 4=DMAS4, 5=DMAS5. Setting it to 0 also runs DAS but with the older RTIS CUDA method.
</p>
<b>cfEnable : <i>bool (default = False)</i></b>
<p class="attr">
......@@ -2719,7 +960,7 @@ the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rt
## **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#L3952">[source]</a>
<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#L3957">[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
......@@ -2755,7 +996,7 @@ with the [`get_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev
## **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#L3992">[source]</a>
<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#L3997">[source]</a>
</p>
Get a list of names of all the available premade settings for processing.
......@@ -2779,7 +1020,7 @@ Get a list of names of all the available premade settings for processing.
## **get_premade_recording_settings_list**
<p class="func-header">
<i>def</i> <b>get_premade_recording_settings_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4007">[source]</a>
<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#L4012">[source]</a>
</p>
Get a list of names of all the available premade settings for recording.
......@@ -2803,7 +1044,7 @@ Get a list of names of all the available premade settings for recording.
## **get_microphone_layout_list**
<p class="func-header">
<i>def</i> <b>get_microphone_layout_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4022">[source]</a>
<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#L4027">[source]</a>
</p>
Get a list of names of all the available microphone layouts that are available for recording.
......@@ -2827,7 +1068,7 @@ Get a list of names of all the available microphone layouts that are available f
## **prepare_processing**
<p class="func-header">
<i>def</i> <b>prepare_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4036">[source]</a>
<i>def</i> <b>prepare_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4041">[source]</a>
</p>
Start the CUDA workers for looped measurements with processing enabled.
......@@ -2863,7 +1104,7 @@ will prepare that one.
## **unload_processing**
<p class="func-header">
<i>def</i> <b>unload_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4079">[source]</a>
<i>def</i> <b>unload_processing</b>(<i>configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4084">[source]</a>
</p>
Stop all CUDA workers of all workers or of one specified if the configuration name is provided.
......@@ -2896,7 +1137,7 @@ stopped when your script ends.
## **get_raw_measurement**
<p class="func-header">
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4103">[source]</a>
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4108">[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.
......@@ -2944,7 +1185,7 @@ load the settings as asked for by the configName argument to the RTIS device bef
## **get_signal_measurement**
<p class="func-header">
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4146">[source]</a>
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4151">[source]</a>
</p>
Start an RTIS sonar measurement and process it with only PDM filtering
......@@ -2994,7 +1235,7 @@ load the settings as asked for by the configName argument to the RTIS device bef
## **get_processed_measurement**
<p class="func-header">
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4191">[source]</a>
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4196">[source]</a>
</p>
Start an RTIS sonar measurement and process it and return the raw and processed data
......@@ -3044,7 +1285,7 @@ load the settings as asked for by the configName argument to the RTIS device bef
## **process_measurement**
<p class="func-header">
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4242">[source]</a>
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4247">[source]</a>
</p>
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
......@@ -3092,7 +1333,7 @@ processed_measurement = rtisdev.process_measurement(measurement, configName=conf
## **set_counter**
<p class="func-header">
<i>def</i> <b>set_counter</b>(<i>newCount: int=0</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4288">[source]</a>
<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#L4293">[source]</a>
</p>
Set the internal measurement counter of the sonar hardware.
......@@ -3123,7 +1364,7 @@ Set the internal measurement counter of the sonar hardware.
## **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#L4311">[source]</a>
<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#L4316">[source]</a>
</p>
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
......@@ -3157,7 +1398,7 @@ argument to define the sonar behaviour.
## **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#L4336">[source]</a>
<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#L4341">[source]</a>
</p>
Get the firmware version of the internal RTIS firmware used on the device.
......@@ -3181,7 +1422,7 @@ Get the firmware version of the internal RTIS firmware used on the device.
## **create_measure_external_trigger_queue**
<p class="func-header">
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4351">[source]</a>
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue, configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4356">[source]</a>
</p>
This will create and return a Multiprocessing Process
......@@ -3234,7 +1475,7 @@ measure_thread.join()
## **create_measure_external_trigger_callback**
<p class="func-header">
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any], configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4426">[source]</a>
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any], configName: str='' </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4431">[source]</a>
</p>
This will create and return a Multiprocessing Process
......@@ -3293,7 +1534,7 @@ measure_thread.join()
## **create_processing_workers**
<p class="func-header">
<i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4510">[source]</a>
<i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4515">[source]</a>
</p>
This will create and return a Multiprocessing Pool that will generate a chosen amount of processing
......@@ -3364,7 +1605,7 @@ workersPool.terminate()
## **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#L4585">[source]</a>
<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#L4590">[source]</a>
</p>
Enable/disable the high voltage amplifier's step up controller.
......@@ -3397,7 +1638,7 @@ This will save on power usage and heat production.
## **toggle_external_triggers**
<p class="func-header">
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool, pin: int=1</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4607">[source]</a>
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool, pin: int=1</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4612">[source]</a>
</p>
Enable/disable external triggers being able to start a measurement on the RTIS device.
......@@ -3429,7 +1670,7 @@ They are disabled by default so have to be manually enabled. You can also set th
## **custom_command**
<p class="func-header">
<i>def</i> <b>custom_command</b>(<i>command: str</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4630">[source]</a>
<i>def</i> <b>custom_command</b>(<i>command: str</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4635">[source]</a>
</p>
Send a custom command to the RTIS device to execute over serial.
......@@ -3462,7 +1703,7 @@ comma-seperated command values.
## **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#L4651">[source]</a>
<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#L4656">[source]</a>
</p>
The function to reset the RTIS device hardware.
......@@ -3493,7 +1734,7 @@ The function to reset the RTIS device hardware.
## **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#L4697">[source]</a>
<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#L4702">[source]</a>
</p>
The function to set the logging level of the RTIS Dev module.
......@@ -3517,7 +1758,7 @@ The function to set the logging level of the RTIS Dev module.
## **set_custom_logger**
<p class="func-header">
<i>def</i> <b>set_custom_logger</b>(<i>customLogger: logging.Logger</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L4725">[source]</a>
<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#L4730">[source]</a>
</p>
The function to set a custom logger to be used by RTIS Dev.
......
Clone repository
  • General Example
  • Classes
    • RTISMeasurement
    • RTISSettings
    • MeasureExternalTriggerQueueThread
    • MeasureExternalTriggerCallbackThread
  • Methods
    • open_connection
    • close_connection
    • set_recording_settings
    • set_processing_settings
    • get_current_settings_config_name_list
    • 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
    • custom_command
    • reset_device
    • set_log_mode
    • set_custom_logger