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

Add Identifyflats #24

Merged
merged 6 commits into from
May 24, 2024
Merged

Add Identifyflats #24

merged 6 commits into from
May 24, 2024

Conversation

Teschl
Copy link
Contributor

@Teschl Teschl commented May 17, 2024

Implements identifyflats for the GridObject. To be able to use this function efficiently when creating the FlowObject I added an argument raw to just return the ndarray.

Since there is no way of making a function private in python, I think it's important to still add a function that returns multiple GridObjects. By using the output argument, the number of returned dems can be changed.

  • flats, sills = dem.identifyflats(output=['flats', 'sills']) (default)
  • flats = dem.identifyflats(output=['flats'])
  • sills = dem.identifyflats(output=['sills'])

image

When using dem.identifyflats(raw=True) instead of multiple GridObject the return will be an int32_t nd.ndarray. This also contains presills.

image

Closes #22

@Teschl Teschl changed the title Add Identflats Add Identifyflats May 17, 2024
@wkearn wkearn self-requested a review May 23, 2024 13:39
Copy link
Contributor

@wkearn wkearn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good! I think having different return types for external and internal use is a good idea for now.

There is one problem with the documentation for identifyflats.

You also need to merge/rebase the latest changes to main: the comments introduced by #23 to grid.cpp are causing a merge conflict.

src/topotoolbox/gridmixins/identifyflats.py Outdated Show resolved Hide resolved
@Teschl
Copy link
Contributor Author

Teschl commented May 24, 2024

Adjusted the documentation and resolved the merge conflict, should be ready to be merged now. @wkearn

@wkearn wkearn merged commit 8f19d08 into TopoToolbox:main May 24, 2024
3 checks passed
@Teschl Teschl deleted the identflats branch May 24, 2024 15:38
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.

Add identifyflats
2 participants