Skip to content

Error in eccentricity calculation #728

@AlexShkarin

Description

@AlexShkarin

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions