Getting an error while trying to access time samples from a hdf file which was converted from .csv format using pandas?

128 views
Skip to first unread message

harsha vardhan chowdary

unread,
Jun 24, 2020, 3:27:13 AM6/24/20
to Acoular-users
import pandas as pd
timedata=pd.read_csv(r'C:\Users\Harsha Vardhan\timedata.csv')
filename = r'C:\Users\Harsha Vardhan\time_data.h5'
import acoular
timedata.to_hdf(filename,'data',mode='w',format='table')
ts=acoular.TimeSamples(name='time_data.h5')


I am trying to predict the sound sources location using acoular Beam forming. I have experimental data which has both time and each microphone signal value at that time. To take out the time samples I made a csv file just for time with one column. The I converted it to hdf format using pandas. Till the last but one line I didn't get any error but after executing the last line I got this error.

Exception occurred in traits notification handler for object: <acoular.sources.TimeSamples object at 0x00000222B8368168>, trait: basename, old value: None, new value: time_data
Traceback (most recent call last):
  File "E:\Anaconda\lib\site-packages\traits\trait_notifiers.py", line 591, in _dispatch_change_event
    self.dispatch(handler, *args)
  File "E:\Anaconda\lib\site-packages\traits\trait_notifiers.py", line 553, in dispatch
    handler(*args)
  File "E:\Anaconda\lib\site-packages\acoular\sources.py", line 150, in load_data
    self.data = self.h5f.get_data_by_reference('time_data')
  File "E:\Anaconda\lib\site-packages\acoular\h5files.py", line 86, in get_data_by_reference
    return self.get_node(group, nodename)
  File "E:\Anaconda\lib\site-packages\tables\file.py", line 1635, in get_node
    node = where._v_file._get_node(nodepath)
  File "E:\Anaconda\lib\site-packages\tables\file.py", line 1590, in _get_node
    node = self._node_manager.get_node(nodepath)
  File "E:\Anaconda\lib\site-packages\tables\file.py", line 432, in get_node
    node = self.node_factory(key)
  File "E:\Anaconda\lib\site-packages\tables\group.py", line 1178, in _g_load_child
    node_type = self._g_check_has_child(childname)
  File "E:\Anaconda\lib\site-packages\tables\group.py", line 395, in _g_check_has_child
    % (self._v_pathname, name))
tables.exceptions.NoSuchNodeError: group ``/`` does not have a child named ``/time_data``
Message has been deleted

Lucas Gomes

unread,
Jun 24, 2020, 3:25:16 PM6/24/20
to Acoular-users
Hello harsha, I see that you code has some errors. One of the reasons that you are getting errors, is that you need to put the sample rate of the data instead the time instant of each sample, and for put the samples in the acoular.TimeSamples you need to set other parameters when write the .H5 file.

Here is a code example which I think that help you.


Best regards.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages