Skip to content

Several issues with masking #30

@teutoburg

Description

@teutoburg

The masking functionality currently has several issues:

Functional problems

  • In circ and rect modes, if more than one set of coordinates is supplied, only the first one is used. On one hand, this is fine, because only one point is needed to define these shape. However, maybe it would be a good idea to at least let the user know that the other coordinates are ignored.
  • Contrarily, in poly mode, if only one or two sets of coordinates are supplied, a PolygonSkyRegion is still created. This does not make sense, because at least three points are needed to define a polygon. An error should be raised and the region skipped if less than three points are supplied in this mode.
  • Also in poly mode, the size sub-dictionary is completely ignored (as it's not necessary for defining a polygon), however, not supplying this will raise an error. This should be the other way around: print a warning if a size is specified, informing the user that it is ignored; but not supplying a size should not cause any problems.
  • RectangleSkyRegion can take an additional argument angle, which allows to specify the rotation of the rectangle with respect to the coordinate system. This currently cannot be used with the masking API.

Future considerations to investigate

  • Numpy has a built-in module numpy.ma to deal with array masking. Maybe it would make sense to use this instead of manually implementing masking.

Documentation / UX issues

  • How to masking #12
  • Similar to other config files: provide a solid way to distribute an example / template for using this functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions