You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The masking functionality currently has several issues:
Functional problems
circ
andrect
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.poly
mode, if only one or two sets of coordinates are supplied, aPolygonSkyRegion
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.poly
mode, thesize
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 argumentangle
, 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.ma
to deal with array masking. Maybe it would make sense to use this instead of manually implementing masking.Documentation / UX issues
The text was updated successfully, but these errors were encountered: