SkyRadar Blog | Radar Training Systems Online Radars - SkyRadar

Read out the IQ data via our Programming Interface (Web-API) - And use it in MATLAB, Jupyter etc

Written by Ulrich Scholten, PhD | Dec 05, 2019

More and more users want to access our radar raw data and read out IQ data directly. Having the raw data in a well digestible data format makes it easy to do the further treatment in any numerical computing environment. Research on new algorithms on real-time data becomes comfortable and powerful.

There are many ways of reading the data of SkyRadar's training and research radars. FreeScopes is the comfortable version. You have readily prepared A-Scopes, B-Scopes and PPIs, lots of controls and selection possibilities for a multitude of algorithms.

Alternatively, you can receive raw data in MATLAB, Jupyter, or your preferred programming language and apply your algorithms and data processing. You can even send your processed data again to FreeScopes to visualize it in A-Scope, B-Scope or PPI, or visualize it in your application.

For all that you can use the JSON code below.

What is JSON?

JavaScript Object Notation (JSON) is an open-standard file format or data interchange format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value).

It is a very common data format, with a diverse range of applications, such as serving as replacement for XML in AJAX systems. 

It is fast, non proprietary, easy to read and understood by most IT experts. Actually its advantage as compared to XML is that it is closer to JavaScript and can be easily transformed and integrated into JS code.

What to do to read the Data?

To read the data, just add the following code into your application and tap our JSON messages in real-time.

The radars and the cloud server communicate with clients over web-sockets.
In this way they can cater for browser clients as well as for other rich clients.

When using the CloudServer, consider the following: Different data sources might be connected to the cloud server, so there is an endpoint that sends a list of available sources and their changes (connect/disconnect). This endpoint is '/available-sources'.

Each available data source has an id. With this id clients can connect to another endpoint
to receive data. For example for a source with id 12 the endpoint is: '/data-frame-ws/12'.

Both endpoints send data as JSON messages.

Here is a sample message of '/available-sources':


{
"sources": [
{
"id": 5,
"live": false,
"num": "1",
"type": "psr"
}
],
"sourcetypes": [
{
"caption": "SSR",
"enable": true,
"name": "ssr",
"node": 114
},
{
"caption": "PSR Live",
"enable": true,
"name": "psr-live",
"node": 114
},
{
"caption": "PSR",
"enable": true,
"name": "psr",
"node": 114
},
{
"caption": "ADSB Live",
"enable": true,
"name": "adsb",
"node": 114
}
]
}

'sources' are real available sources that are sending data.

'sourcetypes' on the other hand is a list that shows possible sources types.

You can find a sample data of '/data-frame-ws/ID' here:
https://www.skyradar.com/hubfs/Code/sample-data.json

Each 3 seconds '/available-sources' sends a message that is not JSON. It is
always exactly this string: 'live signal'. The string's only task is to check if client still available or not. No need to respond to this message, the SkyRadar CloudServer or the Radars will recognize the status on their own.

Here is a sample in Python that waits for first available source and then connect to to it and receive raw data. You can implement same in any other language.


import json
import websocket # pip install websocket-client

cloud_server_addr = '192.168.0.100:9000' # use cloud server ip
available_sources_url = 'ws://{}/available-sources'.format(cloud_server_addr)
data_receiver_url = 'ws://{}/data-frame-ws/'.format(cloud_server_addr)

ws = websocket.create_connection(available_sources_url)
while True:
message = ws.recv()
if message == 'live signal':
continue
message = json.loads(message)
sources = message['sources']
if len(sources) == 0:
continue
# we can apply filtering on sources by id, type, num, etc
# here we just use first available source, so we can break the loop
src_id = sources[0]['id']
break
ws = websocket.create_connection(data_receiver_url.format(src_id))
while True:
data_frame = ws.recv()
# here we can do some processing on data_frame if we need
print(data_frame)

 

We hope you enjoy it.