how to get the data from python?

About the GUI application to design signal processing pipelines
Post Reply
dennis
Posts: 14
Joined: Sun Mar 30, 2014 8:42 am

how to get the data from python?

Post by dennis »

hi,
i am using python script to get the data from 'genereric stream reader',and output data to the 'GDF file writer'. this is the scenarios used to save the filtered data as gdf file, the python is just output the data as it received. when i run,the python script can print the data right, but the saved GDF file in 'GDF file writer' is wrong,the value is always '-0.9980'.

thank you for your help :D
Attachments
this is the scenarios used to save the filtered data as gdf file, the python is just output the data as it received
this is the scenarios used to save the filtered data as gdf file, the python is just output the data as it received
scenarios.png (7.28 KiB) Viewed 6985 times
it's the saved data in gdf file ,always '-0.9980'
it's the saved data in gdf file ,always '-0.9980'
GDF saved value.png (14.28 KiB) Viewed 6988 times
in the code ,i print the received 'chunk',<br />than output the chunk to 'output[0]'
in the code ,i print the received 'chunk',
than output the chunk to 'output[0]'
python script code.png (42.64 KiB) Viewed 6988 times

dennis
Posts: 14
Joined: Sun Mar 30, 2014 8:42 am

Re: how to get the data from python?

Post by dennis »

dennis wrote:hi,
i am using python script to get the data from 'genereric stream reader',and output data to the 'GDF file writer'. this is the scenarios used to save the filtered data as gdf file, the python is just output the data as it received. when i run,the python script can print the data right, but the saved GDF file in 'GDF file writer' is wrong,the value is always '-0.9980'.

thank you for your help :D


this is the output imformation when running the scenarios,we can see that the chunk can be print by python script rightly
Attachments
this is the output imformation when running the scenarios,we can see that the chunk can be print by python script rightly
this is the output imformation when running the scenarios,we can see that the chunk can be print by python script rightly
output imformation.png (42.1 KiB) Viewed 6982 times

dennis
Posts: 14
Joined: Sun Mar 30, 2014 8:42 am

Input/Output data in python

Post by dennis »

hi,
i want to use 'python script' to get the data from 'Generic stream reader' and output the data as it received , the detail can see 'viewtopic.php?f=6&t=9518' ,
can you help me ? :D

gserrier
Posts: 71
Joined: Tue Apr 01, 2014 8:22 am

Re: how to get the data from python?

Post by gserrier »

Hi,

Can you join the xml of your scenario please?

Guillaume

dennis
Posts: 14
Joined: Sun Mar 30, 2014 8:42 am

Re: how to get the data from python?

Post by dennis »

gserrier wrote:Hi,

Can you join the xml of your scenario please?

Guillaume

hi,
i'm sorry to reply late,i have finished the output :P , but there is a new problem, the error is
[ INF ] At time 1.344 sec <Box algorithm::(0x0000212d, 0x0000449a) aka Python scripting> Traceback (most recent call last):
File "C:/Program Files/openvibe//share/openvibe/plugins/python/openvibe.py", line 173, in realProcess
self.process()
File "C:/Program Files/openvibe/share/openvibe/scenarios/box-tutorials/python/scripts/Classification_test.py", line 29, in process
for chunkIndex in range( len(self.input[0]) ):
TypeError: bad argument type for built-in operation

is the 'for chunkIndex in range( len(self.input[0]) ):' wrong? And the chunkIndex is not difined,is there something wrong in it :? ?

thank you for your help! :D

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: how to get the data from python?

Post by jtlindgren »

My suggestion is to look at the existing python examples bundled with openvibe. First get them to work. Then customize your thing starting from them with baby steps, and if it breaks at some point, don't proceed until you've traced back the issue.


Good luck,
Jussi

Post Reply