Adding feature tracking operator#2148
Conversation
Co-authored-by: Copilot <copilot@github.com>
James Frost (jfrost-mo)
left a comment
There was a problem hiding this comment.
Thank you for this pull request, and sorry it took so long for me to get to it. I'm assuming that despite it being a draft PR it is ready for a review.
Overall it looks like a good set of changes that will nicely integrate simple-track into CSET. There are a few small issues highlighted in the comments below, but it is overall looking very good.
Please run the pre-commit checks over this code (pre-commit run --all-files) to fix a number of minor issues. These checks can be set to run on each commit by running pre-commit install.
Remove whitespace Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Update copyright Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Co-authored-by: James Frost <james.frost@metoffice.gov.uk>
Adam Gainford (A-Gainford)
left a comment
There was a problem hiding this comment.
Thanks for the taking a look through the code, happy with the suggestions. I assume it's okay to accept changes on the lockfiles at the bottom of the PR page but I have held off for now
James Frost (Fraetor)
left a comment
There was a problem hiding this comment.
Still need to review the feature file.
| }, | ||
| "feature_id": { | ||
| "cmap": "viridis", | ||
| "max": 4000, |
There was a problem hiding this comment.
Is this just a reasonable upper nound for the number of features tracked?
| cmap, levels, norm = colorbar_map_levels(cube) | ||
|
|
||
| if "feature" in cube.long_name: | ||
| cmap.set_under("white") |
There was a problem hiding this comment.
Supposedly set_under is deprecated and we should be using with_extremes instead.
https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap.set_under
https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap.with_extremes
Given this can be set at colourway Creation maybe we should think about allowing this to be set in the colourbar file. Probably something for a different PR though.
| .nfs* | ||
|
|
||
| # MacOS temp files | ||
| .DS_Store No newline at end of file |
There was a problem hiding this comment.
| .DS_Store | |
| .DS_Store | |
As the pre-commit check notes, this file will need to end in a newline.
Fun fact: Strictly according to the POSIX specification a file that doesn't end in a new line isn't technically a text file.
Adding feature-tracking via the Simple-Track repo (https://github.com/ParaChute-UK/simple-track), which is included as a new dependency. The feature.track operator is used to call Simple-Track, which returns three cubes per timestep: "feature_id", "feature_lifetime" and "feature_init". These can be filtered to select them for plotting with existing routines. Other data which is not currently used by CSET can be saved for further analysis. The new "feature" operator set will also be used to implement cell stats using Simple-Track with the tracking capabilities disabled (though the "feature" name may want to be changed).
Contribution checklist
Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.
rose-suite.conf.examplehas been updated if new diagnostic added.