How to save data from a radar device?

Viewed 21

I have a problem to save my data from a radar device to a mat.file. Why do I wanna use a mat.file? Cause i want to use a SAR-algorithm afterwards in matlab. The radar what i am using is the 2 PI Labs SENSE X1155S-E radar. Additionally i am pretty new to python, that means my knowledge comes from forums and the documentation of python. I spent days testing things like "scipy.io.savemat", "pickle.dump", "file.write/.read" or "self.write", but I still can not save my data as i need it.

Here is an extract of my code:

        # Dump a configuration object with all configured settings
        config = device.sense.dump()
        logger.info(f'Configuration: {config}')

        logger.info('+ Running sweep(s)')
        acq = device.initiate.immediate_and_receive()

        # Read all data in one go
        logger.info('  Read data')
        data = acq.read()
        # print(type(data))   # datatype check

        logger.info('  Save data')
        # create dict for storage
        exportDict = {'data': data}
        io.savemat("test.mat", exportDict)

With the commandline "data = acq.read()" i get the data from my radar. Now i want to use io.savemat() to save my data in a mat.file, but for some reason I always get an error:

"TypeError: Could not convert None (type <class 'NoneType'>) to array"

I could not fix it until today. Maybe someone can help me to understand, what i am doing wrong. If you need some more information, I can poste more for sure.

Here are 2 pictures of my data and the error. Hope it helps. Thanks.

screenshot of my variable "data" ; screenshot of my error

1 Answers

Finally i managed to solve my problem. As u can see in my first picture "variable data" there is a subpoint called "array", so i edit my code as follow:

import numpy as np 
import scipy.io as

logger.info('  Save data')
# create dict for storage
exportDict = {'data': data.array}
io.savemat("test.mat", exportDict)

Now i can save the right data as i need it.

Related