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

Allow for variable dt (and maximum delta time) in tracking #310

Open
freemansw1 opened this issue Jul 12, 2023 · 1 comment
Open

Allow for variable dt (and maximum delta time) in tracking #310

freemansw1 opened this issue Jul 12, 2023 · 1 comment
Labels
enhancement Addition of new features, or improved functionality of existing features
Milestone

Comments

@freemansw1
Copy link
Member

There are many instances in observational data where the delta-time is not held fixed, or where data gaps are present. tobac does not currently deal with this, instead asking users to come up with a constant dt in tracking. I've started to get questions (and feature requests) for dealing with this, and I think this would be a good problem to solve.

We may be able to do it within our current framework, and within trackpy. At first glance, I think it will require a clever solution (at least without modifying trackpy). We could do it somewhat simply if we can find a way to allow for running trackpy semi-independently for each timestep (which we may be able to do through initial_guess_vels: http://soft-matter.github.io/trackpy/dev/generated/trackpy.predict.NearestVelocityPredict.html#trackpy.predict.NearestVelocityPredict).

@freemansw1 freemansw1 added the enhancement Addition of new features, or improved functionality of existing features label Jul 12, 2023
@freemansw1 freemansw1 added this to the Version 1.5.x milestone Jul 12, 2023
@w-k-jones
Copy link
Member

Had a quick dig into the trackpy.predict.NearestVelocityPredict and found that it already supports variable dt (atleast in v0.6.0):

https://github.com/soft-matter/trackpy/blob/d4ff59f4c844b5bc90a1aa7325b43cbeccae1546/trackpy/predict.py#L168-L177

t_column is found from either 't_column' or 'frame' in the input dataframe, so we could add an extra t_column column to the track dataframe with values as time difference in seconds from the first frame, and possibly renaming frame temporarily.

The main challenge would be to update search_range for each step if v_max is provided. I think the only way to do this would be to replicate trackpy.link_iter but update Linker.search_range for each iteration based on the dt of that time step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Addition of new features, or improved functionality of existing features
Projects
None yet
Development

No branches or pull requests

3 participants