Skip to content

Commit

Permalink
docstring update
Browse files Browse the repository at this point in the history
  • Loading branch information
Moustikitos committed Jan 4, 2021
1 parent f1e032a commit 7c9213e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Gryd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,30 @@ def add_map_point(self, px, py, point):
self._xiyi()

def delete_map_point(self, *points_or_indexes):
"""
Delete multiple calibration points using index (starting with 1) or
`Gryd.Point` reference.
```python
pvs.delete_map_point(0)
[<px=512 py=512
<lon=+179°59'56.400" lat=-085°00'0.000" alt=0.000>
<X=20037397.023 Y=-19971868.880s alt=0.000>
>]
>>> pvs.delete_map_point(pvs.map_points[0])
[<px=0 py=0
<lon=-179°59'56.400" lat=+085°00'0.000" alt=0.000>
<X=-20037397.023 Y=19971868.880s alt=0.000>
>]
>>> pvs.map_points
[]
```
Arguments:
*points_or_indexes (int or Gryd.Point): index (starting with 1)
or point reference
Returns:
`list` of deleted `Gryd.Point`
"""
result = []
for point_or_index in points_or_indexes:
if isinstance(point_or_index, int) and \
Expand Down Expand Up @@ -1013,6 +1037,12 @@ def crs2map(self, point):
<X=-696797.339 Y=7048145.354s alt=0.000>
>
```
Arguments:
point (Gryd.Geodesic or Gryd.Geographic): geodesic or geographic
coordinates
Returns:
`Gryd.Point`
"""
if isinstance(point, Geodesic):
geodesic_point = point
Expand Down
44 changes: 44 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,40 @@ ones.
- `point` _Gryd.Geodesic or Gryd.Geographic_ - geodesic or geographic
coordinates

<a name="Gryd.Crs.delete_map_point"></a>
#### delete\_map\_point

```python
| delete_map_point(*points_or_indexes)
```

Delete multiple calibration points using index (starting with 1) or
`Gryd.Point` reference.

```python
pvs.delete_map_point(0)
[<px=512 py=512
<lon=+179°59'56.400" lat=-085°00'0.000" alt=0.000>
<X=20037397.023 Y=-19971868.880s alt=0.000>
>]
>>> pvs.delete_map_point(pvs.map_points[0])
[<px=0 py=0
<lon=-179°59'56.400" lat=+085°00'0.000" alt=0.000>
<X=-20037397.023 Y=19971868.880s alt=0.000>
>]
>>> pvs.map_points
[]
```

**Arguments**:

- `*points_or_indexes` _int or Gryd.Point_ - index (starting with 1)
or point reference

**Returns**:

`list` of deleted `Gryd.Point`

<a name="Gryd.Crs.map2crs"></a>
#### map2crs

Expand Down Expand Up @@ -663,6 +697,7 @@ coordinates.

Pixel interpolation on raster image from geodesic point.


```python
>>> pvs.crs2map(london)
<px=256 py=170
Expand All @@ -676,3 +711,12 @@ Pixel interpolation on raster image from geodesic point.
>
```

**Arguments**:

- `point` _Gryd.Geodesic or Gryd.Geographic_ - geodesic or geographic
coordinates

**Returns**:

`Gryd.Point`

0 comments on commit 7c9213e

Please sign in to comment.