Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resample data with virtual time master channel #1024

Open
fhaon opened this issue May 21, 2024 · 1 comment
Open

Resample data with virtual time master channel #1024

fhaon opened this issue May 21, 2024 · 1 comment

Comments

@fhaon
Copy link

fhaon commented May 21, 2024

Python version

('python=3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit '
'(AMD64)]')
'os=Windows-10-10.0.19044-SP0'
'numpy=1.24.2'
'asammdf=7.4.2'

Code

MDF version

4.10

Code snippet

import sys
from asammdf import MDF

try:

    with MDF(name="E:/Vector_VirtualTimeMasterChannel.mf4") as mdf:
        resampled = mdf.resample(raster=0.06)
        resampled.save(dst="E:/Vector_VirtualTimeMasterChannel_Resampled.mf4", overwrite=True)

except:

    sys.exit(-1)

Traceback

No traceback

Description

Resampling data with a virtual time master channel throws an exception. The Vector_VirtualTimeMasterChannel.mf4 file used for this test is provided with the MDF4 standard. Calling the get_master method to get the last value of the time vector returns an empty array :

master_max = mdf.get_master(group_index, record_offset=cycles_nr - 1, record_count=1)
if len(master_max):
    t_max.append(master_max[0])
@danielhrisca
Copy link
Owner

@fhaon please try the development branch code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants