Skip to content

Commit

Permalink
fix: typos in polygons methods said that they don't accept self inter…
Browse files Browse the repository at this point in the history
…secting polygons
  • Loading branch information
ManonMarchand committed Jul 2, 2024
1 parent 51309c7 commit 89a8334
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions python/mocpy/moc/moc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,15 +1368,28 @@ def from_polygon_skycoord(cls, skycoord, max_depth=10):
Parameters
----------
skycoord : `astropy.coordinates.SkyCoord`
The sky coordinates defining the vertices of a polygon. It can describe a convex or
concave polygon but not a self-intersecting one.
The sky coordinates defining the vertices of a polygon.
max_depth : int, optional
The resolution of the MOC. Set to 10 by default.
Returns
-------
result : `~mocpy.moc.MOC`
The resulting MOC
Examples
--------
>>> from astropy.coordinates import SkyCoord
>>> from mocpy import MOC
>>> MOC.from_polygon_skycoord(SkyCoord([80, 82, 76], [36, 33, 33], unit="deg")) # doctest: +ELLIPSIS
6/1293
7/5149-5151 5165 5169-5171 5176-5177 5180-5181 5186 5192 5194 5216 5218-5219
...
See Also
--------
from_polygon
from_polygons
"""
return cls.from_polygon(
lon=skycoord.icrs.ra,
Expand Down Expand Up @@ -1424,6 +1437,11 @@ def from_polygons(cls, list_vertices, max_depth=10, n_threads=None):
>>> list_mocs == list_mocs_no_check_no_wrap
True
See Also
--------
from_polygon
from_polygon_skycoord
"""
if isinstance(list_vertices[0], SkyCoord):
lon_lat_list = [
Expand Down Expand Up @@ -1454,8 +1472,7 @@ def from_polygon(cls, lon, lat, complement=False, max_depth=10):
Parameters
----------
lon : `astropy.coordinates.Longitude` or its supertype `astropy.units.Quantity`
The longitudes defining the polygon. Can describe convex and
concave polygons but not self-intersecting ones.
The longitudes defining the polygon.
lat : `astropy.coordinates.Latitude` or its supertype `astropy.units.Quantity`
The latitudes defining the polygon. Can describe convex and concave
polygons but not self-intersecting ones.
Expand All @@ -1467,6 +1484,11 @@ def from_polygon(cls, lon, lat, complement=False, max_depth=10):
-------
result : `~mocpy.moc.MOC`
The resulting MOC
See Also
--------
from_polygons
from_polygons_skycoord
"""
index = mocpy.from_polygon(
lon,
Expand Down

0 comments on commit 89a8334

Please sign in to comment.