Report which rule a spatial selection used to choose faces - #125
Merged
Conversation
The three selections disagree about what "in" means and none of them said so: subset_polygon selects by face centre, cross_section by intersection, and subset_bbox keeps a face only when its whole spherical footprint fits inside the box. Measured on an 81-face mesh of 5-degree cells, a box of lon 5-15 / lat 5-15 holds six face centres and returns one face, and the surviving face spans latitude 7.5000-12.5115 because the great-circle edge bulges poleward of the nodes it joins. subset_coverage now carries selection_rule, and for subset_bbox also n_face_centers_in_bounds. Dropping boundary faces happens on every bounding-box call, so it is reported and not warned about. A box narrower than one face was a separate problem: it selects nothing while sitting on top of the mesh, and the refusal told the caller to move it onto the mesh, which is where it already was. Measured at lon 6-11 / lat 6-11, one centre inside and zero faces returned. That case now gets its own repair.
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.
subset_bboxkeeps a face only when its whole spherical footprint fits inside the box,subset_polygonkeeps it when the centre is inside, andcross_sectionwhen the line crosses it, and nothing in the result said which rule ran: measured on an 81-face mesh of 5-degree cells, a box of lon 5-15 / lat 5-15 holds six face centres and returns one face, whose latitude span of 7.5000-12.5115 shows the great-circle edge bulging past its own nodes.subset_coveragenow reportsselection_ruleplus, for bbox,n_face_centers_in_bounds, with no warning code since dropping boundary faces happens on every bounding-box call. Separately, a box narrower than one face selects nothing while sitting on the mesh and was told to move onto the mesh, which is where it already was, so that case now gets a repair telling it to widen.