Skip to content

Report which rule a spatial selection used to choose faces - #125

Merged
rajeeja merged 1 commit into
mainfrom
rajeeja/subset-selection-rule
Sep 6, 2026
Merged

Report which rule a spatial selection used to choose faces#125
rajeeja merged 1 commit into
mainfrom
rajeeja/subset-selection-rule

Conversation

@rajeeja

@rajeeja rajeeja commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

subset_bbox keeps a face only when its whole spherical footprint fits inside the box, subset_polygon keeps it when the centre is inside, and cross_section when 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_coverage now reports selection_rule plus, 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.

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.
@rajeeja
rajeeja merged commit 29a7f8b into main Sep 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant