Skip to content

Handling of NaN values while calculating tpi #9

@BENR0

Description

@BENR0

Is your feature request related to a problem? Please describe.
When the array the tpi is calculated on contains NA values all pixels in the result where the window around it contains this NA value will be NA.
This is due to the tpi calculation using convolve which does not allow handling NA values.

Describe the solution you'd like
There should be an option to specify how NA values will be handled. For example allow a certain amount of NA values in the window.

Additional context
Something like:
https://stackoverflow.com/questions/38318362/2d-convolution-in-python-with-missing-data
could be implemented which recalculates NA areas after convolution.
Due to the loop this is possibly very slow depending on how many NA values are present.

Maybe https://github.com/Xunius/python_convolution is an option which is the same principle but uses fortran.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions