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 Mar 15, 2022 by Wouter Jansen's avatar Wouter Jansen
Show whitespace changes
Inline Side-by-side
home.md
View page @ a578f6ea
...@@ -41,108 +41,108 @@ ...@@ -41,108 +41,108 @@
Here is a small example that goes over most basic steps: Here is a small example that goes over most basic steps:
```python ```python
import rtisdev >>> import rtisdev
import matplotlib.pyplot as plt >>> import matplotlib.pyplot as plt
import numpy as np >>> import numpy as np
``` ```
Open a connection to the RTIS Device over the default serial port: Open a connection to the RTIS Device over the default serial port:
```python ```python
success_connect = rtisdev.open_connection() >>> success_connect = rtisdev.open_connection()
``` ```
Set the default recording settings with 163840 samples and a call sweep between 25 and 50 KHz: Set the default recording settings with 163840 samples and a call sweep between 25 and 50 KHz:
```python ```python
success_settings_record = rtisdev.set_recording_settings(premade="default_25_50") >>> success_settings_record = rtisdev.set_recording_settings(premade="default_25_50")
``` ```
Enable all processing steps and preload them with RTIS CUDA. This will produce a 2D energyscape with 181 directions Enable all processing steps and preload them with RTIS CUDA. This will produce a 2D energyscape with 181 directions
with a maximum distance of 5m: with a maximum distance of 5m:
```python ```python
success_settings_processing = rtisdev.set_processing_settings(premade="2D_5m_181") >>> success_settings_processing = rtisdev.set_processing_settings(premade="2D_5m_181")
``` ```
Get the used settings as a RTISSettings object: Get the used settings as a RTISSettings object:
```python ```python
settings = rtisdev.get_current_settings() >>> settings = rtisdev.get_current_settings()
``` ```
Get an ACTIVE measurement (protect your ears!) in raw data: Get an ACTIVE measurement (protect your ears!) in raw data:
```python ```python
measurement = rtisdev.get_raw_measurement(True) >>> measurement = rtisdev.get_raw_measurement(True)
``` ```
Store the raw data of that measurement as a binary file. This can be opened in another application for further work: Store the raw data of that measurement as a binary file. This can be opened in another application for further work:
```python ```python
raw_data_sonar = measurement.rawData.tobytes() >>> raw_data_sonar = measurement.rawData.tobytes()
file_handle_data = open("test_measurement_" + str(measurement.index) + ".bin", "wb") >>> file_handle_data = open("test_measurement_" + str(measurement.index) + ".bin", "wb")
file_handle_data.write(raw_data_sonar) >>> file_handle_data.write(raw_data_sonar)
file_handle_data.close() >>> file_handle_data.close()
``` ```
Process that raw measurement to an energyscape using the configuration chosen earlier: Process that raw measurement to an energyscape using the configuration chosen earlier:
```python ```python
processed_measurement = rtisdev.process_measurement(measurement) >>> processed_measurement = rtisdev.process_measurement(measurement)
``` ```
Get a new ACTIVE measurement (protect your ears!) in both raw and processed data formats directly: Get a new ACTIVE measurement (protect your ears!) in both raw and processed data formats directly:
```python ```python
new_processed_measurement = rtisdev.get_processed_measurement(True) >>> new_processed_measurement = rtisdev.get_processed_measurement(True)
plt.imshow(np.transpose(new_processed_measurement.processedData), cmap="hot", interpolation='nearest') >>> plt.imshow(np.transpose(new_processed_measurement.processedData), cmap="hot", interpolation='nearest')
``` ```
Plot the 2D energyscape of this processed measurement using matplotlib: Plot the 2D energyscape of this processed measurement using matplotlib:
```python ```python
plt.xlabel("Directions (degrees)") >>> plt.xlabel("Directions (degrees)")
plt.ylabel("Range (meters)") >>> plt.ylabel("Range (meters)")
indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20) >>> 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) >>> 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) >>> indexes_y = np.arange(0, new_processed_measurement.processedData.shape[1], 100)
labels_y = settings.ranges[indexes_y] >>> labels_y = settings.ranges[indexes_y]
fmt_x = lambda x: "{:.0f}°".format(x) >>> fmt_x = lambda x: "{:.0f}°".format(x)
fmt_y = lambda x: "{:.2f}m".format(x) >>> fmt_y = lambda x: "{:.2f}m".format(x)
plt.xticks(indexes_x, [fmt_x(i) for i in labels_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.yticks(indexes_y, [fmt_y(i) for i in labels_y])
plt.title("RTIS Dev - 2D Energyscape Example") >>> plt.title("RTIS Dev - 2D Energyscape Example")
ax = plt.gca() >>> ax = plt.gca()
ax.invert_yaxis() >>> ax.invert_yaxis()
ax.set_aspect("auto") >>> ax.set_aspect("auto")
plt.show() >>> plt.show()
``` ```
Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly: Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly:
```python ```python
signal_measurement = rtisdev.get_signal_measurement(True) >>> signal_measurement = rtisdev.get_signal_measurement(True)
``` ```
Plot the microphone signals of this measurement: Plot the microphone signals of this measurement:
```python ```python
fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True) >>> fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True)
for microphone_index_i in range(0, 8): >>> for microphone_index_i in range(0, 8):
for microphone_index_j in range(0, 4): ... 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].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),:]) ... axs[microphone_index_i, microphone_index_j].plot(signal_measurement.processedData[microphone_index_j+(microphone_index_i*4),:])
if microphone_index_j != 0: ... if microphone_index_j != 0:
plt.setp(axs[microphone_index_i, microphone_index_j], yticklabels=[]) ... plt.setp(axs[microphone_index_i, microphone_index_j], yticklabels=[])
if microphone_index_i != 7: ... if microphone_index_i != 7:
plt.setp(axs[microphone_index_i, microphone_index_j], xticklabels=[]) ... plt.setp(axs[microphone_index_i, microphone_index_j], xticklabels=[])
if microphone_index_i == 7: ... if microphone_index_i == 7:
axs[microphone_index_i, microphone_index_j].set_xlabel("Time (Samples)") ... axs[microphone_index_i, microphone_index_j].set_xlabel("Time (Samples)")
if microphone_index_j == 0: ... if microphone_index_j == 0:
axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude") ... axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
plt.show() >>> plt.show()
fig.suptitle("RTIS Dev - Microphone Signals") >>> fig.suptitle("RTIS Dev - Microphone Signals")
``` ```
# **Classes** # **Classes**
...@@ -150,7 +150,7 @@ fig.suptitle("RTIS Dev - Microphone Signals") ...@@ -150,7 +150,7 @@ fig.suptitle("RTIS Dev - Microphone Signals")
## **RTISMeasurement** ## **RTISMeasurement**
<p class="func-header"> <p class="func-header">
<i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L368">[source]</a> <i>class</i> <b>RTISMeasurement</b>(<i>id: str='', timestamp: float=0, behaviour: bool=False, index: int=0, rawData: np.ndarray=None, processedData: np.ndarray=None</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L344">[source]</a>
</p> </p>
Class storing all data and information on an RTIS device measurement. Class storing all data and information on an RTIS device measurement.
...@@ -189,10 +189,11 @@ Class storing all data and information on an RTIS device measurement. ...@@ -189,10 +189,11 @@ Class storing all data and information on an RTIS device measurement.
</tbody> </tbody>
</table> </table>
## **RTISSettings** ## **RTISSettings**
<p class="func-header"> <p class="func-header">
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L438">[source]</a> <i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L414">[source]</a>
</p> </p>
Class describing all the processing and recording settings related to RTIS devices. Class describing all the processing and recording settings related to RTIS devices.
...@@ -206,11 +207,10 @@ Can be converted to a dictionary. ...@@ -206,11 +207,10 @@ Can be converted to a dictionary.
</table> </table>
## **MeasureExternalTriggerQueueThread** ## **MeasureExternalTriggerQueueThread**
<p class="func-header"> <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#L662">[source]</a> <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#L638">[source]</a>
</p> </p>
The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger. The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger.
...@@ -228,10 +228,12 @@ Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwe ...@@ -228,10 +228,12 @@ Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwe
</table> </table>
## **MeasureExternalTriggerCallbackThread** ## **MeasureExternalTriggerCallbackThread**
<p class="func-header"> <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#L823">[source]</a> <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#L799">[source]</a>
</p> </p>
The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger. The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger.
...@@ -255,7 +257,7 @@ Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit ...@@ -255,7 +257,7 @@ Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit
## **open_connection** ## **open_connection**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0', allowDebugMode: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2455">[source]</a> <i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0', allowDebugMode: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2431">[source]</a>
</p> </p>
Connect to the port of the RTIS Hardware. Connect to the port of the RTIS Hardware.
...@@ -290,7 +292,7 @@ Connect to the port of the RTIS Hardware. ...@@ -290,7 +292,7 @@ Connect to the port of the RTIS Hardware.
## **close_connection** ## **close_connection**
<p class="func-header"> <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#L2559">[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#L2535">[source]</a>
</p> </p>
Manually close the connection to the RTIS device. Manually close the connection to the RTIS device.
...@@ -316,7 +318,7 @@ be closed gracefully. ...@@ -316,7 +318,7 @@ be closed gracefully.
## **set_recording_settings** ## **set_recording_settings**
<p class="func-header"> <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#L2592">[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#L2568">[source]</a>
</p> </p>
Set the recording settings. All parameters are optional and most have default values. Set the recording settings. All parameters are optional and most have default values.
...@@ -392,7 +394,7 @@ Please read their decription carefully. ...@@ -392,7 +394,7 @@ Please read their decription carefully.
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). 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: Create settings from a premade setup:
```python ```python
rtisdev.set_recording_settings(premade="short_20_80") >>> rtisdev.set_recording_settings(premade="short_20_80")
``` ```
Create settings from a json file. Create settings from a json file.
...@@ -401,20 +403,18 @@ Here we use auto-generated pulse call to emit. ...@@ -401,20 +403,18 @@ Here we use auto-generated pulse call to emit.
More examples can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/). More examples can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/).
An example json: An example json:
```json
{ {
"microphoneSamples" : 294912, "microphoneSamples" : 294912,
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
"callSampleFrequency" : 450000, "callSampleFrequency" : 450000,
"callDuration" : 2.5, "callDuration" : 2.5,
"callMinimumFrequency" : 25000, "callMinimumFrequency" : 25000,
"callMaximumFrequency" : 50000, "callMaximumFrequency" : 50000,
"callEmissions": 1 "callEmissions": 1
} }
```
```python ```python
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json") >>> rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
``` ```
Create settings from a json file. Create settings from a json file.
...@@ -423,37 +423,35 @@ Here we use manually generated call. ...@@ -423,37 +423,35 @@ Here we use manually generated call.
It has to be available on the given path and have the right format. It has to be available on the given path and have the right format.
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv): An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv):
```json
{ {
"microphoneSamples" : 16777216, "microphoneSamples" : 16777216,
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
"callSampleFrequency" : 450000, "callSampleFrequency" : 450000,
"callCustom": "mycall.csv", "callCustom": "mycall.csv",
"callEmissions": 1 "callEmissions": 1
} }
```
```python ```python
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json") >>> rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
``` ```
Create full custom settings with the arguments. All arguments that aren't filled in will use default values: Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
```python ```python
rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000, callMaximumFrequency=80000) >>> rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000, callMaximumFrequency=80000)
``` ```
Load in manually generated call. This requires the file to exist on the path and have the right format. Load in manually generated call. This requires the file to exist on the path and have the right format.
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv): An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv):
```python ```python
rtisdev.set_processing_settings(callCustom="mycall.csv") >>> rtisdev.set_processing_settings(callCustom="mycall.csv")
``` ```
## **set_processing_settings** ## **set_processing_settings**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2779">[source]</a> <i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2742">[source]</a>
</p> </p>
Set the processing settings. All parameters are optional and most have default values. Set the processing settings. All parameters are optional and most have default values.
...@@ -542,20 +540,20 @@ You can get the available premade settings with [`get_premade_recording_settings ...@@ -542,20 +540,20 @@ You can get the available premade settings with [`get_premade_recording_settings
Create settings from a premade setup with all processing steps on: Create settings from a premade setup with all processing steps on:
```python ```python
rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=True) >>> rtisdev.set_processing_settings(premade="3D_5m_3000", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=True, enveloppeEnable=True, cleanEnable=True, preloadToggle=True)
``` ```
You don't have to define all the processing steps, as they are all on by default: You don't have to define all the processing steps, as they are all on by default:
```python ```python
rtisdev.set_processing_settings(premade="3D_5m_3000") >>> rtisdev.set_processing_settings(premade="3D_5m_3000")
``` ```
Create settings from a premade setup with only part of the processing steps enabled and no preloading. 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): 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 ```python
rtisdev.set_processing_settings(premade="2D_5m_181", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=False, enveloppeEnable=False, cleanEnable=False) >>> rtisdev.set_processing_settings(premade="2D_5m_181", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=False, enveloppeEnable=False, cleanEnable=False)
``` ```
Create settings from a json file with full processing settings on. Create settings from a json file with full processing settings on.
...@@ -563,19 +561,17 @@ This expects a json to be available with a format such as seen below. ...@@ -563,19 +561,17 @@ This expects a json to be available with a format such as seen below.
An example of such json files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/). An example of such json files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/).
Here we use auto-generated processing files: Here we use auto-generated processing files:
```json
{ {
"microphoneLayout" : "eRTIS_v3D1", "microphoneLayout" : "eRTIS_v3D1",
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
"minRange" : 0.5, "minRange" : 0.5,
"maxRange" : 5, "maxRange" : 5,
"directions": 181, "directions": 181,
"2D": 1 "2D": 1
} }
```
```python ```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json") >>> rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
``` ```
Create settings from a json file with full processing settings on. Create settings from a json file with full processing settings on.
...@@ -584,24 +580,22 @@ Here we use manually generated processing files. ...@@ -584,24 +580,22 @@ Here we use manually generated processing files.
They have to be available on these paths and have the right format. They have to be available on these paths and have the right format.
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/) as well: An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/) as well:
```json
{ {
"microphoneLayout" : "eRTIS_v3D1", "microphoneLayout" : "eRTIS_v3D1",
"microphoneSampleFrequency" : 4500000, "microphoneSampleFrequency" : 4500000,
"directionsCustom": "./directions.csv", "directionsCustom": "./directions.csv",
"delayMatrixCustom": ".premade/delaymatrix.csv", "delayMatrixCustom": ".premade/delaymatrix.csv",
"rangesCustom": ".premade/ranges.csv" "rangesCustom": ".premade/ranges.csv"
} }
```
```python ```python
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json") >>> rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
``` ```
Create full custom settings with the arguments. All arguments that aren't filled in will use default values: Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
```python ```python
rtisdev.set_processing_settings(mode = 0, directions = 1337, minRange = 0.5, maxRange = 10) >>> rtisdev.set_processing_settings(mode = 0, directions = 1337, minRange = 0.5, maxRange = 10)
``` ```
Load in manually generated processing files. This requires 3 files to exist in the given path: Load in manually generated processing files. This requires 3 files to exist in the given path:
...@@ -610,13 +604,13 @@ microphoneSampleFrequency values correctly as these are absent in these csv file ...@@ -610,13 +604,13 @@ microphoneSampleFrequency values correctly as these are absent in these csv file
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/): An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/):
```python ```python
rtisdev.set_processing_settings(customPath="mysettingsfolder") >>> rtisdev.set_processing_settings(customPath="mysettingsfolder")
``` ```
## **get_current_settings** ## **get_current_settings**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2992">[source]</a> <i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2940">[source]</a>
</p> </p>
Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording. Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording.
...@@ -640,7 +634,7 @@ Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisde ...@@ -640,7 +634,7 @@ Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisde
## **clear_current_settings** ## **clear_current_settings**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3009">[source]</a> <i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2957">[source]</a>
</p> </p>
Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration. Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration.
...@@ -657,7 +651,7 @@ Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-s ...@@ -657,7 +651,7 @@ Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-s
## **get_settings** ## **get_settings**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>get_settings</b>(<i>recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3018">[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, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2966">[source]</a>
</p> </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 Returns an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object with all chosen recording and processing settings based on the
...@@ -787,7 +781,7 @@ the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rt ...@@ -787,7 +781,7 @@ the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rt
## **set_settings_from_class** ## **set_settings_from_class**
<p class="func-header"> <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#L3221">[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#L3169">[source]</a>
</p> </p>
Set the wanted settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object. These can be created Set the wanted settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object. These can be created
...@@ -823,7 +817,7 @@ with the [`get_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev ...@@ -823,7 +817,7 @@ with the [`get_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev
## **get_premade_processing_settings_list** ## **get_premade_processing_settings_list**
<p class="func-header"> <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#L3255">[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#L3203">[source]</a>
</p> </p>
Get a list of names of all the available premade settings for processing. Get a list of names of all the available premade settings for processing.
...@@ -847,7 +841,7 @@ Get a list of names of all the available premade settings for processing. ...@@ -847,7 +841,7 @@ Get a list of names of all the available premade settings for processing.
## **get_premade_recording_settings_list** ## **get_premade_recording_settings_list**
<p class="func-header"> <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#L3270">[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#L3218">[source]</a>
</p> </p>
Get a list of names of all the available premade settings for recording. Get a list of names of all the available premade settings for recording.
...@@ -871,7 +865,7 @@ Get a list of names of all the available premade settings for recording. ...@@ -871,7 +865,7 @@ Get a list of names of all the available premade settings for recording.
## **get_microphone_layout_list** ## **get_microphone_layout_list**
<p class="func-header"> <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#L3285">[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#L3233">[source]</a>
</p> </p>
Get a list of names of all the available microphone layouts that are available for recording. Get a list of names of all the available microphone layouts that are available for recording.
...@@ -895,7 +889,7 @@ Get a list of names of all the available microphone layouts that are available f ...@@ -895,7 +889,7 @@ Get a list of names of all the available microphone layouts that are available f
## **prepare_processing** ## **prepare_processing**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3299">[source]</a> <i>def</i> <b>prepare_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3247">[source]</a>
</p> </p>
Start the CUDA workers for looped measurements with processing enabled. Start the CUDA workers for looped measurements with processing enabled.
...@@ -922,7 +916,7 @@ Furthermore, if using the default settings for processing this is enabled alread ...@@ -922,7 +916,7 @@ Furthermore, if using the default settings for processing this is enabled alread
## **unload_processing** ## **unload_processing**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3326">[source]</a> <i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3274">[source]</a>
</p> </p>
Stop all CUDA workers. Stop all CUDA workers.
...@@ -948,7 +942,7 @@ stopped when your script ends. ...@@ -948,7 +942,7 @@ stopped when your script ends.
## **get_raw_measurement** ## **get_raw_measurement**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3341">[source]</a> <i>def</i> <b>get_raw_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3289">[source]</a>
</p> </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. Start an RTIS sonar measurement and return the raw data in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
...@@ -980,16 +974,16 @@ This means that it will only record and not perform any processing. ...@@ -980,16 +974,16 @@ This means that it will only record and not perform any processing.
Create a connection, set recording settings and make a raw measurement with passive behaviour: Create a connection, set recording settings and make a raw measurement with passive behaviour:
```python ```python
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
measurement = rtisdev.get_raw_measurement(True) >>> measurement = rtisdev.get_raw_measurement(True)
``` ```
## **get_signal_measurement** ## **get_signal_measurement**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3375">[source]</a> <i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3321">[source]</a>
</p> </p>
Start an RTIS sonar measurement and process it with only PDM filtering Start an RTIS sonar measurement and process it with only PDM filtering
...@@ -1023,17 +1017,17 @@ have set. But will still use the other chosen recording and processing settings. ...@@ -1023,17 +1017,17 @@ have set. But will still use the other chosen recording and processing settings.
Create a connection, set recording and processing settings and make a signal measurement with active behaviour: Create a connection, set recording and processing settings and make a signal measurement with active behaviour:
```python ```python
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
signal_measurement = rtisdev.get_signal_measurement(True) >>> signal_measurement = rtisdev.get_signal_measurement(True)
``` ```
## **get_processed_measurement** ## **get_processed_measurement**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3416">[source]</a> <i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3360">[source]</a>
</p> </p>
Start an RTIS sonar measurement and process it and return the raw and processed data Start an RTIS sonar measurement and process it and return the raw and processed data
...@@ -1066,17 +1060,17 @@ Create a connection, set recording and processing settings and make ...@@ -1066,17 +1060,17 @@ Create a connection, set recording and processing settings and make
a processed measurement with active behaviour: a processed measurement with active behaviour:
```python ```python
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
processed_measurement = rtisdev.get_processed_measurement(True) >>> processed_measurement = rtisdev.get_processed_measurement(True)
``` ```
## **process_measurement** ## **process_measurement**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3457">[source]</a> <i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3399">[source]</a>
</p> </p>
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
...@@ -1109,18 +1103,18 @@ Create a connection, set recording and processing settings and make a raw measur ...@@ -1109,18 +1103,18 @@ Create a connection, set recording and processing settings and make a raw measur
Then afterwards process it: Then afterwards process it:
```python ```python
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
measurement = rtisdev.get_raw_measurement(True) >>> measurement = rtisdev.get_raw_measurement(True)
processed_measurement = rtisdev.process_measurement(measurement) >>> processed_measurement = rtisdev.process_measurement(measurement)
``` ```
## **set_counter** ## **set_counter**
<p class="func-header"> <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#L3497">[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#L3437">[source]</a>
</p> </p>
Set the internal measurement counter of the sonar hardware. Set the internal measurement counter of the sonar hardware.
...@@ -1151,7 +1145,7 @@ Set the internal measurement counter of the sonar hardware. ...@@ -1151,7 +1145,7 @@ Set the internal measurement counter of the sonar hardware.
## **set_behaviour** ## **set_behaviour**
<p class="func-header"> <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#L3520">[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#L3460">[source]</a>
</p> </p>
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
...@@ -1185,7 +1179,7 @@ argument to define the sonar behaviour. ...@@ -1185,7 +1179,7 @@ argument to define the sonar behaviour.
## **get_firmware_version** ## **get_firmware_version**
<p class="func-header"> <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#L3545">[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#L3485">[source]</a>
</p> </p>
Get the firmware version of the internal RTIS firmware used on the device. Get the firmware version of the internal RTIS firmware used on the device.
...@@ -1209,7 +1203,7 @@ Get the firmware version of the internal RTIS firmware used on the device. ...@@ -1209,7 +1203,7 @@ Get the firmware version of the internal RTIS firmware used on the device.
## **create_measure_external_trigger_queue** ## **create_measure_external_trigger_queue**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3560">[source]</a> <i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3500">[source]</a>
</p> </p>
This will create and return a Multiprocessing Process This will create and return a Multiprocessing Process
...@@ -1242,22 +1236,22 @@ the RTIS Device and afterwards put this measurement on a data queue. ...@@ -1242,22 +1236,22 @@ the RTIS Device and afterwards put this measurement on a data queue.
Create a queue to save the measurement to and assign it to the process: Create a queue to save the measurement to and assign it to the process:
```python ```python
from multiprocessing import Manager >>> from multiprocessing import Manager
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
manager = Manager() >>> manager = Manager()
dataQueue = manager.Queue() >>> dataQueue = manager.Queue()
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue) >>> measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
measure_thread.start() >>> measure_thread.start()
measure_thread.join() >>> measure_thread.join()
``` ```
## **create_measure_external_trigger_callback** ## **create_measure_external_trigger_callback**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3624">[source]</a> <i>def</i> <b>create_measure_external_trigger_callback</b>(<i>callback: Callable[[ RTISMeasurement], any]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3562">[source]</a>
</p> </p>
This will create and return a Multiprocessing Process This will create and return a Multiprocessing Process
...@@ -1290,28 +1284,28 @@ the RTIS Device and afterwards put this measurement on a data queue. ...@@ -1290,28 +1284,28 @@ the RTIS Device and afterwards put this measurement on a data queue.
Create a callback to save the measurement to disk: Create a callback to save the measurement to disk:
```python ```python
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
index = 0 >>> index = 0
def save_callback(measurement=None): >>> def save_callback(measurement=None):
if measurement is not None : ... if measurement is not None :
if measurement.rawData is not None: ... if measurement.rawData is not None:
data_sonar = measurement.rawData.tobytes() ... data_sonar = measurement.rawData.tobytes()
file_handle_data = open(str(index) + ".bin","wb") ... file_handle_data = open(str(index) + ".bin","wb")
file_handle_data.write(data_sonar) ... file_handle_data.write(data_sonar)
file_handle_data.close() ... file_handle_data.close()
index = index + 1 ... index = index + 1
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback) >>> measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
measure_thread.start() >>> measure_thread.start()
measure_thread.join() >>> measure_thread.join()
``` ```
## **create_processing_workers** ## **create_processing_workers**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3697">[source]</a> <i>def</i> <b>create_processing_workers</b>(<i>workerCount: int, inputQueue: Queue, outputQueue: Queue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3633">[source]</a>
</p> </p>
This will create and return a Multiprocessing Pool that will generate a chosen amount of processing This will create and return a Multiprocessing Pool that will generate a chosen amount of processing
...@@ -1358,27 +1352,27 @@ all these measurements by getting them from the output queue. ...@@ -1358,27 +1352,27 @@ all these measurements by getting them from the output queue.
Once the work is done, terminate the workers gracefully: Once the work is done, terminate the workers gracefully:
```python ```python
from multiprocessing import Manager >>> from multiprocessing import Manager
import rtisdev >>> import rtisdev
rtisdev.open_connection() >>> rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50") >>> rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181") >>> rtisdev.set_processing_settings(premade="2D_5m_181")
manager = Manager() >>> manager = Manager()
inputQueue = manager.Queue() >>> inputQueue = manager.Queue()
outputQueue = manager.Queue() >>> outputQueue = manager.Queue()
workersPool = rtisdev.create_processing_workers(4, inputQueue, outputQueue) >>> workersPool = rtisdev.create_processing_workers(4, inputQueue, outputQueue)
for measurement_index in range(0, 30): >>> for measurement_index in range(0, 30):
measurement = rtisdev.get_raw_measurement() ... measurement = rtisdev.get_raw_measurement()
inputQueue.put(measurement) ... inputQueue.put(measurement)
for measurement_index in range(0, 30): >>> for measurement_index in range(0, 30):
measurement = outputQueue.get() ... measurement = outputQueue.get()
workersPool.terminate() >>> workersPool.terminate()
``` ```
## **toggle_amplifier** ## **toggle_amplifier**
<p class="func-header"> <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#L3763">[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#L3697">[source]</a>
</p> </p>
Enable/disable the high voltage amplifier's step up controller. Enable/disable the high voltage amplifier's step up controller.
...@@ -1411,7 +1405,7 @@ This will save on power usage and heat production. ...@@ -1411,7 +1405,7 @@ This will save on power usage and heat production.
## **toggle_external_triggers** ## **toggle_external_triggers**
<p class="func-header"> <p class="func-header">
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3785">[source]</a> <i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3719">[source]</a>
</p> </p>
Enable/disable external triggers being able to start a measurement on the RTIS device. Enable/disable external triggers being able to start a measurement on the RTIS device.
...@@ -1443,7 +1437,7 @@ They are disabled by default so have to be manually enabled. ...@@ -1443,7 +1437,7 @@ They are disabled by default so have to be manually enabled.
## **reset_device** ## **reset_device**
<p class="func-header"> <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#L3806">[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#L3740">[source]</a>
</p> </p>
The function to reset the RTIS device hardware. The function to reset the RTIS device hardware.
...@@ -1474,7 +1468,7 @@ The function to reset the RTIS device hardware. ...@@ -1474,7 +1468,7 @@ The function to reset the RTIS device hardware.
## **set_log_mode** ## **set_log_mode**
<p class="func-header"> <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#L3852">[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#L3786">[source]</a>
</p> </p>
The function to set the logging level of the RTIS Dev module. The function to set the logging level of the RTIS Dev module.
...@@ -1498,7 +1492,7 @@ The function to set the logging level of the RTIS Dev module. ...@@ -1498,7 +1492,7 @@ The function to set the logging level of the RTIS Dev module.
## **set_custom_logger** ## **set_custom_logger**
<p class="func-header"> <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#L3880">[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#L3814">[source]</a>
</p> </p>
The function to set a custom logger to be used by RTIS Dev. 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
    • clear_current_settings
    • get_settings
    • set_settings_from_class
    • get_premade_processing_settings_list
    • get_premade_recording_settings_list
    • get_microphone_layout_list
    • prepare_processing
    • unload_processing
    • get_raw_measurement
    • get_signal_measurement
    • get_processed_measurement
    • process_measurement
    • set_counter
    • set_behaviour
    • get_firmware_version
    • create_measure_external_trigger_queue
    • create_measure_external_trigger_callback
    • create_processing_workers
    • toggle_amplifier
    • toggle_external_triggers
    • reset_device
    • set_log_mode
    • set_custom_logger