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

Feat: long tracker #529

Merged
merged 46 commits into from
Dec 16, 2024
Merged

Feat: long tracker #529

merged 46 commits into from
Dec 16, 2024

Conversation

cpaniaguam
Copy link
Member

@cpaniaguam cpaniaguam commented Dec 7, 2024

This pull request includes several changes to the IceFloeTracker project, focusing on improving the tracking of ice floes over multiple days, adding new functionality, and updating the corresponding tests. The most important changes include the addition of the long_tracker function, updates to the notebook, and the introduction of new helper functions.

New functionality:

  • Added long_tracker function to track ice floes over multiple days, including the necessary helper functions such as find_floe_matches, get_unmatched, get_trajectory_heads, and others. (src/tracker/long_tracker.jl, src/tracker/tracker-funcs.jl)
  • Included the new long_tracker file in the main module. (src/IceFloeTracker.jl)

Notebook updates:

  • Updated the track-floes.ipynb notebook to use the new long_tracker function and added new data processing steps and visualizations. (notebooks/track-floes/track-floes.ipynb)

Testing improvements:

  • Added new tests for the long_tracker function, including cases with gaps in data. (test/test-long-tracker.jl)
  • Updated test setup to use the new @ntestset macro for better test organization. (test/runtests.jl, test/test-matchcorr.jl)

Notes about long_tracker

  1. This function can replace the call to _pairfloes within pairfloes which is used the pipeline workflow.

function pairfloes(
segmented_imgs::Vector{<:FloeLabelsImage},
props::Vector{DataFrame},
passtimes::Vector{DateTime},
latlonrefimage::AbstractString,
condition_thresholds,
mc_thresholds,
)
_pairs = _pairfloes(
segmented_imgs,
props,
passtimes,
condition_thresholds,
mc_thresholds,
)
addlatlon!(_pairs, latlonrefimage)
cols = [:ID, :passtime, :area, :convex_area, :major_axis_length, :minor_axis_length, :orientation, :perimeter, :latitude, :longitude, :x, :y, :area_mismatch, :corr]
_pairs = _pairs[:, cols]
return _pairs
end

  1. It has a simpler signature. _pairfloes as currently defined does too much work. Besides the matching, it also adds unique ids to floes, pass times, floe masks, and psi-s curves. long_tracker expects all those data to be included in the input props object. See sample workflows in the test suite and the illustrative notebook.

TODO

  • Add tie-breaking criteria for potential matches.

base floes from (i-1)th iteration
to retrieve last row of each group in pairs
within group (trajectory) for correct bookkeeping of area_mismatch and corr columns
calculate time difference between floes
add missing columns for joining
function to reset distinct values in a DataFrame column
function to merge floe properties and similarity ratios
rightdf missing cols
To retrieve right-hand matches from prelim pairs during the ith iteration
@cpaniaguam cpaniaguam linked an issue Dec 7, 2024 that may be closed by this pull request
@cpaniaguam cpaniaguam requested a review from a team December 7, 2024 00:22
macro for enhanced test set output formatting
to use ntestset and remove redundant code
to use long tracker
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

on importance of the order of adding required fields
to test independence of ordering
add latitude/longitude data to trajectories and update column names
in long_tracker
Copy link
Collaborator

@hollandjg hollandjg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! I've a few clarifying questions. At this point, I'd really like to see some extra test images and trajectories with demonstrations that the tracking works over multiple days with gaps in-between.

src/tracker/long_tracker.jl Outdated Show resolved Hide resolved
test/test-long-tracker.jl Show resolved Hide resolved
test/test-long-tracker.jl Outdated Show resolved Hide resolved
src/tracker/long_tracker.jl Show resolved Hide resolved
src/tracker/tracker-funcs.jl Outdated Show resolved Hide resolved
src/tracker/tracker-funcs.jl Show resolved Hide resolved
src/tracker/long_tracker.jl Show resolved Hide resolved
remove note about dependency of column order
function to insert gaps in props array
outside test set
for better output feedback during testing
@cpaniaguam cpaniaguam requested review from hollandjg and a team December 11, 2024 19:12
@cpaniaguam cpaniaguam merged commit 6865550 into main Dec 16, 2024
3 of 7 checks passed
@cpaniaguam cpaniaguam deleted the 338-tracker-revision branch December 16, 2024 21:05
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.

Long-tracker translation
2 participants