-
Notifications
You must be signed in to change notification settings - Fork 54
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 option to define different n_min_threshold dependent on thresholds #208
Add option to define different n_min_threshold dependent on thresholds #208
Conversation
…re given that are not dict or list
Codecov ReportBase: 41.01% // Head: 41.24% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## RC_v1.5.0 #208 +/- ##
=============================================
+ Coverage 41.01% 41.24% +0.22%
=============================================
Files 14 14
Lines 2321 2335 +14
=============================================
+ Hits 952 963 +11
- Misses 1369 1372 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work @JuliaKukulies, a great addition. I found one issue with sorting for the dictionary case and have a suggestion for that.
Co-authored-by: Nils Pfeifer <76663232+snilsn@users.noreply.github.com>
…aKukulies/tobac into allow_threshold_dependent_min_areas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank fro these little changes @JuliaKukulies , I'm approving this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JuliaKukulies! I'm happy with this as-is. Feel free to merge when you're ready.
Thanks @freemansw1 and @snilsn for reviewing this PR! |
This PR solves #18 by allowing users to input
n_min_threshold
(the minimum number of grid cells that must be above/below the set threshold(s)) asdict
orlist
. That way, differentn_min_threshold
values are used for different threshold values in the feature detection.The code changes encompass:
feature_detection_multithreshold_timestep()
because here, individual threshold values are selected and passed tofeature_detection_threshold()
n_min_threshold
. This means that the number of elements of the givendict
orlist
has to be the same as the number of given thresholds. It is also made sure that these values are sorted accordingly when threshold values are sorted. Whenn_min_threshold
is given asdict
, the keys must correspond to the threshold values. Whenn_min_threshold
is given aslist
, it is assumed that eachn_min_threshold
belongs to the value inthreshold
at the same position.test_feature_detection.py
to test the new featuren_min_threshold
to show an example on our RTD page: seeDifferent n_min_threshold for different threshold values
underFeature Detection Parameter Examples
https://tobac--208.org.readthedocs.build/en/208/