Skip to content

Any way to modify timestamps of certain groups without affecting data sampling or group/channel meta data #1010

Answered by danielhrisca
motthomasn asked this question in Q&A
Discussion options

You must be logged in to vote

In this case you have two options

!!! try them on copies of the original file

  1. load the file and set a linear conversion for the time channel, then save the file again. This will change the internal layout of the file , but it will preserve the metadata
from asammdf import MDF
from asammdf.blocks.conversion_utils import from_dict
mdf = MDF(file_name)
time = mdf.groups[0].channels[0]
time.conversion = from_dict({'a': 1, 'b': offset})  # linear conversion y = a *x + b
mdf.save(file_name, overwrite=True, compression=2)
mdf.close()
  1. lower level get your hands dirty and create a new conversion block that will be appended to the end of the file, then link it to the time channel
from asammdf i…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@motthomasn
Comment options

@danielhrisca
Comment options

Answer selected by motthomasn
@motthomasn
Comment options

@danielhrisca
Comment options

@motthomasn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants