Open
Conversation
Contributor
|
@SamuelTrahanNOAA great! thanks Samuel this is in public JCSDA and would need to be brought into internal, I can do this on your behalf. Also would make sense to add a ctest possibly, and just leverage another existing ctest. If it's brought in would it make sense that this is something to pass along to @guoqing-noaa (adding the ctest) |
Author
|
It needs a ctest, but the ctests won't run on the machine I've been using for development. I'm moving to another machine that might be able to run the ctests. Once I can run ctests, I'll add one for this filter. |
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Filters observations that are outside of a polygon on the sphere. Supports convex and concave polygons, including dateline-crossing, pole-crossing, and polygons that span more than half the sphere. It has been tested with a full domain boundary containing about twelve thousand vertices, and with polygons as small as three vertices.
The implementation uses boost::geometry::within, in the cs::geographic coordinate system. Calculations are done in double precision with degrees.
Note that, like all template-heavy calculations, automatic inlining is critical for performance. With GCC, I saw a factor of 20 difference in performance of boost::geometry::within between inlining and non-inlining compilation. This won't matter for small polygons and a few observations, but it'll matter for a full domain boundary and many thousands of observations.
Example:
The inside point determines which side of the polygon is inside. Vertex longitudes and latitudes specify the polygon.
All points outside the polygon are flagged. Hence, in this example, all observations outside the polygon will be removed from the obs space.
The behavior at the exact polygon boundary will be inconsistent, so it is best to expand the polygon if you want the edges to be included.
Issue(s) addressed
No issues have been submitted; this development came about due to internal discussions.
Dependencies
None
Impact
None
Checklist