You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi and thanks for your work! I have a question regarding trajectories which are not uniformly sampled in time. Reading your "brief comment on time" in the documentation I thought I only have to supply a sequence of time data and optionally set dt to None. However I realized the dt value set is on creation of the Trajectory object.
When saving the trajectories and loading them again this leads to a LoadTrajectoryError triggered by a ValueError: ValueError: You are giving 'dt' and 't' but 't0' is not the same as the first value of 't'.
Am I understanding something wrong or is this a bug in the implementation?
The text was updated successfully, but these errors were encountered:
Thanks for spotting this bug (it was a big one in the implementation of loading these kind of trajectories)
When dt is not given (or given as None) in the trajectory initialization, then its mean value is estimated (for future potential statistical applications). The bug was on saving the trajectory using the estimated dt as the actual dt. As it was an estimation and not the actual dt (due to the non uniformly time spaced characteristics of the trajectory) this value should't be used to initialize a trajectory (which was exactly what we were doing).
Note: dt value is meant to be given in initialization only when there is no time data. In this case, a time data is generated using the given dt and starting at 0.0.
The bug was already fixed in the version 0.8.4 of yupi. You just need to:
pip install -U yupi
In the latest version, there is an attribute dt_mean which represents the estimated value and dt is a property of the Trajectory class which returns the real dt value in case it was given, or returns the estimated value (dt_mean) otherwise. Also, you can access the attribute dt_std to inspect the standard deviation associated to the time sampling.
Thanks a lot for your feedback!
jmorgadov
changed the title
Trajectories without uniformly sampled in time
Error when loading previously saved trajectories without uniformly sampled time data
Jan 29, 2022
Hi and thanks for your work! I have a question regarding trajectories which are not uniformly sampled in time. Reading your "brief comment on time" in the documentation I thought I only have to supply a sequence of time data and optionally set dt to None. However I realized the dt value set is on creation of the Trajectory object.
output:
When saving the trajectories and loading them again this leads to a LoadTrajectoryError triggered by a ValueError:
ValueError: You are giving 'dt' and 't' but 't0' is not the same as the first value of 't'.
Am I understanding something wrong or is this a bug in the implementation?
The text was updated successfully, but these errors were encountered: