'call python function from c, pass some float arrays and store data on them

I am working in an astronomical app. I need to read an CASA MS File which is easy to read from python.

The thing is that I'm working with CUDA and I need to save the file data as u,v coordinates, real and imaginary visibilities and weights, in host arrays.

Is it possible to call a python function from C pass the arrays and the name of the file and fill them in the python function?

How can it be done?

And there is an special way to compile the file?



Solution 1:[1]

Yes it is,

https://docs.python.org/2.5/ext/callingPython.html

Still, why do it in python? You can do it in C as well!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PeCosta