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

Several issues with masking #30

Open
7 tasks
teutoburg opened this issue Mar 31, 2023 · 0 comments
Open
7 tasks

Several issues with masking #30

teutoburg opened this issue Mar 31, 2023 · 0 comments
Labels
invalid This doesn't seem right

Comments

@teutoburg
Copy link
Owner

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.
@teutoburg teutoburg added the invalid This doesn't seem right label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant