Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement snapshot tests for identifyflats and handle NaN s #139

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

wkearn
Copy link
Contributor

@wkearn wkearn commented Oct 22, 2024

Resolves #138

test/snapshot.cpp runs identifyflats on the various snapshot data sets.

src/identifyflats.c has one small change to ensure that NaNs are handled consistently with TopoToolbox v2. Neighboring NaNs are treated as if they lie below the current pixel, but NaNs are not themselves flats. fminf ensures consistent NaN treatment, and the NaN equality semantics ensures that NaNs are never set.

The sills are already handled correctly, since they are only compared to neighbors that are known to be flats.

test/snapshot.cpp runs `identifyflats` on the various snapshot data
sets.

src/identifyflats.c has one small change to ensure that NaNs are
handled consistently with TopoToolbox v2. Neighboring NaNs are treated
as if they lie below the current pixel, but NaNs are not themselves
flats. fminf ensures consistent NaN treatment, and the NaN equality
semantics ensures that NaNs are never set.

The sills are already handled correctly, since they are only compared
to neighbors that are known to be flats.

Signed-off-by: William Kearney <[email protected]>
@wkearn wkearn merged commit 701ade6 into TopoToolbox:main Oct 22, 2024
6 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.

Implement snapshot tests for identifyflats
1 participant