ARGODEV-175: convert build_cov
Jira Issue
ARGODEV-175 (https://jira.ceh.ac.uk/browse/ARGODEV-175)
Python Implementation
Mostly the same as the Matlab implementation. I have refactored the calculating of each covariance out into its own function, for which there is a separate suite of tests
Testing
build_cov:
- Test that the return type is a numpy array
- Test that the returned array is the expected dimensions (we expect the returned matrix to be the size of the potential temperature array multiplied by the size of the coordinate array, since each potential temperature for each profile must be compared to each potential temperature of all the profiles
- Test that the results match the matlab version
covarxy_pv:
- Test that the returned array is the correct size
- Test that the returned array contains the correct elements
- Test that the returned array contains correct elements if the potential vorticity is used to calculate vertical covariance
- Test that the array is full of ones (or almost ones) if the data is incredibly self similar (according to the scale)
Old Matlab Implementation
Calculates the vertical and horizontal covariance, and used these values to create a total covariance matrix (it does this using a combination of spatial parameters (latitude, longitude, potential vorticity) and potential temperature