Hi,
What is the REST syntax for reading the Left and Right data? I see in the webURL localhost:9402 served by the instrument it shows a syntax for graphing the left and right channel data. I’m going to present the following using the python syntax. So resp = requests.get.(“http://localhost:9402/Graph/Frequency/In/0”) , where the last zero specifies the left channel and 1 would specify the right channel.
On the same webURL it serves up it shows some syntax for reading raw frequency or time domain data, however, it does not show how to read the left or right channel. Does anyone know how to specify the left or right channel when reading raw data back? I need to gather the whole spectrum so that I can check that the noise level is below some levels.
The command i’m using looks like the following to get the left channel frequency input data …
resp = requests.get(‘http://localhost:9402/Data/Frequency/Input’) # get freq. domain data
resp_freq_L = resp.json()[‘Left’]
My second problem is how can I decode the json data? When I view the resp_freq_L, information it is a long string that looks like the following …
These are educated guesses based on the code you wrote,
Did you try?
data = resp.json()[“Right”]
Then it looks base 64 encoded so you could try this
import base64
text = base64.b64decode(data).decode()
And then depending on what the text looks like process it into an array?
I have not run this code nor used the REST API yet other than trying it out. So take that with a grain of salt. I did try to quickly find the info in the docs, but only had 2 mins to write this!