Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
owc-software-python owc-software-python
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • bodc
  • owc-software-pythonowc-software-python
  • Merge requests
  • !6

Merged
Created Oct 01, 2019 by edsmall@edsmallContributor

ARGODEV-138: find_25boxes

  • Overview 0
  • Commits 17
  • Pipelines 12
  • Changes 5

Jira Issue

https://jira.ceh.ac.uk/browse/ARGODEV-138

Python Implementation

Uses latitude and longitude to find grid point references:

    | -5    5   15  ...  355  365
----|----------------------------
 85 | 631   1   19  ...  631   1
 75 | 632   2   20  ...  632   2
 65 | 633   3   21  ...  633   3
 ...|...   ...  ... ...  ...  ...
 -85| 648   18  36  ...  648   18

returning the 25 WMO boxes with the float profile in the very centre. I tried using multiple interpolation tools, including interp2d, RectBivariateSpline, and map_coordinates. None quite mirrored the Matlab implimentation, so I made my own function called nearest_neighbour to do the job for me.

Testing

6 tests were written:

  1. Is the matlab matrix (wmo_boxes.mat) loadable?
  2. Does nearest_neighbour return the expected grid point?
  3. Does nearest_neighbour return a value that exists in the grid?
  4. Does find_25boxes return a matrix of the expected shape?
  5. Does find_25boxes return a matrix of NaN if the longitude and latitude inputs are NaN?
  6. Does find_25boxes return a matrix where each row of the matrix exists in wmo_boxes.mat?

Old Matlab Implementation

Very similar to my python set up, but used inbuilt interpolation functions, as well as using full matrices, instead of axes for the interpolation. Input arguments are a longitude [int], latitude [int], and the wmo_boxes [matlab matrix]. The function handles wrapping of longitudinal inputs.

Edited Oct 30, 2019 by edsmall
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: edsmall/find-25-boxes