Skip to content

GitLab

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

Home · Changes

Page history
Update home authored Feb 07, 2022 by Wouter Jansen's avatar Wouter Jansen
Hide whitespace changes
Inline Side-by-side
home.md
View page @ a44fe7f9
......@@ -17,6 +17,7 @@
- [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)
......@@ -28,6 +29,7 @@
- [get_firmware_version](#get_firmware_version)
- [create_measure_external_trigger_queue](#create_measure_external_trigger_queue)
- [create_measure_external_trigger_callback](#create_measure_external_trigger_callback)
- [create_processing_workers](#create_processing_workers)
- [toggle_amplifier](#toggle_amplifier)
- [toggle_external_triggers](#toggle_external_triggers)
- [reset_device](#reset_device)
......@@ -115,7 +117,7 @@ fig.suptitle("RTIS Dev - Microphone Signals")
## **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</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L303">[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#L321">[source]</a>
</p>
Class storing all data and information on an RTIS device measurement.
......@@ -161,7 +163,7 @@ Class storing all data and information on an RTIS device measurement.
<p class="func-header">
<i></i> <b>update_processed_data</b>(<i>self, processedData: np.ndarray</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L359">[source]</a>
<i></i> <b>update_processed_data</b>(<i>self, processedData: np.ndarray</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L377">[source]</a>
</p>
If only the attribute `processedData` needs to be updated, use this function.
......@@ -185,7 +187,7 @@ If only the attribute `processedData` needs to be updated, use this function.
## **RTISSettings**
<p class="func-header">
<i>class</i> <b>RTISSettings</b>(<i>firmwareVersion, configName=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L372">[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#L390">[source]</a>
</p>
Class describing all the processing and recording settings related to RTIS devices.
......@@ -202,7 +204,7 @@ Can be converted to a dictionary.
## **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#L527">[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#L545">[source]</a>
</p>
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
......@@ -225,7 +227,12 @@ Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwe
Create a queue to save the measurement to and assign it to the thread.
```python
from multiprocessing import Process, Manager
from multiprocessing import Manager
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
manager = Manager()
dataQueue = manager.Queue()
......@@ -240,7 +247,7 @@ measure_thread.join()
<p class="func-header">
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L558">[source]</a>
<i></i> <b>set_queue</b>(<i>self, dataQueue</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L581">[source]</a>
</p>
Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on.
......@@ -264,7 +271,7 @@ Set the dataQueue to be used by the Thread to store the incoming [`RTISMeasureme
<p class="func-header">
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L569">[source]</a>
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L592">[source]</a>
</p>
Stop the measurement thread gracefully.
......@@ -281,7 +288,7 @@ Stop the measurement thread gracefully.
<p class="func-header">
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L576">[source]</a>
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L599">[source]</a>
</p>
Get status of the thread if it should be stopped or not.
......@@ -298,7 +305,7 @@ Get status of the thread if it should be stopped or not.
<p class="func-header">
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L582">[source]</a>
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L605">[source]</a>
</p>
Main thread function to run continuously. Should not be used. Use `start()` instead.
......@@ -315,7 +322,7 @@ Main thread function to run continuously. Should not be used. Use `start()` inst
## **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#L630">[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#L653">[source]</a>
</p>
The class based on a Thread to start RTIS sonar measurements triggered by an external trigger.
......@@ -324,7 +331,7 @@ Your callback function should only have one argument, the [`RTISMeasurement`](ht
To start the thread use the `start()` function. To stop use the `stop_thread()` function.
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_callback) to make an easy to use the class.
Use `create_measure_external_trigger_callback(callback)` to make an easy to use the class.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
......@@ -338,6 +345,12 @@ Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit
Create a callback to save the measurement to disk.
```python
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
index = 0
def save_callback(measurement=None):
......@@ -359,7 +372,7 @@ measure_thread.join()
<p class="func-header">
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L667">[source]</a>
<i></i> <b>set_callback</b>(<i>self, callback</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L696">[source]</a>
</p>
......@@ -383,7 +396,7 @@ measure_thread.join()
<p class="func-header">
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L678">[source]</a>
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L707">[source]</a>
</p>
Stop the measurement thread gracefully.
......@@ -400,7 +413,7 @@ Stop the measurement thread gracefully.
<p class="func-header">
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L685">[source]</a>
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L714">[source]</a>
</p>
Get status of the thread if it should be stopped or not.
......@@ -417,7 +430,7 @@ Get status of the thread if it should be stopped or not.
<p class="func-header">
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L691">[source]</a>
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L720">[source]</a>
</p>
Main thread function to run continuously. Should not be used. Use `start()` instead.
......@@ -436,7 +449,7 @@ Main thread function to run continuously. Should not be used. Use `start()` inst
## **open_connection**
<p class="func-header">
<i>def</i> <b>open_connection</b>(<i>port: string='/dev/ttyACM0', allowDebugMode: bool=False </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2011">[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#L2129">[source]</a>
</p>
Connect to the port of the RTIS Hardware.
......@@ -471,7 +484,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#L2072">[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#L2190">[source]</a>
</p>
Manually close the connection to the RTIS device.
......@@ -497,7 +510,7 @@ be closed gracefully.
## **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#L2101">[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#L2219">[source]</a>
</p>
Set the recording settings. All parameters are optional and most have default values.
......@@ -634,7 +647,7 @@ rtisdev.set_processing_settings(callCustom="mycall.csv")
## **set_processing_settings**
<p class="func-header">
<i>def</i> <b>set_processing_settings</b>(<i>premade: str=None, jsonPath: str=None, customPath: str=None, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, microphoneSampleFrequency: int=4500000, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2287">[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#L2405">[source]</a>
</p>
Set the processing settings. All parameters are optional and most have default values.
......@@ -797,7 +810,7 @@ rtisdev.set_processing_settings(customPath="mysettingsfolder")
## **get_current_settings**
<p class="func-header">
<i>def</i> <b>get_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2500">[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#L2618">[source]</a>
</p>
Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object of the current settings for processing and recording.
......@@ -821,7 +834,7 @@ Returns the [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisde
## **clear_current_settings**
<p class="func-header">
<i>def</i> <b>clear_current_settings</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2517">[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#L2635">[source]</a>
</p>
Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration.
......@@ -838,7 +851,7 @@ Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-s
## **get_settings**
<p class="func-header">
<i>def</i> <b>get_settings</b>(<i>recordingPremade: str=None, recordingJsonPath: str=None, recordingCallCustom: str=None, processingPremade: str=None, processingJsonPath: str=None, processingCustomPath: str=None, microphoneSamples: int=163840, microphoneSampleFrequency: int=4500000, callSampleFrequency: int=450000, callDuration: float=2.5, callMinimumFrequency: int=25000, callMaximumFrequency: int=50000, callEmissions: int=1, microphoneLayout: str='eRTIS_v3D1', mode: int=1, directions: int=181, minRange: float=0.5, maxRange: float=5, pdmEnable: bool=True, matchedFilterEnable: bool=True, beamformingEnable: bool=True, enveloppeEnable: bool=True, cleanEnable: bool=True, preloadToggle: bool =True, configName: str=''</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2526">[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#L2644">[source]</a>
</p>
Returns an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object with all chosen recording and processing settings based on the
......@@ -968,7 +981,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#L2727">[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#L2845">[source]</a>
</p>
Set the wanted settings from an [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) object. These can be created
......@@ -1004,7 +1017,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#L2761">[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#L2879">[source]</a>
</p>
Get a list of names of all the available premade settings for processing.
......@@ -1028,7 +1041,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#L2776">[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#L2894">[source]</a>
</p>
Get a list of names of all the available premade settings for recording.
......@@ -1049,10 +1062,34 @@ 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#L2908">[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></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2790">[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#L2922">[source]</a>
</p>
Start the CUDA workers for looped measurements with processing enabled.
......@@ -1079,7 +1116,7 @@ Furthermore, if using the default settings for processing this is enabled alread
## **unload_processing**
<p class="func-header">
<i>def</i> <b>unload_processing</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2817">[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#L2949">[source]</a>
</p>
Stop all CUDA workers.
......@@ -1105,7 +1142,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</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2832">[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#L2964">[source]</a>
</p>
Start an RTIS sonar measurement and return the raw data in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object.
......@@ -1137,6 +1174,10 @@ 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.
```python
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
measurement = rtisdev.get_raw_measurement(True)
......@@ -1145,7 +1186,7 @@ measurement = rtisdev.get_raw_measurement(True)
## **get_signal_measurement**
<p class="func-header">
<i>def</i> <b>get_signal_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2865">[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#L3001">[source]</a>
</p>
Start an RTIS sonar measurement and process it with only PDM filtering
......@@ -1179,6 +1220,8 @@ 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.
```python
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
......@@ -1188,7 +1231,7 @@ signal_measurement = rtisdev.get_signal_measurement(True)
## **get_processed_measurement**
<p class="func-header">
<i>def</i> <b>get_processed_measurement</b>(<i>behaviour: bool=False</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2905">[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#L3043">[source]</a>
</p>
Start an RTIS sonar measurement and process it and return the raw and processed data
......@@ -1220,6 +1263,8 @@ in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-
Create a connection, set recording and processing settings and make a processed measurement with active behaviour.
```python
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
......@@ -1229,7 +1274,7 @@ processed_measurement = rtisdev.get_processed_measurement(True)
## **process_measurement**
<p class="func-header">
<i>def</i> <b>process_measurement</b>(<i>measurement: RTISMeasurement</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2944">[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#L3084">[source]</a>
</p>
Process a previously recorded raw RTIS sonar measurement from a [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) object
......@@ -1262,6 +1307,8 @@ Create a connection, set recording and processing settings and make a raw measur
Then afterwards process it.
```python
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
......@@ -1272,7 +1319,7 @@ processed_measurement = rtisdev.process_measurement(measurement)
## **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#L2983">[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#L3125">[source]</a>
</p>
Set the internal measurement counter of the sonar hardware.
......@@ -1303,7 +1350,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#L3006">[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#L3148">[source]</a>
</p>
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
......@@ -1337,7 +1384,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#L3031">[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#L3173">[source]</a>
</p>
Get the firmware version of the internal RTIS firmware used on the device.
......@@ -1361,7 +1408,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 </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3046">[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#L3188">[source]</a>
</p>
This will create and return a Thread that will be waiting for an external trigger to measure from
......@@ -1393,7 +1440,12 @@ 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 thread.
```python
from multiprocessing import Process, Manager
from multiprocessing import Manager
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
manager = Manager()
dataQueue = manager.Queue()
......@@ -1406,7 +1458,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]</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3084">[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#L3231">[source]</a>
</p>
This will create and return a Thread that will be waiting for an external trigger to measure from
......@@ -1438,6 +1490,12 @@ the RTIS Device and afterwards put this measurement on a data queue.
Create a callback to save the measurement to disk.
```python
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
index = 0
def save_callback(measurement=None):
......@@ -1454,10 +1512,81 @@ 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</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3284">[source]</a>
</p>
This will create and return a Multiprocessing Pool that will generating a chosen amount of processing
workers to handle incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on the input Multiprocessing Queue and after processing
place them on the output Multiprocessing Queue.
Please disable 'preloadToggle' or make sure to not use 'prepare_processing()' before this point as it will
cause an error to prevent crashing.
<table class="docutils field-list field-table" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field">
<th class="field-name"><b>Parameters:</b></td>
<td class="field-body" width="100%"><b>workerCount : <i>int</i></b>
<p class="attr">
The amount of worker processes to create and keep active in the Pool.
</p>
<b>inputQueue : <i>multiprocessing.Manager.Queue</i></b>
<p class="attr">
This is the data queue that will be used to receive the recorded <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
</p>
<b>outputQueue : <i>multiprocessing.Manager.Queue</i></b>
<p class="attr">
This is the data queue that will be used to store the processed <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> objects on.
</p></td>
</tr>
<tr class="field">
<th class="field-name"><b>Returns:</b></td>
<td class="field-body" width="100%"><b>workersPool : <i>multiprocessing.Pool</i></b>
<p class="attr">
Class instance of the Pool super class. It can be closed gracefully with the <code>.terminate()</code> function. This will also be done automatically when <em>signal.SIGINT</em> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered. The workers will be automatically started when calling this function.
</p></td>
</tr>
</tbody>
</table>
#### Examples
Create the data queues, setup the worker pool with 4 workers, generate some measurements and afterwards parse
all these measurements by getting them from the output queue.
Once the work is done, terminate the workers gracefully.
```python
from multiprocessing import Manager
import rtisdev
rtisdev.open_connection()
rtisdev.set_recording_settings(premade="default_25_50")
rtisdev.set_processing_settings(premade="2D_5m_181")
manager = Manager()
inputQueue = manager.Queue()
outputQueue = manager.Queue()
workersPool = rtisdev.create_processing_workers(4, inputQueue, outputQueue)
for measurement_index in range(0, 30):
measurement = rtisdev.get_raw_measurement()
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#L3131">[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#L3355">[source]</a>
</p>
Enable/disable the high voltage amplifier's step up controller.
......@@ -1489,7 +1618,7 @@ It is enabled by default so has to be manually disabled if wanted. This will sav
## **toggle_external_triggers**
<p class="func-header">
<i>def</i> <b>toggle_external_triggers</b>(<i>mode: bool</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3154">[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#L3378">[source]</a>
</p>
Enable/disable external triggers being able to start a measurement on the RTIS device.
......@@ -1521,7 +1650,7 @@ They are disabled by default so have to be manually enabled.
## **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#L3177">[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#L3401">[source]</a>
</p>
The function to reset the RTIS device hardware.
......@@ -1552,7 +1681,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#L3225">[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#L3449">[source]</a>
</p>
The function to set the logging level of the RTIS Dev module.
......@@ -1576,7 +1705,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#L3255">[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#L3480">[source]</a>
</p>
The function to set a custom logger to be used by RTIS Dev.
......@@ -1589,7 +1718,7 @@ The function to set a custom logger to be used by RTIS Dev.
<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>
......
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
    • 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
    • toggle_amplifier
    • toggle_external_triggers
    • reset_device
    • set_log_mode
    • set_custom_logger