Skip to content

Commit

Permalink
ready to slowly debug tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlib committed Nov 13, 2023
1 parent 17607de commit bf18eff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions openptv_python/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ def track_forward_start(tr: TrackingRun):


def trackcorr_c_loop(run_info, step):
# sequence loop
"""Sequence loop."""
j, h, mm, kk, in_volume = 0, 0, 0, 0, 0
philf = [[0 for _ in range(MAX_CANDS)] for _ in range(4)]
count1, count2, count3, num_added = 0, 0, 0, 0
Expand Down Expand Up @@ -971,21 +971,23 @@ def trackcorr_c_loop(run_info, step):
run_info.npart = run_info.npart + fb.buf[1].num_parts
run_info.nlinks = run_info.nlinks + count1

fb.next_frame()
fb.fb_next()
fb.write_frame_from_start(step)

if step < run_info.seq_par.last - 2:
fb.read_frame_at_end(step + 3, 0)
# end of sequence loop


def trackcorr_c_finish(run_info, step):
npart, nlinks = run_info.npart / range, run_info.nlinks / range
def trackcorr_c_finish(run_info, step: int):
"""Close the links and write the last frame."""
track_range = run_info.seq_par.last - run_info.seq_par.first
npart, nlinks = run_info.npart / track_range, run_info.nlinks / track_range
print(
f"Average over sequence, particles: {npart:.1f}, links: {nlinks:.1f}, lost: {npart - nlinks:.1f}"
)

run_info.fb.next_frame()
run_info.fb.fb_next()
run_info.fb.write_frame_from_start(step)


Expand Down
1 change: 1 addition & 0 deletions tests/test_tracking_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@


def remove_directory(directory_path):
"""Remove a directory and its contents."""
# Convert the input to a Path object
path = Path(directory_path)

Expand Down

0 comments on commit bf18eff

Please sign in to comment.