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

Add a rolling mean filter #459

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ArismitaM
Copy link

Description

This PR adds a rolling mean filter to movement.
The mean filter is in line with the median filter and does padding of the time
axis using "reflection".

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
This PR adds rolling mean filtering functionality to movement.

What does this PR do?
Adds the ability to smooth a data array using the local mean within a window, whose size is passed as an input parameter.

References

[https://github.com//issues/454](issue #454 )

How has this PR been tested?

A user test program was written which does the following:

  • Loads VIA_multiple-crabs_5-frames_labels.csv from the movement sample_data.
  • Run mean_filter on the shape and position DataArrays of the loaded dataset
  • Members of the smoothed DataArray were randomly verified against the input DataArray and its neighborhood.

Is this a breaking change?

No

Does this PR require an update to the documentation?

Yes. example code base can be augmented to use the mean_filter.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Copy link

sonarqubecloud bot commented Mar 3, 2025

@niksirbi niksirbi linked an issue Mar 3, 2025 that may be closed by this pull request
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (b0676b7) to head (a73f8ef).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #459   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          23       23           
  Lines        1312     1320    +8     
=======================================
+ Hits         1310     1318    +8     
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Add a rolling mean filter
1 participant