ARGODEV-150: Convert find_besthist
Jira Issue
ARGODEV-150 (https://jira.ceh.ac.uk/browse/ARGODEV-150)
Python Implementation
The algorithm has remained exactly the same, and will be outlined in the Matlab Implementation section below
I have split the function into four functions:
- Calculate whether a point lies inside the chosen ellipse
- Calculate the potential vorticity at a given latitude and depth
- Calculate how strong correlated two points are
- Bring all these functions together, along with some data manipulation, to find the best historical data
Testing
I have written a grand total of 19 tests for the above. They all currently pass
Old Matlab Implementation
- First, check whether the historical data lies within the chosen ellipse. If some of it does, select it.
- If we have more data than we need, then select 1/3 of our data randomly. Remove this data from the leftover data
- Find which data is most strongly correlated with out float data in the large ellipse/time frame. Select the best data from this pool for another 1/3, and remove it from the left over data
- Find which data is most strongly correlated with our float data in the small ellipse/time frame. Select the best data from this pool for our final 1/3.
- String all this data together and return it.
Our returned value should be the indices of the best historical data to use for our analysis.