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

Error in eccentricity calculation #728

Open
AlexShkarin opened this issue Apr 12, 2023 · 0 comments
Open

Error in eccentricity calculation #728

AlexShkarin opened this issue Apr 12, 2023 · 0 comments

Comments

@AlexShkarin
Copy link

It looks like there's a problem with eccentricity calculations related to the cosine mask produced by the cosmask function. The logic of the calculations and the related normalization code (e.g., in _refine function) assumes that this mask is equal to zero at the center. However, in reality it is equal to one, since np.arctan2 function used by theta_mask simply returns 0 rad when both of its arguments are zero at the center. As a result, the eccentricity values are systematically off, especially for compact features (in the limit of a single-pixel feature it would give an eccentricity of infinity).

One way to solve this issue is to explicitly set the center to zero either in the cosmask definition, or in all the places where it is later used (as far as I can see, 4 different places in the code).

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

No branches or pull requests

1 participant