gri-plot 0.2.0.post1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gri_plot/__init__.py +94 -0
- gri_plot/figure3d.py +476 -0
- gri_plot/frames.py +181 -0
- gri_plot/observables/__init__.py +21 -0
- gri_plot/observables/aoa.py +123 -0
- gri_plot/observables/fdoa.py +254 -0
- gri_plot/observables/los.py +154 -0
- gri_plot/observables/range_sphere.py +74 -0
- gri_plot/observables/tdoa.py +201 -0
- gri_plot/observables/terrain.py +293 -0
- gri_plot/plot_ellipse.py +183 -0
- gri_plot/py.typed +0 -0
- gri_plot/scatter.py +76 -0
- gri_plot/scatter_map.py +93 -0
- gri_plot/shapes/__init__.py +19 -0
- gri_plot/shapes/cone.py +227 -0
- gri_plot/shapes/cylinder.py +219 -0
- gri_plot/shapes/ellipse.py +117 -0
- gri_plot/shapes/ellipsoid.py +227 -0
- gri_plot/shapes/meshgen.py +245 -0
- gri_plot/shapes/sphere.py +152 -0
- gri_plot/surfaces/__init__.py +171 -0
- gri_plot/surfaces/gradients/__init__.py +39 -0
- gri_plot/surfaces/gradients/axis.py +74 -0
- gri_plot/surfaces/gradients/line.py +86 -0
- gri_plot/surfaces/gradients/plane.py +53 -0
- gri_plot/surfaces/gradients/point.py +40 -0
- gri_plot/surfaces/intersection.py +217 -0
- gri_plot/surfaces/mesh.py +603 -0
- gri_plot-0.2.0.post1.dist-info/METADATA +149 -0
- gri_plot-0.2.0.post1.dist-info/RECORD +33 -0
- gri_plot-0.2.0.post1.dist-info/WHEEL +4 -0
- gri_plot-0.2.0.post1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gri-plot
|
|
3
|
+
Version: 0.2.0.post1
|
|
4
|
+
Project-URL: repository, https://gitlab.com/geosol-foss/python/gri-plot
|
|
5
|
+
Project-URL: homepage, https://geosolresearch.com
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.14
|
|
9
|
+
Requires-Dist: gri-utils
|
|
10
|
+
Requires-Dist: numpy>=2.3.3
|
|
11
|
+
Requires-Dist: plotly>=6.3.0
|
|
12
|
+
Requires-Dist: scikit-image>=0.25.0
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
[](https://geosolresearch.com)
|
|
16
|
+
|
|
17
|
+
# Plot (3D Geolocation Visualization)
|
|
18
|
+
|
|
19
|
+
3D geolocation visualization and 2D plotting utilities built on Plotly. Requires Python 3.14+.
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
This library renders implicit surfaces (TDOA hyperboloids, FDOA iso-Doppler surfaces, AOA cones, range spheres, terrain) and geometric shapes (ellipsoids, spheres, cones, cylinders) as interactive 3D meshes. It also provides shorthand functions for 2D scatter plots and geographic maps.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install gri-plot
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For development:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://gitlab.com/geosol-foss/python/gri-plot.git
|
|
35
|
+
cd gri-plot
|
|
36
|
+
. .init_venv.sh
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from gri_plot import scatter
|
|
43
|
+
|
|
44
|
+
# Simple 2D scatter plot -- pass traces as (y,), (x,y), or (x,y,kwargs)
|
|
45
|
+
scatter(
|
|
46
|
+
([1, 2, 3, 4],), # y-only trace
|
|
47
|
+
([0, 1, 2, 3], [1, 4, 2, 5]), # x,y trace
|
|
48
|
+
([0, 1, 2, 3], [2, 3, 1, 4], {"name": "Series B"}),
|
|
49
|
+
title="Example Plot",
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Scatter
|
|
54
|
+
|
|
55
|
+
Plotly scatter plots with flexible input formats. Accepts variable-length trace info as `(y,)`, `(x,y)`, or `(x,y,trace_args)`. All traces must consistently define or omit x. Uses `plotly_dark` template by default.
|
|
56
|
+
|
|
57
|
+
## Scatter Map
|
|
58
|
+
|
|
59
|
+
Geographic scatter maps using Plotly's Scattermapbox. Takes lat/lon sequences, uses ArcGIS World Imagery as the base layer, and auto-centers the map based on data bounds.
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from gri_plot import scatter_map
|
|
63
|
+
|
|
64
|
+
scatter_map(
|
|
65
|
+
lats=[40.0, 40.1, 40.2],
|
|
66
|
+
lons=[-105.0, -104.9, -104.8],
|
|
67
|
+
title="Station Locations",
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Figure3D
|
|
72
|
+
|
|
73
|
+
Scene builder for composing 3D visualizations from multiple surfaces and points:
|
|
74
|
+
|
|
75
|
+
- **`add_surface()`**: Add any `ImplicitShape` (shapes or observables)
|
|
76
|
+
- **`add_points()`**: Add labeled scatter points
|
|
77
|
+
- **`add_line()`**: Add line segments connecting points
|
|
78
|
+
- **`add_intersection()`**: Highlight where multiple surfaces intersect
|
|
79
|
+
- **`plot_surfaces()`**: Convenience function for quick multi-surface plots
|
|
80
|
+
- Method chaining, automatic color cycling from D3 palette, `plotly_dark` template
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from gri_plot import Figure3D
|
|
84
|
+
from gri_plot.shapes import Sphere
|
|
85
|
+
from gri_plot.observables import TdoaSurface
|
|
86
|
+
import numpy as np
|
|
87
|
+
|
|
88
|
+
fig = Figure3D()
|
|
89
|
+
fig.add_surface(Sphere(center=np.array([0, 0, 0]), radius=100))
|
|
90
|
+
fig.add_points(np.array([[50, 50, 50]]), labels=["Target"])
|
|
91
|
+
fig.show()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Frames
|
|
95
|
+
|
|
96
|
+
Coordinate frame handling for 3D display:
|
|
97
|
+
|
|
98
|
+
- **Frame enum**: XYZ (ECEF), ENU (local tangent plane), LLA (lat/lon/alt)
|
|
99
|
+
- **FrameTransformer**: Converts between XYZ and display frame using gri-utils coordinate conversions
|
|
100
|
+
- **Bounds**: Named tuple for axis-aligned bounding boxes with frame metadata
|
|
101
|
+
- All internal computation in XYZ; frame conversion applied only for display
|
|
102
|
+
|
|
103
|
+
## Shapes
|
|
104
|
+
|
|
105
|
+
Geometric primitives implementing the `ImplicitShape` ABC. Each supports parametric mesh generation (fast, exact geometry) and implicit residual evaluation (for intersection calculations).
|
|
106
|
+
|
|
107
|
+
- **Ellipsoid**: From center + covariance matrix, or center + semi-axes + rotation matrix
|
|
108
|
+
- **Sphere**: From center + radius
|
|
109
|
+
- **Cone**: From apex + axis direction + half-angle + height
|
|
110
|
+
- **Cylinder**: From center + axis direction + radius + height
|
|
111
|
+
- **Mesh generators**: Standalone functions (`sphere_mesh`, `ellipsoid_mesh`, `cone_mesh`, `cylinder_mesh`) for direct vertex/face generation
|
|
112
|
+
|
|
113
|
+
## Observables
|
|
114
|
+
|
|
115
|
+
Geolocation-specific surfaces for visualizing measurement iso-surfaces. Some inherit from shapes (reusing parametric rendering), others use marching cubes for mesh extraction.
|
|
116
|
+
|
|
117
|
+
- **TdoaSurface**: TDOA hyperboloid where range_1 - range_2 = c x tdoa, from two collector positions + time difference
|
|
118
|
+
- **FdoaSurface**: FDOA iso-Doppler surface from two collector positions/velocities + carrier frequency + frequency difference
|
|
119
|
+
- **AoaSurface**: AOA cone (extends Cone) from collector position + measured direction + angular error
|
|
120
|
+
- **LosSurface**: Line of sight ray (extends Cylinder) from start point + direction + length; also provides `to_line_trace()` for simple line rendering
|
|
121
|
+
- **RangeSphere**: Range/TOA sphere (extends Sphere) from collector position + range measurement
|
|
122
|
+
- **TerrainSurface**: Terrain from XYZ vertex grid with interpolated residual evaluation; factory methods `from_xyz_grids()` and `from_elevation_grid()`
|
|
123
|
+
|
|
124
|
+
## Surfaces
|
|
125
|
+
|
|
126
|
+
Low-level infrastructure for implicit surface rendering:
|
|
127
|
+
|
|
128
|
+
- **ImplicitShape ABC**: Interface requiring `residual_fn()`, `get_bounds_xyz()`, `to_mesh()`, `to_trace()`, `is_volume`, `label`; also provides `contains()` for point-in-shape testing
|
|
129
|
+
- **Mesh utilities**: `field_to_mesh()` (marching cubes with Newton-Raphson surface projection and adaptive refinement), `grid_to_mesh()` (parametric grid triangulation), `vertices_to_mesh3d()` (vertices/faces to Plotly Mesh3d trace)
|
|
130
|
+
- **IntersectionField**: Euclidean distance in residual space for highlighting multi-surface intersections; distinguishes volumes (interior contribution) from surfaces (boundary contribution)
|
|
131
|
+
- **Gradient functions**: Intensity calculators for mesh coloring -- `distance_from_point`, `distance_from_line`, `distance_from_line_segment`, `distance_from_plane`, `distance_from_axis`, `axis_value`
|
|
132
|
+
|
|
133
|
+
## Dependencies
|
|
134
|
+
|
|
135
|
+
- **plotly**: Interactive 2D and 3D visualization
|
|
136
|
+
- **matplotlib**: Static plot support
|
|
137
|
+
- **numpy**: Array operations
|
|
138
|
+
- **scipy**: Marching cubes mesh extraction
|
|
139
|
+
- **scikit-image**: Additional mesh processing
|
|
140
|
+
- **gri-utils**: Coordinate conversions and constants
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
## Other Projects
|
|
144
|
+
|
|
145
|
+
Current list of other [GRI FOSS Projects](https://gitlab.com/geosol-foss/python/gri-plot/-/blob/main/.docs_other_projects.md) we are building and maintaining.
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
MIT License. See [LICENSE](https://gitlab.com/geosol-foss/python/gri-plot/-/blob/main/LICENSE) for details.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
gri_plot/__init__.py,sha256=wb1mKBMZa6Kfu9SoIggElw1fRY_uPVblNM-RJCm7UVE,2262
|
|
2
|
+
gri_plot/figure3d.py,sha256=7nBFAuLsq51iVSd1jCcBbwVwiSgX5pe22zMvI_v5SCw,14717
|
|
3
|
+
gri_plot/frames.py,sha256=2TBWq0JSNDd3kUlcOBRsXdlqUegDT6pPZddx9dnmUwU,6363
|
|
4
|
+
gri_plot/plot_ellipse.py,sha256=5shgaVQFZNZ97OWfRSBv0YJasI8TdJqPFWwzwjA1evU,5088
|
|
5
|
+
gri_plot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
gri_plot/scatter.py,sha256=JtT8CW2vvuolh39zdk6FDyidRFSqTfW2guRFfCHX0N4,2978
|
|
7
|
+
gri_plot/scatter_map.py,sha256=pXclsSKtAFGaU7JaCXnlyS2Ldu1hPFX-DyjpeNXha-s,3403
|
|
8
|
+
gri_plot/observables/__init__.py,sha256=cOaUDT9PQZULgiyFN_vBMe3pGAYM5PfPR10jrwNZ85s,485
|
|
9
|
+
gri_plot/observables/aoa.py,sha256=-FRqe6aHlARTDuHGLmOx2i2bpsJ6KHUmT0Rfj3kiiBQ,3823
|
|
10
|
+
gri_plot/observables/fdoa.py,sha256=fEJZffdcqXAYPoUzdFU5zSaZa6TAvQI151DIMy0YHGM,8289
|
|
11
|
+
gri_plot/observables/los.py,sha256=AMI2NbKtReCBUUL-zrWtgjc2Z8xqdvi4oaHU0Y33r9c,4409
|
|
12
|
+
gri_plot/observables/range_sphere.py,sha256=bkEV1b_WN_Pq1JshtdHG9IhGL3GJrg7IT6-wv9oEqZ8,2088
|
|
13
|
+
gri_plot/observables/tdoa.py,sha256=IUNV1bkFl4ADBJafZPIOXT6Dn4uIZmUFSJ86f4P19vA,6527
|
|
14
|
+
gri_plot/observables/terrain.py,sha256=SO4rmCgOAfz2P6ZP71wp8fxA-MAkS08aWrXN3MYq_YM,9614
|
|
15
|
+
gri_plot/shapes/__init__.py,sha256=a5FowzknIpt9HYloqGkTvPkGrJoV74X21_bZJP7GxLE,412
|
|
16
|
+
gri_plot/shapes/cone.py,sha256=D86ZSqXf-lpKZwx2wlh_EwR22oRW1vYRGMXvbNEeAgs,7269
|
|
17
|
+
gri_plot/shapes/cylinder.py,sha256=eFzlVk7FamQaQCcz4CsMZuOYsZgp2PGIduXUFeWRVvo,6701
|
|
18
|
+
gri_plot/shapes/ellipse.py,sha256=QCsbAKfChU-ON78qYFFU4asi-Lpmn9Ud-LalU3JUBRw,3894
|
|
19
|
+
gri_plot/shapes/ellipsoid.py,sha256=ngS-0Nh5KIyzImz9sWd1Hb_ATKivaWulX-XOFqA0Wx8,7696
|
|
20
|
+
gri_plot/shapes/meshgen.py,sha256=JeePyndIqbhuf4LvjwQZGOGL3_fg-BscP12blgrZoA8,7380
|
|
21
|
+
gri_plot/shapes/sphere.py,sha256=tgM9stgvBltjPeDtoDRcK63eklR6TNlgYylq2X2zsbw,4400
|
|
22
|
+
gri_plot/surfaces/__init__.py,sha256=KJeIdIu8Gn-yeerw_3cW8-7h77efh0H4GsY1pb_rbuI,4846
|
|
23
|
+
gri_plot/surfaces/intersection.py,sha256=UAL4n1Tr6_8pw8I_L6A3Ta1Me_R9ZrwC39BPthPmqJc,7393
|
|
24
|
+
gri_plot/surfaces/mesh.py,sha256=hDUMUvYN71tAxiAXNImlqEX-TW_29FgHL10ut9QFKek,20759
|
|
25
|
+
gri_plot/surfaces/gradients/__init__.py,sha256=TYTTHL0YIFqswu16uw5SmUCLlzJIHboW2e5I3PqK2-Y,1171
|
|
26
|
+
gri_plot/surfaces/gradients/axis.py,sha256=jmt4pC3j6I8pxbVw4fKPPiF1PQpagLjai8OGaZ0cD9o,1983
|
|
27
|
+
gri_plot/surfaces/gradients/line.py,sha256=8DACh5yMwdJOQeDkXcygC7-RLqxWmuCU1BVTEIcxnvA,2662
|
|
28
|
+
gri_plot/surfaces/gradients/plane.py,sha256=fIbowGxnhd20mqtE2DlxKGwP-ROhao1Kkcac3rKc-0U,1539
|
|
29
|
+
gri_plot/surfaces/gradients/point.py,sha256=PPR-zdFm7LA-TLAbz8yQhL-sofFafL7Ec-IcGSLi2ko,970
|
|
30
|
+
gri_plot-0.2.0.post1.dist-info/METADATA,sha256=NBNz91Ot4MSFkCjyvgxwUdY95JNtEiZiVjgdZE2Gpqs,6246
|
|
31
|
+
gri_plot-0.2.0.post1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
32
|
+
gri_plot-0.2.0.post1.dist-info/licenses/LICENSE,sha256=Noh51pACFQty7ATtDK2D_6HNrc_UIcsyCFYJY0I9zEM,1077
|
|
33
|
+
gri_plot-0.2.0.post1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 GeoSol Research Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|