witwin-radar 0.3.0__py3-none-win_amd64.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.
- witwin/radar/__init__.py +11 -0
- witwin/radar/capabilities.py +214 -0
- witwin/radar/channel.py +761 -0
- witwin/radar/cuda/__init__.py +33 -0
- witwin/radar/cuda/extension.cpp +379 -0
- witwin/radar/cuda/fmcw_beat.cu +690 -0
- witwin/radar/cuda/fmcw_spectrum.cu +708 -0
- witwin/radar/cuda/frontend.cu +941 -0
- witwin/radar/cuda/ofdm_cfr.cu +745 -0
- witwin/radar/cuda/prebuilt/_radar_native.build-fingerprint +1 -0
- witwin/radar/cuda/prebuilt/_radar_native.build-info.json +60 -0
- witwin/radar/cuda/prebuilt/_radar_native.pyd +0 -0
- witwin/radar/cuda/pulsed_echo.cu +781 -0
- witwin/radar/cuda/runtime.py +924 -0
- witwin/radar/cuda/scatter_response.cu +704 -0
- witwin/radar/cuda/sensor_weight.cu +1281 -0
- witwin/radar/cuda/two_way_join.cu +638 -0
- witwin/radar/deployment.py +190 -0
- witwin/radar/frontend.py +841 -0
- witwin/radar/paths.py +1440 -0
- witwin/radar/policy.py +194 -0
- witwin/radar/processing/__init__.py +72 -0
- witwin/radar/processing/angle.py +882 -0
- witwin/radar/processing/detection.py +651 -0
- witwin/radar/processing/range_doppler.py +591 -0
- witwin/radar/processing/signal.py +678 -0
- witwin/radar/processing/tracking.py +287 -0
- witwin/radar/propagation.py +1374 -0
- witwin/radar/radar.py +1285 -0
- witwin/radar/scattering.py +682 -0
- witwin/radar/sensors.py +1087 -0
- witwin/radar/simulation.py +874 -0
- witwin/radar/smpl.py +491 -0
- witwin/radar/synthesis/__init__.py +27 -0
- witwin/radar/synthesis/assembly.py +1772 -0
- witwin/radar/synthesis/fmcw.py +314 -0
- witwin/radar/synthesis/ofdm.py +287 -0
- witwin/radar/synthesis/pulsed.py +263 -0
- witwin_radar-0.3.0.dist-info/METADATA +129 -0
- witwin_radar-0.3.0.dist-info/RECORD +42 -0
- witwin_radar-0.3.0.dist-info/WHEEL +4 -0
- witwin_radar-0.3.0.dist-info/licenses/LICENSE +13 -0
witwin/radar/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Public Radar system API.
|
|
2
|
+
|
|
3
|
+
The package root owns only the configured radar system and its configuration.
|
|
4
|
+
Scene binding, simulation results, propagation records, processing products,
|
|
5
|
+
deployment reporting, geometry and waveform APIs are imported from their
|
|
6
|
+
concept-owner modules.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from .radar import Radar, RadarConfig
|
|
10
|
+
|
|
11
|
+
__all__ = ["Radar", "RadarConfig"]
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"""What ``witwin.radar`` can do, as a versioned record.
|
|
2
|
+
|
|
3
|
+
Channel has had a capability manifest since Plan 07 and Radar has been reading
|
|
4
|
+
it (``channel.py``) without publishing one of its own.
|
|
5
|
+
That asymmetry is Phase-10 work item 3: a consumer that cannot describe itself
|
|
6
|
+
cannot be validated by its own consumers either.
|
|
7
|
+
|
|
8
|
+
Three rules this record obeys, each of which is the reason for a design choice
|
|
9
|
+
that would otherwise look arbitrary:
|
|
10
|
+
|
|
11
|
+
**It never triggers a Channel import.** ``propagation_consumer`` is embedded
|
|
12
|
+
only when ``witwin.channel.propagation.consumer`` is ALREADY in
|
|
13
|
+
``sys.modules``. Acceptance criterion A2 is the measured property that
|
|
14
|
+
importing ``witwin.radar`` loads zero ``witwin.channel`` modules; a capability
|
|
15
|
+
call that imported Channel to describe it would destroy exactly that property,
|
|
16
|
+
and would do it from the one function most likely to be called by a diagnostic
|
|
17
|
+
script.
|
|
18
|
+
|
|
19
|
+
**It restates nothing it does not own.** Where the Channel consumer contract is
|
|
20
|
+
present, its record is embedded verbatim rather than paraphrased. Where it is
|
|
21
|
+
absent, the field says so instead of falling back to a stale copy.
|
|
22
|
+
|
|
23
|
+
**The AD block is a summary of ``docs/dev/radar-ad-capability-matrix.md``, not
|
|
24
|
+
a second source.** The matrix is the authority, it is machine-parsed by
|
|
25
|
+
``tests/test_phase9_capability_matrix.py``, and it is a document rather than a
|
|
26
|
+
wheel member - so this record carries the summary a runtime caller needs and
|
|
27
|
+
``tests/test_phase10_diagnostics.py`` pins the summary against the matrix. Two
|
|
28
|
+
places, one direction of truth, and a test in between.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
import sys
|
|
34
|
+
from copy import deepcopy
|
|
35
|
+
from typing import Any
|
|
36
|
+
|
|
37
|
+
CONSUMER_MODULE = "witwin.channel.propagation.consumer"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
_CAPABILITIES: dict[str, Any] = {
|
|
41
|
+
"schema_version": 1,
|
|
42
|
+
"native_library": {
|
|
43
|
+
"logical_owner": "_radar_native",
|
|
44
|
+
"operator_families": [
|
|
45
|
+
"fmcw_beat_synthesis",
|
|
46
|
+
"fmcw_spectrum_synthesis",
|
|
47
|
+
"ofdm_cfr_synthesis",
|
|
48
|
+
"pulsed_echo_synthesis",
|
|
49
|
+
"two_way_join",
|
|
50
|
+
"scatter_response_aspect",
|
|
51
|
+
"sensor_weight",
|
|
52
|
+
"frontend_chain",
|
|
53
|
+
],
|
|
54
|
+
"numerical_owner": "radar",
|
|
55
|
+
"registry": "ci/native-binding-manifest.json",
|
|
56
|
+
},
|
|
57
|
+
"waveforms": {
|
|
58
|
+
"fmcw_beat": {
|
|
59
|
+
"axes": "chirp x segment x sample",
|
|
60
|
+
"supports_tdm": True,
|
|
61
|
+
"supports_wideband_band": True,
|
|
62
|
+
"phasor": "conjugated_beat_domain",
|
|
63
|
+
},
|
|
64
|
+
"ofdm_cfr": {
|
|
65
|
+
"axes": "symbol x segment x subcarrier",
|
|
66
|
+
"supports_tdm": False,
|
|
67
|
+
"supports_wideband_band": True,
|
|
68
|
+
"phasor": "channel_domain",
|
|
69
|
+
},
|
|
70
|
+
"pulsed_echo": {
|
|
71
|
+
"axes": "pulse x segment x sample",
|
|
72
|
+
"supports_tdm": False,
|
|
73
|
+
"supports_wideband_band": False,
|
|
74
|
+
"phasor": "channel_domain",
|
|
75
|
+
"pulse_kinds": ["rect", "lfm"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
# The propagation request Radar actually makes. Narrower than what the
|
|
79
|
+
# Channel consumer offers, and narrower on purpose: every component Radar
|
|
80
|
+
# asks for must be freezable, because the per-frame route is a frozen
|
|
81
|
+
# topology replay rather than a rediscovery.
|
|
82
|
+
"propagation_request": {
|
|
83
|
+
"response": "scalar_transport",
|
|
84
|
+
"components": ["los", "reflection"],
|
|
85
|
+
"topology_mode": "fixed_topology",
|
|
86
|
+
"refused_components": ["diffraction", "transmission", "scattering"],
|
|
87
|
+
"refusal_site": "witwin/radar/channel.py",
|
|
88
|
+
},
|
|
89
|
+
# A summary of docs/dev/radar-ad-capability-matrix.md. The four states are
|
|
90
|
+
# that document's closed vocabulary; SILENT is not one of them and never
|
|
91
|
+
# becomes one.
|
|
92
|
+
"ad_contract": {
|
|
93
|
+
"states": ["SUP", "ZERO", "REF", "DECL"],
|
|
94
|
+
"modes": ["none", "jvp", "vjp"],
|
|
95
|
+
"first_order_only": True,
|
|
96
|
+
"higher_order_owner": "witwin/radar/policy.py",
|
|
97
|
+
"production_finite_differences": False,
|
|
98
|
+
"supported_leaves": [
|
|
99
|
+
"mesh_vertices",
|
|
100
|
+
"material_eps_r",
|
|
101
|
+
"material_sigma_e",
|
|
102
|
+
"site_positions",
|
|
103
|
+
"transmitter_positions",
|
|
104
|
+
"receiver_positions",
|
|
105
|
+
"response_sigma_m2",
|
|
106
|
+
"response_phase_rad",
|
|
107
|
+
],
|
|
108
|
+
"refused_leaves": [
|
|
109
|
+
"endpoint_powers_w",
|
|
110
|
+
"endpoint_polarizations",
|
|
111
|
+
"velocities_m_per_s",
|
|
112
|
+
"smpl_pose",
|
|
113
|
+
"smpl_shape",
|
|
114
|
+
"waveform_spec_scalars",
|
|
115
|
+
"frontend_spec_scalars",
|
|
116
|
+
"sensor_pattern_tables",
|
|
117
|
+
"sensor_frozen_geometry",
|
|
118
|
+
],
|
|
119
|
+
"velocity_role": "forward_tangent_direction_never_a_leaf",
|
|
120
|
+
"matrix_document": "docs/dev/radar-ad-capability-matrix.md",
|
|
121
|
+
},
|
|
122
|
+
# R-ADR-018's wall. Above it the chain is smooth and stays live; below the
|
|
123
|
+
# first discrete decision every stage refuses at its entry, before any
|
|
124
|
+
# device work and before any result object exists.
|
|
125
|
+
"processing_wall": {
|
|
126
|
+
"owner": "witwin/radar/policy.py",
|
|
127
|
+
"differentiable_stages": [
|
|
128
|
+
"range_profile",
|
|
129
|
+
"range_doppler_map",
|
|
130
|
+
"beam_cube",
|
|
131
|
+
"matched_filter",
|
|
132
|
+
"tdm_compensate",
|
|
133
|
+
"music_spectrum",
|
|
134
|
+
"music_image",
|
|
135
|
+
],
|
|
136
|
+
"refusing_stages": [
|
|
137
|
+
"adc_quantize",
|
|
138
|
+
"ca_cfar",
|
|
139
|
+
"ca_cfar_fast",
|
|
140
|
+
"os_cfar",
|
|
141
|
+
"ca_cfar_1d",
|
|
142
|
+
"point_cloud",
|
|
143
|
+
"peak_selection",
|
|
144
|
+
"phase_comparison_aoa",
|
|
145
|
+
"fft2_aoa",
|
|
146
|
+
"tracking_handoff",
|
|
147
|
+
],
|
|
148
|
+
"refuses_before_any_compute": True,
|
|
149
|
+
},
|
|
150
|
+
"host_observations": {
|
|
151
|
+
"per_frame_owner": "none",
|
|
152
|
+
"per_frame_budget": 2,
|
|
153
|
+
"freeze_time_owner": "witwin/radar/paths.py",
|
|
154
|
+
"contract": "docs/dev/standards/radar-adr-006-compact-contract-and-cardinality-budget.md",
|
|
155
|
+
},
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _deployment_record() -> dict[str, Any]:
|
|
160
|
+
from .deployment import DECLARED_SM_ARCHITECTURES, PTX_FORWARD_COMPATIBILITY_SM, VERIFIED_SM_ARCHITECTURES
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
"declared_sm_architectures": list(DECLARED_SM_ARCHITECTURES),
|
|
164
|
+
"verified_sm_architectures": list(VERIFIED_SM_ARCHITECTURES),
|
|
165
|
+
"ptx_forward_compatibility_sm": PTX_FORWARD_COMPATIBILITY_SM,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _propagation_consumer_record() -> dict[str, Any]:
|
|
170
|
+
"""Channel's consumer contract, but only if it is already loaded.
|
|
171
|
+
|
|
172
|
+
``sys.modules`` rather than ``importlib.util.find_spec``: find_spec answers
|
|
173
|
+
"could this be imported", which is true in every install that has Channel,
|
|
174
|
+
and answering it would still require importing the module to read the
|
|
175
|
+
record. The question this function asks is "is Channel already part of this
|
|
176
|
+
process", and only ``sys.modules`` answers that.
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
module = sys.modules.get(CONSUMER_MODULE)
|
|
180
|
+
if module is None:
|
|
181
|
+
return {
|
|
182
|
+
"status": "not_loaded",
|
|
183
|
+
"note": (
|
|
184
|
+
"witwin.channel is an optional dependency and reading this "
|
|
185
|
+
"record must never load it; import "
|
|
186
|
+
f"{CONSUMER_MODULE} first if the contract is wanted here"
|
|
187
|
+
),
|
|
188
|
+
}
|
|
189
|
+
record = module.capabilities()
|
|
190
|
+
return {
|
|
191
|
+
"status": "loaded",
|
|
192
|
+
"contract_version": record.contract_version,
|
|
193
|
+
"components": sorted(record.components),
|
|
194
|
+
"responses": sorted(record.responses),
|
|
195
|
+
"topology_modes": sorted(record.topology_modes),
|
|
196
|
+
"ad_modes": sorted(record.ad_modes),
|
|
197
|
+
"fixed_topology_components": sorted(record.fixed_topology_components),
|
|
198
|
+
"supports_fixed_topology": record.supports_fixed_topology,
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def capabilities() -> dict[str, Any]:
|
|
203
|
+
"""Return the versioned Radar capability manifest."""
|
|
204
|
+
|
|
205
|
+
from .cuda.runtime import RADAR_ABI_VERSION
|
|
206
|
+
|
|
207
|
+
manifest = deepcopy(_CAPABILITIES)
|
|
208
|
+
manifest["radar_abi_version"] = RADAR_ABI_VERSION
|
|
209
|
+
manifest["deployment"] = _deployment_record()
|
|
210
|
+
manifest["propagation_consumer"] = _propagation_consumer_record()
|
|
211
|
+
return manifest
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
__all__ = ["capabilities"]
|