Skip to content

Gate zonal_anomaly on the coverage of its own answer - #121

Merged
rajeeja merged 1 commit into
mainfrom
rajeeja/zonal-anomaly-coverage
Sep 6, 2026
Merged

Gate zonal_anomaly on the coverage of its own answer#121
rajeeja merged 1 commit into
mainfrom
rajeeja/zonal-anomaly-coverage

Conversation

@rajeeja

@rajeeja rajeeja commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

A band mean is undefined as soon as one face in the band is missing, so every face in that band comes back NaN including faces that carried a value; measured on a 90-face mesh, one gap per latitude band emptied all 90 faces while 85 held data, and the result was outcome: complete with no warning and stats of all nulls. Results now carry anomaly_coverage, zero coverage refuses with no number, and ANOMALY_COVERAGE_PARTIAL fires on faces that lost an anomaly rather than on faces that never had data, so a land-masked field does not warn on every call. 17 new tests; full suite 821 passed, 18 skipped; pre-commit green.

A band mean is undefined as soon as one face in the band is missing, and every
face in that band then comes back NaN -- including faces that carried a value.
Measured on a 90-face regional mesh, one missing value per latitude band
emptied all 90 faces while 85 of them held data, and the result was
outcome: complete, status: complete, no warning codes, and stats of
{min: null, max: null, mean: null, std: null}. The partial case was quieter:
30 faces with data, 18 anomalies returned, 12 measurable faces dropped, and
finite min/max/mean/std computed from the survivors.

The bin coverage added for calculate_zonal_mean does not apply here, because
zonal_anomaly returns a per-face field and there are no bins in it to count.
Results now carry anomaly_coverage, zero coverage fails
anomaly_coverage_nonzero and returns no number, and the partial code fires on
faces that lost an anomaly rather than on faces that never had data -- so an
ordinary land-masked field does not warn on every call. The repair names the
missing values rather than lat_spec when faces did carry data, since no choice
of bands can avoid a gap that is in every band.
@rajeeja
rajeeja merged commit 2646f34 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