phased-array-modeling 1.0.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 John Hodge
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.
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: phased-array-modeling
3
+ Version: 1.0.0
4
+ Summary: Comprehensive Python library for phased array antenna modeling and visualization
5
+ Author-email: John Hodge <jah70@vt.edu>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jman4162/Phased-Array-Antenna-Model
8
+ Project-URL: Repository, https://github.com/jman4162/Phased-Array-Antenna-Model
9
+ Project-URL: Issues, https://github.com/jman4162/Phased-Array-Antenna-Model/issues
10
+ Keywords: phased array,antenna,beamforming,radar,electromagnetics,array factor,radiation pattern
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Scientific/Engineering :: Physics
24
+ Requires-Python: >=3.8
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: numpy>=1.20.0
28
+ Requires-Dist: matplotlib>=3.5.0
29
+ Requires-Dist: scipy>=1.7.0
30
+ Provides-Extra: plotting
31
+ Requires-Dist: plotly>=5.0.0; extra == "plotting"
32
+ Provides-Extra: full
33
+ Requires-Dist: plotly>=5.0.0; extra == "full"
34
+ Requires-Dist: seaborn>=0.11.0; extra == "full"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
37
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
38
+ Requires-Dist: plotly>=5.0.0; extra == "dev"
39
+ Requires-Dist: seaborn>=0.11.0; extra == "dev"
40
+ Dynamic: license-file
41
+
42
+ # Phased Array Antenna Modeling
43
+
44
+ [![CI](https://github.com/jman4162/Phased-Array-Antenna-Model/actions/workflows/ci.yml/badge.svg)](https://github.com/jman4162/Phased-Array-Antenna-Model/actions/workflows/ci.yml)
45
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
46
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
47
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/jman4162/Phased-Array-Antenna-Model/blob/main/Phased_Array_Demo.ipynb)
48
+
49
+ A comprehensive Python library for computing and visualizing phased array antenna radiation patterns. Features **125x faster** vectorized computations, multiple array geometries, advanced beamforming, and interactive 3D visualization.
50
+
51
+ ## Features
52
+
53
+ - **High Performance**: Vectorized array factor computation (125x faster than naive loops)
54
+ - **Multiple Geometries**: Rectangular, triangular, circular, cylindrical, spherical, sparse/thinned arrays
55
+ - **Beamforming**: Amplitude tapering (Taylor, Chebyshev, etc.), null steering, multi-beam
56
+ - **Realistic Impairments**: Mutual coupling, phase quantization, element failures, scan blindness
57
+ - **Visualization**: 2D matplotlib, interactive 3D Plotly, UV-space representation
58
+ - **Subarray Support**: Subarray-level beamforming with quantized phase shifters
59
+
60
+ ## Installation
61
+
62
+ ### From GitHub (recommended)
63
+
64
+ ```bash
65
+ pip install git+https://github.com/jman4162/Phased-Array-Antenna-Model.git
66
+ ```
67
+
68
+ ### With optional dependencies
69
+
70
+ ```bash
71
+ # Include Plotly for 3D visualization
72
+ pip install "phased-array[plotting] @ git+https://github.com/jman4162/Phased-Array-Antenna-Model.git"
73
+
74
+ # Include all optional dependencies
75
+ pip install "phased-array[full] @ git+https://github.com/jman4162/Phased-Array-Antenna-Model.git"
76
+ ```
77
+
78
+ ### For development
79
+
80
+ ```bash
81
+ git clone https://github.com/jman4162/Phased-Array-Antenna-Model.git
82
+ cd Phased-Array-Antenna-Model
83
+ pip install -e ".[dev]"
84
+ ```
85
+
86
+ ## Quick Start
87
+
88
+ ```python
89
+ import phased_array as pa
90
+ import numpy as np
91
+
92
+ # Create a 16x16 rectangular array with half-wavelength spacing
93
+ geom = pa.create_rectangular_array(16, 16, dx=0.5, dy=0.5)
94
+
95
+ # Wavenumber for normalized wavelength
96
+ k = pa.wavelength_to_k(1.0)
97
+
98
+ # Steering weights for 30 degree scan with Taylor taper
99
+ weights = pa.steering_vector(k, geom.x, geom.y, theta0_deg=30, phi0_deg=0)
100
+ weights *= pa.taylor_taper_2d(16, 16, sidelobe_dB=-30)
101
+
102
+ # Compute full 2D pattern
103
+ theta, phi, pattern_dB = pa.compute_full_pattern(geom.x, geom.y, weights, k)
104
+
105
+ # Plot
106
+ pa.plot_pattern_contour(np.rad2deg(theta), np.rad2deg(phi), pattern_dB,
107
+ title="16x16 Array - 30deg Scan with Taylor Taper")
108
+ ```
109
+
110
+ ## Examples
111
+
112
+ ### Beam Steering
113
+
114
+ ```python
115
+ # Steer beam to theta=25 deg, phi=45 deg
116
+ weights = pa.steering_vector(k, geom.x, geom.y, theta0_deg=25, phi0_deg=45)
117
+
118
+ # Compute E-plane and H-plane cuts
119
+ angles, E_plane, H_plane = pa.compute_pattern_cuts(
120
+ geom.x, geom.y, weights, k,
121
+ theta0_deg=25, phi0_deg=45
122
+ )
123
+ ```
124
+
125
+ ### Null Steering
126
+
127
+ ```python
128
+ # Place nulls at specific directions to reject interference
129
+ null_directions = [(20, 0), (-20, 0)] # (theta, phi) in degrees
130
+
131
+ weights = pa.null_steering_projection(
132
+ geom, k,
133
+ theta_main_deg=0, phi_main_deg=0,
134
+ null_directions=null_directions
135
+ )
136
+ ```
137
+
138
+ ### Multiple Simultaneous Beams
139
+
140
+ ```python
141
+ # Create 3 simultaneous beams
142
+ beam_directions = [(0, 0), (25, 0), (25, 180)]
143
+
144
+ weights = pa.multi_beam_weights_superposition(
145
+ geom, k, beam_directions,
146
+ amplitudes=[1.0, 0.7, 0.7]
147
+ )
148
+ ```
149
+
150
+ ### Circular/Conformal Arrays
151
+
152
+ ```python
153
+ # Cylindrical array
154
+ geom_cyl = pa.create_cylindrical_array(
155
+ n_azimuth=16, n_vertical=8,
156
+ radius=2.0, height=4.0
157
+ )
158
+
159
+ # Compute pattern accounting for element orientations
160
+ AF = pa.array_factor_conformal(theta, phi, geom_cyl, weights, k)
161
+ ```
162
+
163
+ ### Phase Quantization Analysis
164
+
165
+ ```python
166
+ # Simulate 4-bit phase shifters
167
+ weights_quantized = pa.quantize_phase(weights, n_bits=4)
168
+
169
+ # Analyze effect on pattern
170
+ results = pa.analyze_quantization_effect(weights, geom, k, n_bits=4)
171
+ print(f"RMS phase error: {results['rms_error_deg']:.1f} degrees")
172
+ ```
173
+
174
+ ### 3D Interactive Visualization
175
+
176
+ ```python
177
+ # Create interactive 3D pattern plot
178
+ fig = pa.plot_pattern_3d_plotly(theta, phi, pattern_dB,
179
+ title="3D Radiation Pattern")
180
+ fig.show()
181
+ ```
182
+
183
+ ## Documentation
184
+
185
+ For comprehensive documentation, see the [demo notebook](Phased_Array_Demo.ipynb) which covers:
186
+
187
+ 1. Basic array factor computation
188
+ 2. Beam steering
189
+ 3. Performance benchmarking
190
+ 4. Amplitude tapering comparison
191
+ 5. Array geometries (rectangular, triangular, circular, etc.)
192
+ 6. Null steering
193
+ 7. Multiple simultaneous beams
194
+ 8. Phase quantization effects
195
+ 9. Element failure analysis
196
+ 10. UV-space visualization
197
+ 11. 3D Plotly visualization
198
+ 12. Conformal array patterns
199
+ 13. Mutual coupling effects
200
+ 14. Subarray beamforming
201
+
202
+ ## Package Structure
203
+
204
+ ```
205
+ phased_array/
206
+ ├── core.py # Vectorized AF, FFT, steering, element patterns
207
+ ├── geometry.py # Array geometries and subarray architectures
208
+ ├── beamforming.py # Tapering, null steering, multi-beam
209
+ ├── impairments.py # Coupling, quantization, failures, scan blindness
210
+ ├── visualization.py # 2D, 3D Plotly, UV-space plotting
211
+ └── utils.py # Coordinate transforms, helpers
212
+ ```
213
+
214
+ ## Requirements
215
+
216
+ - Python 3.8+
217
+ - NumPy >= 1.20.0
218
+ - Matplotlib >= 3.5.0
219
+ - SciPy >= 1.7.0
220
+ - Plotly >= 5.0.0 (optional, for 3D visualization)
221
+
222
+ ## Running Tests
223
+
224
+ ```bash
225
+ pytest tests/ -v
226
+ ```
227
+
228
+ ## Contributing
229
+
230
+ Contributions are welcome! Please feel free to submit a Pull Request.
231
+
232
+ 1. Fork the repository
233
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
234
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
235
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
236
+ 5. Open a Pull Request
237
+
238
+ ## License
239
+
240
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
241
+
242
+ ## Citation
243
+
244
+ If you use this library in your research, please cite:
245
+
246
+ ```bibtex
247
+ @software{phased_array,
248
+ author = {Hodge, John},
249
+ title = {Phased Array Antenna Modeling},
250
+ url = {https://github.com/jman4162/Phased-Array-Antenna-Model},
251
+ year = {2024}
252
+ }
253
+ ```
254
+
255
+ ## Contact
256
+
257
+ John Hodge - jah70@vt.edu
258
+
259
+ Project Link: [https://github.com/jman4162/Phased-Array-Antenna-Model](https://github.com/jman4162/Phased-Array-Antenna-Model)
@@ -0,0 +1,218 @@
1
+ # Phased Array Antenna Modeling
2
+
3
+ [![CI](https://github.com/jman4162/Phased-Array-Antenna-Model/actions/workflows/ci.yml/badge.svg)](https://github.com/jman4162/Phased-Array-Antenna-Model/actions/workflows/ci.yml)
4
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/jman4162/Phased-Array-Antenna-Model/blob/main/Phased_Array_Demo.ipynb)
7
+
8
+ A comprehensive Python library for computing and visualizing phased array antenna radiation patterns. Features **125x faster** vectorized computations, multiple array geometries, advanced beamforming, and interactive 3D visualization.
9
+
10
+ ## Features
11
+
12
+ - **High Performance**: Vectorized array factor computation (125x faster than naive loops)
13
+ - **Multiple Geometries**: Rectangular, triangular, circular, cylindrical, spherical, sparse/thinned arrays
14
+ - **Beamforming**: Amplitude tapering (Taylor, Chebyshev, etc.), null steering, multi-beam
15
+ - **Realistic Impairments**: Mutual coupling, phase quantization, element failures, scan blindness
16
+ - **Visualization**: 2D matplotlib, interactive 3D Plotly, UV-space representation
17
+ - **Subarray Support**: Subarray-level beamforming with quantized phase shifters
18
+
19
+ ## Installation
20
+
21
+ ### From GitHub (recommended)
22
+
23
+ ```bash
24
+ pip install git+https://github.com/jman4162/Phased-Array-Antenna-Model.git
25
+ ```
26
+
27
+ ### With optional dependencies
28
+
29
+ ```bash
30
+ # Include Plotly for 3D visualization
31
+ pip install "phased-array[plotting] @ git+https://github.com/jman4162/Phased-Array-Antenna-Model.git"
32
+
33
+ # Include all optional dependencies
34
+ pip install "phased-array[full] @ git+https://github.com/jman4162/Phased-Array-Antenna-Model.git"
35
+ ```
36
+
37
+ ### For development
38
+
39
+ ```bash
40
+ git clone https://github.com/jman4162/Phased-Array-Antenna-Model.git
41
+ cd Phased-Array-Antenna-Model
42
+ pip install -e ".[dev]"
43
+ ```
44
+
45
+ ## Quick Start
46
+
47
+ ```python
48
+ import phased_array as pa
49
+ import numpy as np
50
+
51
+ # Create a 16x16 rectangular array with half-wavelength spacing
52
+ geom = pa.create_rectangular_array(16, 16, dx=0.5, dy=0.5)
53
+
54
+ # Wavenumber for normalized wavelength
55
+ k = pa.wavelength_to_k(1.0)
56
+
57
+ # Steering weights for 30 degree scan with Taylor taper
58
+ weights = pa.steering_vector(k, geom.x, geom.y, theta0_deg=30, phi0_deg=0)
59
+ weights *= pa.taylor_taper_2d(16, 16, sidelobe_dB=-30)
60
+
61
+ # Compute full 2D pattern
62
+ theta, phi, pattern_dB = pa.compute_full_pattern(geom.x, geom.y, weights, k)
63
+
64
+ # Plot
65
+ pa.plot_pattern_contour(np.rad2deg(theta), np.rad2deg(phi), pattern_dB,
66
+ title="16x16 Array - 30deg Scan with Taylor Taper")
67
+ ```
68
+
69
+ ## Examples
70
+
71
+ ### Beam Steering
72
+
73
+ ```python
74
+ # Steer beam to theta=25 deg, phi=45 deg
75
+ weights = pa.steering_vector(k, geom.x, geom.y, theta0_deg=25, phi0_deg=45)
76
+
77
+ # Compute E-plane and H-plane cuts
78
+ angles, E_plane, H_plane = pa.compute_pattern_cuts(
79
+ geom.x, geom.y, weights, k,
80
+ theta0_deg=25, phi0_deg=45
81
+ )
82
+ ```
83
+
84
+ ### Null Steering
85
+
86
+ ```python
87
+ # Place nulls at specific directions to reject interference
88
+ null_directions = [(20, 0), (-20, 0)] # (theta, phi) in degrees
89
+
90
+ weights = pa.null_steering_projection(
91
+ geom, k,
92
+ theta_main_deg=0, phi_main_deg=0,
93
+ null_directions=null_directions
94
+ )
95
+ ```
96
+
97
+ ### Multiple Simultaneous Beams
98
+
99
+ ```python
100
+ # Create 3 simultaneous beams
101
+ beam_directions = [(0, 0), (25, 0), (25, 180)]
102
+
103
+ weights = pa.multi_beam_weights_superposition(
104
+ geom, k, beam_directions,
105
+ amplitudes=[1.0, 0.7, 0.7]
106
+ )
107
+ ```
108
+
109
+ ### Circular/Conformal Arrays
110
+
111
+ ```python
112
+ # Cylindrical array
113
+ geom_cyl = pa.create_cylindrical_array(
114
+ n_azimuth=16, n_vertical=8,
115
+ radius=2.0, height=4.0
116
+ )
117
+
118
+ # Compute pattern accounting for element orientations
119
+ AF = pa.array_factor_conformal(theta, phi, geom_cyl, weights, k)
120
+ ```
121
+
122
+ ### Phase Quantization Analysis
123
+
124
+ ```python
125
+ # Simulate 4-bit phase shifters
126
+ weights_quantized = pa.quantize_phase(weights, n_bits=4)
127
+
128
+ # Analyze effect on pattern
129
+ results = pa.analyze_quantization_effect(weights, geom, k, n_bits=4)
130
+ print(f"RMS phase error: {results['rms_error_deg']:.1f} degrees")
131
+ ```
132
+
133
+ ### 3D Interactive Visualization
134
+
135
+ ```python
136
+ # Create interactive 3D pattern plot
137
+ fig = pa.plot_pattern_3d_plotly(theta, phi, pattern_dB,
138
+ title="3D Radiation Pattern")
139
+ fig.show()
140
+ ```
141
+
142
+ ## Documentation
143
+
144
+ For comprehensive documentation, see the [demo notebook](Phased_Array_Demo.ipynb) which covers:
145
+
146
+ 1. Basic array factor computation
147
+ 2. Beam steering
148
+ 3. Performance benchmarking
149
+ 4. Amplitude tapering comparison
150
+ 5. Array geometries (rectangular, triangular, circular, etc.)
151
+ 6. Null steering
152
+ 7. Multiple simultaneous beams
153
+ 8. Phase quantization effects
154
+ 9. Element failure analysis
155
+ 10. UV-space visualization
156
+ 11. 3D Plotly visualization
157
+ 12. Conformal array patterns
158
+ 13. Mutual coupling effects
159
+ 14. Subarray beamforming
160
+
161
+ ## Package Structure
162
+
163
+ ```
164
+ phased_array/
165
+ ├── core.py # Vectorized AF, FFT, steering, element patterns
166
+ ├── geometry.py # Array geometries and subarray architectures
167
+ ├── beamforming.py # Tapering, null steering, multi-beam
168
+ ├── impairments.py # Coupling, quantization, failures, scan blindness
169
+ ├── visualization.py # 2D, 3D Plotly, UV-space plotting
170
+ └── utils.py # Coordinate transforms, helpers
171
+ ```
172
+
173
+ ## Requirements
174
+
175
+ - Python 3.8+
176
+ - NumPy >= 1.20.0
177
+ - Matplotlib >= 3.5.0
178
+ - SciPy >= 1.7.0
179
+ - Plotly >= 5.0.0 (optional, for 3D visualization)
180
+
181
+ ## Running Tests
182
+
183
+ ```bash
184
+ pytest tests/ -v
185
+ ```
186
+
187
+ ## Contributing
188
+
189
+ Contributions are welcome! Please feel free to submit a Pull Request.
190
+
191
+ 1. Fork the repository
192
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
193
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
194
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
195
+ 5. Open a Pull Request
196
+
197
+ ## License
198
+
199
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
200
+
201
+ ## Citation
202
+
203
+ If you use this library in your research, please cite:
204
+
205
+ ```bibtex
206
+ @software{phased_array,
207
+ author = {Hodge, John},
208
+ title = {Phased Array Antenna Modeling},
209
+ url = {https://github.com/jman4162/Phased-Array-Antenna-Model},
210
+ year = {2024}
211
+ }
212
+ ```
213
+
214
+ ## Contact
215
+
216
+ John Hodge - jah70@vt.edu
217
+
218
+ Project Link: [https://github.com/jman4162/Phased-Array-Antenna-Model](https://github.com/jman4162/Phased-Array-Antenna-Model)