... | ... | @@ -41,108 +41,108 @@ |
|
|
Here is a small example that goes over most basic steps:
|
|
|
|
|
|
```python
|
|
|
>>> import rtisdev
|
|
|
>>> import matplotlib.pyplot as plt
|
|
|
>>> import numpy as np
|
|
|
import rtisdev
|
|
|
import matplotlib.pyplot as plt
|
|
|
import numpy as np
|
|
|
```
|
|
|
|
|
|
Open a connection to the RTIS Device over the default serial port:
|
|
|
|
|
|
```python
|
|
|
>>> success_connect = rtisdev.open_connection()
|
|
|
success_connect = rtisdev.open_connection()
|
|
|
```
|
|
|
|
|
|
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")
|
|
|
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:
|
|
|
|
|
|
```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:
|
|
|
|
|
|
```python
|
|
|
>>> settings = rtisdev.get_current_settings()
|
|
|
settings = rtisdev.get_current_settings()
|
|
|
```
|
|
|
|
|
|
Get an ACTIVE measurement (protect your ears!) in raw data:
|
|
|
|
|
|
```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:
|
|
|
|
|
|
```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()
|
|
|
raw_data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open("test_measurement_" + str(measurement.index) + ".bin", "wb")
|
|
|
file_handle_data.write(raw_data_sonar)
|
|
|
file_handle_data.close()
|
|
|
```
|
|
|
|
|
|
Process that raw measurement to an energyscape using the configuration chosen earlier:
|
|
|
|
|
|
```python
|
|
|
>>> processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
```
|
|
|
|
|
|
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')
|
|
|
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:
|
|
|
|
|
|
```python
|
|
|
>>> plt.xlabel("Directions (degrees)")
|
|
|
>>> plt.ylabel("Range (meters)")
|
|
|
>>> indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20)
|
|
|
>>> labels_x = np.round(np.rad2deg(settings.directions[indexes_x, 0])).astype(int)
|
|
|
>>> indexes_y = np.arange(0, new_processed_measurement.processedData.shape[1], 100)
|
|
|
>>> labels_y = settings.ranges[indexes_y]
|
|
|
>>> fmt_x = lambda x: "{:.0f}°".format(x)
|
|
|
>>> fmt_y = lambda x: "{:.2f}m".format(x)
|
|
|
>>> plt.xticks(indexes_x, [fmt_x(i) for i in labels_x])
|
|
|
>>> plt.yticks(indexes_y, [fmt_y(i) for i in labels_y])
|
|
|
>>> plt.title("RTIS Dev - 2D Energyscape Example")
|
|
|
>>> ax = plt.gca()
|
|
|
>>> ax.invert_yaxis()
|
|
|
>>> ax.set_aspect("auto")
|
|
|
>>> plt.show()
|
|
|
plt.xlabel("Directions (degrees)")
|
|
|
plt.ylabel("Range (meters)")
|
|
|
indexes_x = np.arange(0, new_processed_measurement.processedData.shape[0], 20)
|
|
|
labels_x = np.round(np.rad2deg(settings.directions[indexes_x, 0])).astype(int)
|
|
|
indexes_y = np.arange(0, new_processed_measurement.processedData.shape[1], 100)
|
|
|
labels_y = settings.ranges[indexes_y]
|
|
|
fmt_x = lambda x: "{:.0f}°".format(x)
|
|
|
fmt_y = lambda x: "{:.2f}m".format(x)
|
|
|
plt.xticks(indexes_x, [fmt_x(i) for i in labels_x])
|
|
|
plt.yticks(indexes_y, [fmt_y(i) for i in labels_y])
|
|
|
plt.title("RTIS Dev - 2D Energyscape Example")
|
|
|
ax = plt.gca()
|
|
|
ax.invert_yaxis()
|
|
|
ax.set_aspect("auto")
|
|
|
plt.show()
|
|
|
```
|
|
|
|
|
|
Get a new ACTIVE measurement (protect your ears!) in both raw and microphone signal format directly:
|
|
|
|
|
|
```python
|
|
|
>>> signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
```
|
|
|
|
|
|
Plot the microphone signals of this measurement:
|
|
|
|
|
|
```python
|
|
|
>>> fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True)
|
|
|
>>> for microphone_index_i in range(0, 8):
|
|
|
... for microphone_index_j in range(0, 4):
|
|
|
... axs[microphone_index_i, microphone_index_j].set_title(str(microphone_index_j+(microphone_index_i*4)+1))
|
|
|
... axs[microphone_index_i, microphone_index_j].plot(signal_measurement.processedData[microphone_index_j+(microphone_index_i*4),:])
|
|
|
... if microphone_index_j != 0:
|
|
|
... plt.setp(axs[microphone_index_i, microphone_index_j], yticklabels=[])
|
|
|
... if microphone_index_i != 7:
|
|
|
... plt.setp(axs[microphone_index_i, microphone_index_j], xticklabels=[])
|
|
|
... if microphone_index_i == 7:
|
|
|
... axs[microphone_index_i, microphone_index_j].set_xlabel("Time (Samples)")
|
|
|
... if microphone_index_j == 0:
|
|
|
... axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
|
|
|
>>> plt.show()
|
|
|
>>> fig.suptitle("RTIS Dev - Microphone Signals")
|
|
|
fig, axs = plt.subplots(8, 4, figsize=(10,16), constrained_layout = True)
|
|
|
for microphone_index_i in range(0, 8):
|
|
|
for microphone_index_j in range(0, 4):
|
|
|
axs[microphone_index_i, microphone_index_j].set_title(str(microphone_index_j+(microphone_index_i*4)+1))
|
|
|
axs[microphone_index_i, microphone_index_j].plot(signal_measurement.processedData[microphone_index_j+(microphone_index_i*4),:])
|
|
|
if microphone_index_j != 0:
|
|
|
plt.setp(axs[microphone_index_i, microphone_index_j], yticklabels=[])
|
|
|
if microphone_index_i != 7:
|
|
|
plt.setp(axs[microphone_index_i, microphone_index_j], xticklabels=[])
|
|
|
if microphone_index_i == 7:
|
|
|
axs[microphone_index_i, microphone_index_j].set_xlabel("Time (Samples)")
|
|
|
if microphone_index_j == 0:
|
|
|
axs[microphone_index_i, microphone_index_j].set_ylabel("Amplitude")
|
|
|
plt.show()
|
|
|
fig.suptitle("RTIS Dev - Microphone Signals")
|
|
|
```
|
|
|
|
|
|
# **Classes**
|
... | ... | @@ -393,7 +393,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).
|
|
|
Create settings from a premade setup:
|
|
|
```python
|
|
|
>>> rtisdev.set_recording_settings(premade="short_20_80")
|
|
|
rtisdev.set_recording_settings(premade="short_20_80")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
... | ... | @@ -402,6 +402,7 @@ 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,
|
... | ... | @@ -411,9 +412,10 @@ An example json: |
|
|
"callMaximumFrequency" : 50000,
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file.
|
... | ... | @@ -422,6 +424,7 @@ Here we use manually generated call. |
|
|
It has to be available on the given path and have the right format.
|
|
|
An example of such a custom call can be found [here](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/config/premadeSettings/recording/flutter.csv):
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneSamples" : 16777216,
|
|
|
"microphoneSampleFrequency" : 4500000,
|
... | ... | @@ -429,22 +432,23 @@ An example of such a custom call can be found [here](https://cosysgit.uantwerpen |
|
|
"callCustom": "mycall.csv",
|
|
|
"callEmissions": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
rtisdev.set_recording_settings(jsonPath="./myrecordingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create full custom settings with the arguments. All arguments that aren't filled in will use default values:
|
|
|
|
|
|
```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):
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settings(callCustom="mycall.csv")
|
|
|
rtisdev.set_processing_settings(callCustom="mycall.csv")
|
|
|
```
|
|
|
|
|
|
## **set_processing_settings**
|
... | ... | @@ -535,20 +539,20 @@ You can get the available premade settings with [`get_premade_recording_settings |
|
|
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:
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settings(premade="3D_5m_3000")
|
|
|
rtisdev.set_processing_settings(premade="3D_5m_3000")
|
|
|
```
|
|
|
|
|
|
Create settings from a premade setup with only part of the processing steps enabled and no preloading.
|
|
|
You can get the available premade settings with [`get_premade_recording_settings_list()`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#get_premade_processing_settings_list):
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settingsde="2D_5m_181", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=False, enveloppeEnable=False, cleanEnable=False)
|
|
|
rtisdev.set_processing_settingsde="2D_5m_181", pdmEnable=True, matchedFilterEnable=True, beamformingEnable=False, enveloppeEnable=False, cleanEnable=False)
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
... | ... | @@ -556,6 +560,7 @@ This expects a json to be available wit(premah 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/).
|
|
|
Here we use auto-generated processing files:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"minRange" : 0.5,
|
... | ... | @@ -563,9 +568,10 @@ Here we use auto-generated processing files: |
|
|
"directions": 181,
|
|
|
"2D": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
```
|
|
|
|
|
|
Create settings from a json file with full processing settings on.
|
... | ... | @@ -574,21 +580,23 @@ 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/) as well:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"microphoneLayout" : "eRTIS_v3D1",
|
|
|
"directionsCustom": "./directions.csv",
|
|
|
"delayMatrixCustom": ".premade/delaymatrix.csv",
|
|
|
"rangesCustom": ".premade/ranges.csv"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settings(jsonPath="./myprocessingsettings.json")
|
|
|
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:
|
|
|
|
|
|
```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:
|
... | ... | @@ -597,7 +605,7 @@ 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/):
|
|
|
|
|
|
```python
|
|
|
>>> rtisdev.set_processing_settings(customPath="mysettingsfolder")
|
|
|
rtisdev.set_processing_settings(customPath="mysettingsfolder")
|
|
|
```
|
|
|
|
|
|
## **get_current_settings**
|
... | ... | @@ -967,10 +975,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
|
|
|
>>> import rtisdev
|
|
|
>>> rtisdev.open_connection()
|
|
|
>>> rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
>>> measurement = rtisdev.get_raw_measurement(True)
|
|
|
import rtisdev
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **get_signal_measurement**
|
... | ... | @@ -1010,11 +1018,11 @@ 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")
|
|
|
>>> signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
import rtisdev
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
signal_measurement = rtisdev.get_signal_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **get_processed_measurement**
|
... | ... | @@ -1053,11 +1061,11 @@ 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")
|
|
|
>>> processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
import rtisdev
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
processed_measurement = rtisdev.get_processed_measurement(True)
|
|
|
```
|
|
|
|
|
|
## **process_measurement**
|
... | ... | @@ -1096,12 +1104,12 @@ 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")
|
|
|
>>> measurement = rtisdev.get_raw_measurement(True)
|
|
|
>>> processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
import rtisdev
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
measurement = rtisdev.get_raw_measurement(True)
|
|
|
processed_measurement = rtisdev.process_measurement(measurement)
|
|
|
```
|
|
|
|
|
|
## **set_counter**
|
... | ... | @@ -1229,16 +1237,16 @@ 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:
|
|
|
|
|
|
```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()
|
|
|
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()
|
|
|
```
|
|
|
|
|
|
## **create_measure_external_trigger_callback**
|
... | ... | @@ -1277,22 +1285,22 @@ 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):
|
|
|
... 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()
|
|
|
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 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()
|
|
|
```
|
|
|
|
|
|
## **create_processing_workers**
|
... | ... | @@ -1345,21 +1353,21 @@ 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()
|
|
|
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**
|
... | ... | |