Skip to content

Thinning trajectories and upgrading them to use the new storage format - #84

Open
mimakaev wants to merge 1 commit into
masterfrom
thin-trajectory
Open

mimakaev wants to merge 1 commit into
masterfrom
thin-trajectory

Conversation

@mimakaev

Copy link
Copy Markdown
Collaborator

This adds a tool to re-format an existing trajectory to use the new format (3x-4x space saving) as well as (optionally) thin it - e.g. keep every 5th or every 10th file. This is useful to archive old trajectories to be very small.

list_URIs inferred block numbers from the filename range (blocks_X-Y.h5 ->
X..Y), so files that do not hold every block of their range were listed
with non-existent blocks. It already opens every file, so it now reads the
group names instead.

thin_trajectory keeps every n-th block (plus the last one) of a saved
trajectory and re-saves positions with the chain_delta_v1 encoding. Kept
blocks keep their original numbers. Every written file is verified against
the original blocks before anything is deleted. Works into a separate
folder or in place (interrupted in-place runs are finished or restarted by
the next call), and writes THINNED.json so repeated calls are no-ops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant