ARGODEV-170: Convert get_region_ow
Jira Issue
ARGODEV-170: https://jira.ceh.ac.uk/browse/ARGODEV-170
Python Implementation
Exactly the same as Matlab implementation
Made a small change to the load_configuration dictionary so that it would load the correct directories storing the data.
Testing
6 unit tests were written to check outputs of this function:
- Test that we recieve 3 arrays of data (latitude, longitude, age)
- Test that, if the current float being processed appears in the data, remove this data from the data arrays
- Test that passing in no data still gives us some expected values
- Test that we, as the user, can highlight whether we want to us argo, bottle, or ctd data
- Test that we, as the user, can highlight if we want to use some combination of data sets. This test also checks whether using two boxes, but asking for no data from one of the boxes, gives an equal result to simply using one box.
Old Matlab Implementation
Gets all the wanted data (some combination of argo, bottle, and ctd) from a given region (usually the 25 WMO boxes that are found in the find_25boxes function).
Historical data is stored as files in the format of _<argo/bot/ctd>.mat. Each file contains all of the argo/bottle/ctd data from this given area. A 2D array in the form of [WMO box name, use ctd flag, use bottle flag, use argo flag] is passed into the function, along with the current float name, and the configuration file set up. We use the configuration set up to locate the different directories containing the data we want, and then use the WMO box name to store the correct data. If we are taking data from the argo data set, we check to see whether or not the float we are currently processing appears in the argo data. If it does, we remove all the data associated with it (as we do not want to compare the current float data against its own historical data).
We then wrap longitudinal values to make mapping easier, and alter the dates into a decimalised date form.
The returned values is an array of latitudes, an array of longitudes, and an array of dates (or ages).