... | ... | @@ -4,6 +4,7 @@ |
|
|
- [Classes](#classes)
|
|
|
- [RTISMeasurement](#rtismeasurement)
|
|
|
- [RTISSettings](#rtissettings)
|
|
|
- [TimeStampRecorderProcess](#timestamprecorderprocess)
|
|
|
- [MeasureExternalTriggerQueueThread](#measureexternaltriggerqueuethread)
|
|
|
- [MeasureExternalTriggerCallbackThread](#measureexternaltriggercallbackthread)
|
|
|
- [Methods](#methods)
|
... | ... | @@ -44,37 +45,64 @@ Here is a small example that goes over most basic steps: |
|
|
import rtisdev
|
|
|
import matplotlib.pyplot as plt
|
|
|
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
|
|
|
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
|
|
|
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
|
|
|
with a maximum distance of 5m:
|
|
|
|
|
|
# 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.
|
|
|
```python
|
|
|
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
|
|
|
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
|
|
|
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
|
|
|
raw_data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open("test_measurement_" + str(measurement.index) + ".bin", "wb")
|
|
|
file_handle_data.write(raw_data_sonar)
|
|
|
file_handle_data.close()
|
|
|
```
|
|
|
|
|
|
# Process that raw measurement to an energyscape using the configuration chosen earlier.
|
|
|
Process that raw measurement to an energyscape using the configuration chosen earlier:
|
|
|
|
|
|
```python
|
|
|
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
|
|
|
new_processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
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
|
|
|
plt.xlabel("Directions (degrees)")
|
|
|
plt.ylabel("Range (meters)")
|
|
|
indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20)
|
... | ... | @@ -90,11 +118,17 @@ ax = plt.gca() |
|
|
ax.invert_yaxis()
|
|
|
ax.set_aspect("auto")
|
|
|
plt.show()
|
|
|
```
|
|
|
|
|
|
# Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly.
|
|
|
Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly:
|
|
|
|
|
|
```python
|
|
|
signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
```
|
|
|
|
|
|
# Plot the microphone signals of this measurement.
|
|
|
Plot the microphone signals of this measurement:
|
|
|
|
|
|
```python
|
|
|
fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True)
|
|
|
for microphone_index_i in range(0, 8):
|
|
|
for microphone_index_j in range(0, 4):
|
... | ... | @@ -117,7 +151,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#L320">[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#L368">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class storing all data and information on an RTIS device measurement.
|
... | ... | @@ -159,7 +193,7 @@ Class storing all data and information on an RTIS device measurement. |
|
|
## **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#L389">[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#L438">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Class describing all the processing and recording settings related to RTIS devices.
|
... | ... | @@ -174,41 +208,57 @@ Can be converted to a dictionary. |
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## **MeasureExternalTriggerQueueThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerQueueThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L544">[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#L662">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the data queue correctly use `set_queue(dataQueue)` function.
|
|
|
the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects will then be put on this queue.
|
|
|
To start the process use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
By default, using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_queue) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
## **MeasureExternalTriggerCallbackThread**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>class</i> <b>MeasureExternalTriggerCallbackThread</b>(<i>*args, **kwargs</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L688">[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#L823">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The class based on a Multiprocessing Process to start RTIS sonar measurements triggered by an external trigger.
|
|
|
To set the callback function correctly use `set_callback(callback)` function.
|
|
|
Your callback function should only have one argument, the [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) data package.
|
|
|
To start the process use the `start()` function. To stop use the `stop_thread()` function.
|
|
|
By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
By default, using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) will gracefully end the script.
|
|
|
|
|
|
Use [`create_measure_external_trigger_callback(save_callback)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_callback) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
# **Methods**
|
|
|
|
|
|
## **open_connection**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>open_connection</b>(<i>port: 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#L2199">[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#L2455">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Connect to the port of the RTIS Hardware.
|
... | ... | @@ -225,7 +275,7 @@ Connect to the port of the RTIS Hardware. |
|
|
</p>
|
|
|
<b>allowDebugMode : <i>bool (default = False)</i></b>
|
|
|
<p class="attr">
|
|
|
When enabled, if a connection can not be made to a real RTIS Device to the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing a exception. This is mostly for debugging and testing of the library.
|
|
|
When enabled, if a connection can not be made to a real RTIS Device to the chosen port, it will instead automatically go into a debug mode where a virtual RTIS device is used instead of throwing an exception. This is mostly for debugging and testing of the library.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
... | ... | @@ -243,7 +293,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#L2260">[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#L2559">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Manually close the connection to the RTIS device.
|
... | ... | @@ -269,7 +319,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#L2289">[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#L2592">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the recording settings. All parameters are optional and most have default values.
|
... | ... | @@ -303,7 +353,7 @@ Please read their decription carefully. |
|
|
</p>
|
|
|
<b>callSampleFrequency : <i>int (default = 450000)</i></b>
|
|
|
<p class="attr">
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
The chosen sample frequency of the call. Must be larger than 160 KHz and smaller than 2 MHz.
|
|
|
</p>
|
|
|
<b>callDuration : <i>float (default = 2.5)</i></b>
|
|
|
<p class="attr">
|
... | ... | @@ -342,9 +392,8 @@ Please read their decription carefully. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list).
|
|
|
|
|
|
Create settings from a premade setup:
|
|
|
```python
|
|
|
rtisdev.set_recording_settings(premade="short_20_80")
|
|
|
```
|
... | ... | @@ -352,16 +401,18 @@ rtisdev.set_recording_settings(premade="short_20_80") |
|
|
Create settings from a json file.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated pulse call to emit.
|
|
|
More examples can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/).
|
|
|
An example json:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 294912,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callDuration" : 2.5,
|
|
|
"callMinimumFrequency" : 25000,
|
|
|
"callMaximumFrequency" : 50000,
|
|
|
"callEmissions": 1
|
|
|
"microphoneSamples" : 294912,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callDuration" : 2.5,
|
|
|
"callMinimumFrequency" : 25000,
|
|
|
"callMaximumFrequency" : 50000,
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
... | ... | @@ -373,15 +424,15 @@ Create settings from a json file. |
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated call.
|
|
|
It has to be available on the given path and have the right format.
|
|
|
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv).
|
|
|
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv):
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 16777216,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callCustom": "mycall.csv",
|
|
|
"callEmissions": 1
|
|
|
"microphoneSamples" : 16777216,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"callSampleFrequency" : 450000,
|
|
|
"callCustom": "mycall.csv",
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
... | ... | @@ -389,15 +440,14 @@ An example of such a custom call can be found [here](https://cosysgit.uantwerpen |
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(microphoneSamples=294912, callDuration=3, callMinimumFrequency=25000,
|
|
|
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.
|
|
|
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
|
|
|
rtisdev.set_processing_settings(callCustom="mycall.csv")
|
... | ... | @@ -406,7 +456,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#L2475">[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#L2779">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the processing settings. All parameters are optional and most have default values.
|
... | ... | @@ -491,40 +541,39 @@ Please read their decription carefully. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create settings from a premade setup with all processing steps on.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list).
|
|
|
Create settings from a premade setup with all processing steps on:
|
|
|
|
|
|
```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
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000")
|
|
|
```
|
|
|
|
|
|
Create settings from a premade setup with only part of the processing steps enabled and no preloading.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](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
|
|
|
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.
|
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use auto-generated processing files.
|
|
|
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:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"minRange" : 0.5,
|
|
|
"maxRange" : 5,
|
|
|
"directions": 181,
|
|
|
"2D": 1
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"minRange" : 0.5,
|
|
|
"maxRange" : 5,
|
|
|
"directions": 181,
|
|
|
"2D": 1
|
|
|
}
|
|
|
```
|
|
|
|
... | ... | @@ -536,15 +585,15 @@ Create settings from a json file with full processing settings on. |
|
|
This expects a json to be available with a format such as seen below.
|
|
|
Here we use manually generated processing files.
|
|
|
They have to be available on these paths and have the right format.
|
|
|
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/).
|
|
|
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",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"directionsCustom": "./directions.csv",
|
|
|
"delayMatrixCustom": ".premade/delaymatrix.csv",
|
|
|
"rangesCustom": ".premade/ranges.csv"
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"microphoneSampleFrequency" : 4500000,
|
|
|
"directionsCustom": "./directions.csv",
|
|
|
"delayMatrixCustom": ".premade/delaymatrix.csv",
|
|
|
"rangesCustom": ".premade/ranges.csv"
|
|
|
}
|
|
|
```
|
|
|
|
... | ... | @@ -552,15 +601,16 @@ An example of such custom processing files can be found [here](https://cosysgit. |
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values.
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(mode = 0, directions = 1337, minRange = 0.5, maxRange = 10)
|
|
|
```
|
|
|
|
|
|
Load in manually generated processing files. This requires 3 files to exist in the given path:
|
|
|
delaymatrix.csv, directions.csv and ranges.csv.
|
|
|
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/).
|
|
|
delaymatrix.csv, directions.csv and ranges.csv. Don't forget to also perhaps set the microphoneLayout and
|
|
|
microphoneSampleFrequency values correctly as these are absent in these csv files!
|
|
|
An example of such custom processing files can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/processing/):
|
|
|
|
|
|
```python
|
|
|
rtisdev.set_processing_settings(customPath="mysettingsfolder")
|
... | ... | @@ -569,7 +619,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#L2688">[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#L2992">[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.
|
... | ... | @@ -593,7 +643,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#L2705">[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#L3009">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Clear the current applied [`RTISSettings`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtissettings) configuration.
|
... | ... | @@ -610,7 +660,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#L2714">[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#L3018">[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
|
... | ... | @@ -658,11 +708,11 @@ the [`set_recording_settings()`](https://cosysgit.uantwerpen.be/rtis-software/rt |
|
|
</p>
|
|
|
<b>callSampleFrequency : <i>int (default = 450000)</i></b>
|
|
|
<p class="attr">
|
|
|
The chosen sample frequency of the call. Must by larger then 160 KHz and smaller then 2 MHz.
|
|
|
The chosen sample frequency of the call. Must be larger than 160 KHz and smaller than 2 MHz.
|
|
|
</p>
|
|
|
<b>callDuration : <i>float (default = 2.5)</i></b>
|
|
|
<p class="attr">
|
|
|
The duration in miliseconds of the call.
|
|
|
The duration in milliseconds of the call.
|
|
|
</p>
|
|
|
<b>callMinimumFrequency : <i>int (default = 25000)</i></b>
|
|
|
<p class="attr">
|
... | ... | @@ -740,7 +790,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#L2915">[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#L3221">[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
|
... | ... | @@ -776,7 +826,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#L2949">[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#L3255">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get a list of names of all the available premade settings for processing.
|
... | ... | @@ -800,7 +850,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#L2964">[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#L3270">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get a list of names of all the available premade settings for recording.
|
... | ... | @@ -824,7 +874,7 @@ Get a list of names of all the available premade settings for recording. |
|
|
## **get_microphone_layout_list**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>get_microphone_layout_list</b>(<i></i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L2978">[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#L3285">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get a list of names of all the available microphone layouts that are available for recording.
|
... | ... | @@ -848,11 +898,11 @@ Get a list of names of all the available microphone layouts that are available f |
|
|
## **prepare_processing**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>prepare_processing</b>(<i></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>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>
|
|
|
</p>
|
|
|
|
|
|
Start the CUDA workers for looped measurements with processing enabled.
|
|
|
It is not required to run this method for doing processing but it will speed up the workflow
|
|
|
It is not required to run this method for doing processing, but it will speed up the workflow
|
|
|
significantly if doing many processed measurements at a high frequency.
|
|
|
Furthermore, if using the default settings for processing this is enabled already.
|
|
|
|
... | ... | @@ -875,7 +925,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#L3019">[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#L3326">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop all CUDA workers.
|
... | ... | @@ -901,7 +951,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#L3034">[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#L3341">[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.
|
... | ... | @@ -930,13 +980,10 @@ This means that it will only record and not perform any processing. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording settings and make a raw measurement with passive behaviour.
|
|
|
Create a connection, set recording settings and make a raw measurement with passive behaviour:
|
|
|
|
|
|
```python
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
|
|
|
import rtisdev
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
... | ... | @@ -945,7 +992,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#L3071">[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#L3375">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start an RTIS sonar measurement and process it with only PDM filtering
|
... | ... | @@ -976,11 +1023,10 @@ have set. But will still use the other chosen recording and processing settings. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a signal measurement with active behaviour.
|
|
|
Create a connection, set recording and processing settings and make a signal measurement with active behaviour:
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
... | ... | @@ -990,7 +1036,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#L3113">[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#L3416">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Start an RTIS sonar measurement and process it and return the raw and processed data
|
... | ... | @@ -1019,11 +1065,11 @@ in an [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/- |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a processed measurement with active behaviour.
|
|
|
Create a connection, set recording and processing settings and make
|
|
|
a processed measurement with active behaviour:
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
... | ... | @@ -1033,7 +1079,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#L3154">[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#L3457">[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
|
... | ... | @@ -1063,11 +1109,10 @@ and return same measurement with processed data in a new [`RTISMeasurement`](htt |
|
|
#### Examples
|
|
|
|
|
|
Create a connection, set recording and processing settings and make a raw measurement with active behaviour.
|
|
|
Then afterwards process it.
|
|
|
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")
|
... | ... | @@ -1078,7 +1123,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#L3195">[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#L3497">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the internal measurement counter of the sonar hardware.
|
... | ... | @@ -1109,7 +1154,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#L3218">[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#L3520">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the behaviour of the sonar hardware to passive or active. This is only necessary if using external
|
... | ... | @@ -1143,7 +1188,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#L3243">[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#L3545">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get the firmware version of the internal RTIS firmware used on the device.
|
... | ... | @@ -1167,7 +1212,7 @@ Get the firmware version of the internal RTIS firmware used on the device. |
|
|
## **create_measure_external_trigger_queue**
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i>def</i> <b>create_measure_external_trigger_queue</b>(<i>dataQueue: Queue </i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L3258">[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#L3560">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Multiprocessing Process
|
... | ... | @@ -1187,7 +1232,7 @@ the RTIS Device and afterwards put this measurement on a data queue. |
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerQueueThread</i></b>
|
|
|
<td class="field-body" width="100%"><b>measure_process : <i>MeasureExternalTriggerQueueThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Multiprocessing Process super class that can then be started with '.start()' and waited for with <code>.join()</code> for example. It can be closed gracefully with the '.stop_thread()' function. This will also be done automatically when <code>signal.SIGINT</code> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
... | ... | @@ -1197,19 +1242,16 @@ the RTIS Device and afterwards put this measurement on a data queue. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
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
|
|
|
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()
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
... | ... | @@ -1218,7 +1260,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#L3302">[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#L3624">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Multiprocessing Process
|
... | ... | @@ -1238,7 +1280,7 @@ the RTIS Device and afterwards put this measurement on a data queue. |
|
|
</tr>
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Returns:</b></td>
|
|
|
<td class="field-body" width="100%"><b>th : <i>MeasureExternalTriggerCallbackThread</i></b>
|
|
|
<td class="field-body" width="100%"><b>measure_process : <i>MeasureExternalTriggerCallbackThread</i></b>
|
|
|
<p class="attr">
|
|
|
Class instance of the Multiprocessing Process super class that can then be started with <code>.start()</code> and waited for with <code>.join()</code> for example. It can be closed gracefully with the <code>.stop_thread()</code> function. This will also be done automatically when <em>signal.SIGINT</em> (ex. <kbd>CTRL</kbd>+<kbd>C</kbd>) is triggered.
|
|
|
</p></td>
|
... | ... | @@ -1248,26 +1290,22 @@ the RTIS Device and afterwards put this measurement on a data queue. |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a callback to save the measurement to disk.
|
|
|
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):
|
|
|
if measurement != None:
|
|
|
if measurement is not None :
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
... | ... | @@ -1276,10 +1314,10 @@ 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#L3356">[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#L3697">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
This will create and return a Multiprocessing Pool that will generating a chosen amount of processing
|
|
|
This will create and return a Multiprocessing Pool that will generate a chosen amount of processing
|
|
|
workers to handle incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on the input Multiprocessing Queue
|
|
|
and after processing place them on the output Multiprocessing Queue.
|
|
|
|
... | ... | @@ -1318,42 +1356,37 @@ potential crash of RTIS Dev! |
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create the data queues, setup the worker pool with 4 workers, generate some measurements and afterwards parse
|
|
|
Create the data queues, set up 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.
|
|
|
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#L3429">[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#L3763">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable the high voltage amplifier's step up controller.
|
|
|
It is enabled by default so has to be manually disabled if wanted. This will save on power usage and heat production.
|
|
|
It is enabled by default so has to be manually disabled if wanted.
|
|
|
This will save on power usage and heat production.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
... | ... | @@ -1363,7 +1396,7 @@ It is enabled by default so has to be manually disabled if wanted. This will sav |
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the amplifier mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
the amplifier mode chosen. <code>False</code> = disable, <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
... | ... | @@ -1381,7 +1414,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#L3452">[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#L3785">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Enable/disable external triggers being able to start a measurement on the RTIS device.
|
... | ... | @@ -1395,7 +1428,7 @@ They are disabled by default so have to be manually enabled. |
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>bool</i></b>
|
|
|
<p class="attr">
|
|
|
the external trigger mode chosen. <code>False</code> = disable <code>True</code> = enable
|
|
|
the external trigger mode chosen.<code>False</code> = disable, <code>True</code> = enable
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
<tr class="field">
|
... | ... | @@ -1413,7 +1446,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#L3475">[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#L3806">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to reset the RTIS device hardware.
|
... | ... | @@ -1444,7 +1477,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#L3523">[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#L3852">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set the logging level of the RTIS Dev module.
|
... | ... | @@ -1457,7 +1490,7 @@ The function to set the logging level of the RTIS Dev module. |
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>mode : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
Disable or configure log the level. 0 = off 1 = only warnings and errors 2(default) = includes info 3 = includes debug
|
|
|
Disable or configure log the level. 0 = off, 1 = only warnings and errors, 2(default) = includes info, 3 = includes debug
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
... | ... | @@ -1468,7 +1501,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#L3554">[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#L3880">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
The function to set a custom logger to be used by RTIS Dev.
|
... | ... | |