@photivra/engine 0.5.1 → 0.6.0
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.
- package/CHANGELOG.md +32 -0
- package/CITATION.cff +1 -1
- package/README.md +37 -3
- package/dist/index.d.ts +15 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/motion/camera-rotation.d.ts +60 -0
- package/dist/motion/camera-rotation.d.ts.map +1 -1
- package/dist/motion/camera-rotation.js +95 -0
- package/dist/motion/camera-rotation.js.map +1 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts +100 -0
- package/dist/motion/capture-rotation-inverse-mapping.d.ts.map +1 -0
- package/dist/motion/capture-rotation-inverse-mapping.js +171 -0
- package/dist/motion/capture-rotation-inverse-mapping.js.map +1 -0
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts +89 -0
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts.map +1 -0
- package/dist/motion/capture-rotation-temporal-quadrature.js +116 -0
- package/dist/motion/capture-rotation-temporal-quadrature.js.map +1 -0
- package/dist/motion/capture-rotation-trajectory.d.ts +98 -0
- package/dist/motion/capture-rotation-trajectory.d.ts.map +1 -0
- package/dist/motion/capture-rotation-trajectory.js +153 -0
- package/dist/motion/capture-rotation-trajectory.js.map +1 -0
- package/dist/optics/lateral-chromatic-aberration.d.ts.map +1 -1
- package/dist/optics/lateral-chromatic-aberration.js +12 -4
- package/dist/optics/lateral-chromatic-aberration.js.map +1 -1
- package/dist/optics/radial-distortion.d.ts +4 -2
- package/dist/optics/radial-distortion.d.ts.map +1 -1
- package/dist/optics/radial-distortion.js +83 -23
- package/dist/optics/radial-distortion.js.map +1 -1
- package/dist/output/capture-geometry.d.ts.map +1 -1
- package/dist/output/capture-geometry.js +24 -11
- package/dist/output/capture-geometry.js.map +1 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts +211 -0
- package/dist/sensor/capture-color-sampling-binding.d.ts.map +1 -0
- package/dist/sensor/capture-color-sampling-binding.js +423 -0
- package/dist/sensor/capture-color-sampling-binding.js.map +1 -0
- package/dist/sensor/capture-mode.d.ts +157 -0
- package/dist/sensor/capture-mode.d.ts.map +1 -0
- package/dist/sensor/capture-mode.js +434 -0
- package/dist/sensor/capture-mode.js.map +1 -0
- package/dist/sensor/color-sampling.d.ts +133 -0
- package/dist/sensor/color-sampling.d.ts.map +1 -0
- package/dist/sensor/color-sampling.js +226 -0
- package/dist/sensor/color-sampling.js.map +1 -0
- package/dist/sensor/exposure-window.d.ts +103 -0
- package/dist/sensor/exposure-window.d.ts.map +1 -0
- package/dist/sensor/exposure-window.js +291 -0
- package/dist/sensor/exposure-window.js.map +1 -0
- package/dist/sensor/optical-stack.d.ts +132 -0
- package/dist/sensor/optical-stack.d.ts.map +1 -0
- package/dist/sensor/optical-stack.js +286 -0
- package/dist/sensor/optical-stack.js.map +1 -0
- package/dist/sensor/readout-exposure-linkage.d.ts +111 -0
- package/dist/sensor/readout-exposure-linkage.d.ts.map +1 -0
- package/dist/sensor/readout-exposure-linkage.js +210 -0
- package/dist/sensor/readout-exposure-linkage.js.map +1 -0
- package/dist/sensor/readout-timing.d.ts +124 -0
- package/dist/sensor/readout-timing.d.ts.map +1 -0
- package/dist/sensor/readout-timing.js +230 -0
- package/dist/sensor/readout-timing.js.map +1 -0
- package/dist/sensor/sampling-aperture.d.ts +154 -0
- package/dist/sensor/sampling-aperture.d.ts.map +1 -0
- package/dist/sensor/sampling-aperture.js +374 -0
- package/dist/sensor/sampling-aperture.js.map +1 -0
- package/dist/sensor/spatial-sample-reduction.d.ts +128 -0
- package/dist/sensor/spatial-sample-reduction.d.ts.map +1 -0
- package/dist/sensor/spatial-sample-reduction.js +299 -0
- package/dist/sensor/spatial-sample-reduction.js.map +1 -0
- package/dist/sensor/spatial-sampling-quadrature.d.ts +155 -0
- package/dist/sensor/spatial-sampling-quadrature.d.ts.map +1 -0
- package/dist/sensor/spatial-sampling-quadrature.js +197 -0
- package/dist/sensor/spatial-sampling-quadrature.js.map +1 -0
- package/docs/ARCHITECTURE.md +17 -0
- package/docs/AUTOMATION_COORDINATION.md +188 -0
- package/docs/IMAGE_FORMATION.md +26 -0
- package/docs/MOTION_AND_SIGNAL.md +142 -0
- package/docs/USAGE.md +1273 -3
- package/package.json +5 -3
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
3
|
+
import { parseEvidenceList } from "../core/evidence-provenance.js";
|
|
4
|
+
import { InvalidScientificInputError } from "../core/validation.js";
|
|
5
|
+
import { resolveNativeEffectiveRasterColorSamplingBinding } from "./capture-color-sampling-binding.js";
|
|
6
|
+
import { resolveColorSamplingSite } from "./color-sampling.js";
|
|
7
|
+
function requireRecord(value, path) {
|
|
8
|
+
if (typeof value !== "object" ||
|
|
9
|
+
value === null ||
|
|
10
|
+
Array.isArray(value)) {
|
|
11
|
+
throw new InvalidConfigurationError(path + " must be an object.");
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
function requireNonEmptyString(value, path) {
|
|
16
|
+
if (typeof value !== "string" ||
|
|
17
|
+
value.trim().length === 0) {
|
|
18
|
+
throw new InvalidConfigurationError(path + " must be a non-empty string.");
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function requirePositiveFinite(value, path) {
|
|
23
|
+
if (typeof value !== "number" ||
|
|
24
|
+
!Number.isFinite(value) ||
|
|
25
|
+
value <= 0) {
|
|
26
|
+
throw new InvalidConfigurationError(path +
|
|
27
|
+
" must be a finite number greater than zero.");
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function requireFinite(value, path) {
|
|
32
|
+
if (typeof value !== "number" ||
|
|
33
|
+
!Number.isFinite(value)) {
|
|
34
|
+
throw new InvalidConfigurationError(path + " must be a finite number.");
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function parseSiteCenterLattice(value, path) {
|
|
39
|
+
const record = requireRecord(value, path);
|
|
40
|
+
if (record.kind !==
|
|
41
|
+
"regular-rectangular-site-center-lattice") {
|
|
42
|
+
throw new InvalidConfigurationError(path + ".kind is invalid.");
|
|
43
|
+
}
|
|
44
|
+
if (record.coordinateSystem !==
|
|
45
|
+
"native-sensor-physical") {
|
|
46
|
+
throw new InvalidConfigurationError(path +
|
|
47
|
+
'.coordinateSystem must be "native-sensor-physical".');
|
|
48
|
+
}
|
|
49
|
+
const firstCenter = requireRecord(record.firstSiteCenterFromImagingAreaTopLeftMicrometers, path +
|
|
50
|
+
".firstSiteCenterFromImagingAreaTopLeftMicrometers");
|
|
51
|
+
const firstX = requireFinite(firstCenter.x, path +
|
|
52
|
+
".firstSiteCenterFromImagingAreaTopLeftMicrometers.x");
|
|
53
|
+
const firstY = requireFinite(firstCenter.y, path +
|
|
54
|
+
".firstSiteCenterFromImagingAreaTopLeftMicrometers.y");
|
|
55
|
+
if (firstX < 0 || firstY < 0) {
|
|
56
|
+
throw new InvalidConfigurationError(path +
|
|
57
|
+
".firstSiteCenterFromImagingAreaTopLeftMicrometers must not be negative.");
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
kind: "regular-rectangular-site-center-lattice",
|
|
61
|
+
coordinateSystem: "native-sensor-physical",
|
|
62
|
+
pitchXMicrometers: requirePositiveFinite(record.pitchXMicrometers, path + ".pitchXMicrometers"),
|
|
63
|
+
pitchYMicrometers: requirePositiveFinite(record.pitchYMicrometers, path + ".pitchYMicrometers"),
|
|
64
|
+
firstSiteCenterFromImagingAreaTopLeftMicrometers: {
|
|
65
|
+
x: firstX,
|
|
66
|
+
y: firstY
|
|
67
|
+
},
|
|
68
|
+
evidence: parseEvidenceList(record.evidence, path + ".evidence")
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function parseGeometricSensitiveAperture(value, path, lattice) {
|
|
72
|
+
const record = requireRecord(value, path);
|
|
73
|
+
if (record.kind === "unresolved") {
|
|
74
|
+
if (record.widthMicrometers !== undefined ||
|
|
75
|
+
record.heightMicrometers !== undefined ||
|
|
76
|
+
record.centerOffsetFromSiteCenterMicrometers !==
|
|
77
|
+
undefined) {
|
|
78
|
+
throw new InvalidConfigurationError(path +
|
|
79
|
+
" unresolved aperture must omit rectangle fields.");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
kind: "unresolved",
|
|
83
|
+
evidence: parseEvidenceList(record.evidence, path + ".evidence")
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (record.kind !==
|
|
87
|
+
"uniform-axis-aligned-rectangle") {
|
|
88
|
+
throw new InvalidConfigurationError(path + ".kind is invalid.");
|
|
89
|
+
}
|
|
90
|
+
const widthMicrometers = requirePositiveFinite(record.widthMicrometers, path + ".widthMicrometers");
|
|
91
|
+
const heightMicrometers = requirePositiveFinite(record.heightMicrometers, path + ".heightMicrometers");
|
|
92
|
+
const offset = requireRecord(record.centerOffsetFromSiteCenterMicrometers, path +
|
|
93
|
+
".centerOffsetFromSiteCenterMicrometers");
|
|
94
|
+
const offsetX = requireFinite(offset.x, path +
|
|
95
|
+
".centerOffsetFromSiteCenterMicrometers.x");
|
|
96
|
+
const offsetY = requireFinite(offset.y, path +
|
|
97
|
+
".centerOffsetFromSiteCenterMicrometers.y");
|
|
98
|
+
const halfCellX = lattice.pitchXMicrometers / 2;
|
|
99
|
+
const halfCellY = lattice.pitchYMicrometers / 2;
|
|
100
|
+
if (Math.abs(offsetX) +
|
|
101
|
+
widthMicrometers / 2 >
|
|
102
|
+
halfCellX ||
|
|
103
|
+
Math.abs(offsetY) +
|
|
104
|
+
heightMicrometers / 2 >
|
|
105
|
+
halfCellY) {
|
|
106
|
+
throw new InvalidConfigurationError(path +
|
|
107
|
+
" rectangle must remain within one regular site lattice cell.");
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
kind: "uniform-axis-aligned-rectangle",
|
|
111
|
+
widthMicrometers,
|
|
112
|
+
heightMicrometers,
|
|
113
|
+
centerOffsetFromSiteCenterMicrometers: {
|
|
114
|
+
x: offsetX,
|
|
115
|
+
y: offsetY
|
|
116
|
+
},
|
|
117
|
+
evidence: parseEvidenceList(record.evidence, path + ".evidence")
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Parses physical registration of the color-site lattice plus a first geometric
|
|
122
|
+
* photosensitive-aperture model.
|
|
123
|
+
*
|
|
124
|
+
* Site-center pitch/origin are explicit facts and are never derived from
|
|
125
|
+
* NativeImageRaster. The rectangle, when resolved, is a geometric sensitive
|
|
126
|
+
* region only. It does not include microlens redirection, charge diffusion,
|
|
127
|
+
* electrical crosstalk, QE, throughput, spectral response, or an effective
|
|
128
|
+
* radiometric collection area.
|
|
129
|
+
*/
|
|
130
|
+
export function parseSensorSamplingApertureProfile(value) {
|
|
131
|
+
const profile = requireRecord(value, "sensorSamplingAperture");
|
|
132
|
+
if (profile.schemaVersion !== "0.1.0") {
|
|
133
|
+
throw new InvalidConfigurationError('sensorSamplingAperture.schemaVersion must be "0.1.0".');
|
|
134
|
+
}
|
|
135
|
+
const siteCenterLattice = parseSiteCenterLattice(profile.siteCenterLattice, "sensorSamplingAperture.siteCenterLattice");
|
|
136
|
+
return {
|
|
137
|
+
schemaVersion: "0.1.0",
|
|
138
|
+
profileId: requireNonEmptyString(profile.profileId, "sensorSamplingAperture.profileId"),
|
|
139
|
+
colorSamplingProfileId: requireNonEmptyString(profile.colorSamplingProfileId, "sensorSamplingAperture.colorSamplingProfileId"),
|
|
140
|
+
colorSamplingBindingId: requireNonEmptyString(profile.colorSamplingBindingId, "sensorSamplingAperture.colorSamplingBindingId"),
|
|
141
|
+
evidence: parseEvidenceList(profile.evidence, "sensorSamplingAperture.evidence"),
|
|
142
|
+
siteCenterLattice,
|
|
143
|
+
geometricSensitiveAperture: parseGeometricSensitiveAperture(profile.geometricSensitiveAperture, "sensorSamplingAperture.geometricSensitiveAperture", siteCenterLattice)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function requireSiteIndex(value, path) {
|
|
147
|
+
if (typeof value !== "number" ||
|
|
148
|
+
!Number.isSafeInteger(value) ||
|
|
149
|
+
value < 0) {
|
|
150
|
+
throw new InvalidScientificInputError(path +
|
|
151
|
+
" must be a non-negative safe integer color-sampling-site index.");
|
|
152
|
+
}
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
function requirePositiveImagingArea(imagingArea) {
|
|
156
|
+
if (!Number.isFinite(imagingArea.widthMm) ||
|
|
157
|
+
imagingArea.widthMm <= 0 ||
|
|
158
|
+
!Number.isFinite(imagingArea.heightMm) ||
|
|
159
|
+
imagingArea.heightMm <= 0) {
|
|
160
|
+
throw new InvalidScientificInputError("imagingArea width/height must be finite and greater than zero.");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Resolves one geometric sampling aperture in native sensor physical space.
|
|
165
|
+
*
|
|
166
|
+
* The result provides a normalized uniform-area spatial averaging footprint for
|
|
167
|
+
* future image sampling, plus its geometric physical area/fill-fraction
|
|
168
|
+
* diagnostics. It deliberately does not promote that geometric area into
|
|
169
|
+
* radiometric collection efficiency or physical photodiode truth.
|
|
170
|
+
*/
|
|
171
|
+
export function resolveSensorSamplingAperture(input) {
|
|
172
|
+
requirePositiveImagingArea(input.imagingArea);
|
|
173
|
+
const profile = parseSensorSamplingApertureProfile(input.samplingApertureProfile);
|
|
174
|
+
const binding = resolveNativeEffectiveRasterColorSamplingBinding({
|
|
175
|
+
nativeRaster: input.nativeRaster,
|
|
176
|
+
colorSamplingProfile: input.colorSamplingProfile,
|
|
177
|
+
bindingProfile: input.colorSamplingBindingProfile
|
|
178
|
+
});
|
|
179
|
+
if (profile.colorSamplingProfileId !==
|
|
180
|
+
binding.colorSamplingProfileId) {
|
|
181
|
+
throw new InvalidScientificInputError("Sampling-aperture colorSamplingProfileId must match the resolved color-sampling profile.");
|
|
182
|
+
}
|
|
183
|
+
if (profile.colorSamplingBindingId !==
|
|
184
|
+
binding.bindingId) {
|
|
185
|
+
throw new InvalidScientificInputError("Sampling-aperture colorSamplingBindingId must match the resolved color-sampling binding.");
|
|
186
|
+
}
|
|
187
|
+
if (profile.geometricSensitiveAperture.kind ===
|
|
188
|
+
"unresolved") {
|
|
189
|
+
throw new InvalidScientificInputError("Geometric sensitive aperture is unresolved; a spatial sampling aperture cannot be produced.");
|
|
190
|
+
}
|
|
191
|
+
const siteX = requireSiteIndex(input.site.x, "site.x");
|
|
192
|
+
const siteY = requireSiteIndex(input.site.y, "site.y");
|
|
193
|
+
if (siteX >=
|
|
194
|
+
binding.colorSamplingSiteGrid.widthSites ||
|
|
195
|
+
siteY >=
|
|
196
|
+
binding.colorSamplingSiteGrid.heightSites) {
|
|
197
|
+
throw new InvalidScientificInputError("site must lie within the bound color-sampling site grid.");
|
|
198
|
+
}
|
|
199
|
+
const lattice = profile.siteCenterLattice;
|
|
200
|
+
const gridWidth = binding.colorSamplingSiteGrid.widthSites;
|
|
201
|
+
const gridHeight = binding.colorSamplingSiteGrid.heightSites;
|
|
202
|
+
const imagingWidthMicrometers = input.imagingArea.widthMm * 1000;
|
|
203
|
+
const imagingHeightMicrometers = input.imagingArea.heightMm * 1000;
|
|
204
|
+
const lastCenterX = lattice
|
|
205
|
+
.firstSiteCenterFromImagingAreaTopLeftMicrometers
|
|
206
|
+
.x +
|
|
207
|
+
(gridWidth - 1) *
|
|
208
|
+
lattice.pitchXMicrometers;
|
|
209
|
+
const lastCenterY = lattice
|
|
210
|
+
.firstSiteCenterFromImagingAreaTopLeftMicrometers
|
|
211
|
+
.y +
|
|
212
|
+
(gridHeight - 1) *
|
|
213
|
+
lattice.pitchYMicrometers;
|
|
214
|
+
if (lastCenterX > imagingWidthMicrometers ||
|
|
215
|
+
lastCenterY > imagingHeightMicrometers) {
|
|
216
|
+
throw new InvalidScientificInputError("Declared site-center lattice extends beyond the supplied physical imaging area.");
|
|
217
|
+
}
|
|
218
|
+
const aperture = profile.geometricSensitiveAperture;
|
|
219
|
+
const apertureOffsetX = aperture.centerOffsetFromSiteCenterMicrometers.x;
|
|
220
|
+
const apertureOffsetY = aperture.centerOffsetFromSiteCenterMicrometers.y;
|
|
221
|
+
const apertureHalfWidth = aperture.widthMicrometers / 2;
|
|
222
|
+
const apertureHalfHeight = aperture.heightMicrometers / 2;
|
|
223
|
+
const firstApertureLeft = lattice.firstSiteCenterFromImagingAreaTopLeftMicrometers.x +
|
|
224
|
+
apertureOffsetX -
|
|
225
|
+
apertureHalfWidth;
|
|
226
|
+
const firstApertureTop = lattice.firstSiteCenterFromImagingAreaTopLeftMicrometers.y +
|
|
227
|
+
apertureOffsetY -
|
|
228
|
+
apertureHalfHeight;
|
|
229
|
+
const lastApertureRight = lastCenterX +
|
|
230
|
+
apertureOffsetX +
|
|
231
|
+
apertureHalfWidth;
|
|
232
|
+
const lastApertureBottom = lastCenterY +
|
|
233
|
+
apertureOffsetY +
|
|
234
|
+
apertureHalfHeight;
|
|
235
|
+
if (firstApertureLeft < 0 ||
|
|
236
|
+
firstApertureTop < 0 ||
|
|
237
|
+
lastApertureRight > imagingWidthMicrometers ||
|
|
238
|
+
lastApertureBottom > imagingHeightMicrometers) {
|
|
239
|
+
throw new InvalidScientificInputError("Declared geometric sensitive aperture does not fit within the supplied physical imaging area across the complete site grid.");
|
|
240
|
+
}
|
|
241
|
+
const siteCenterFromTopLeftX = lattice
|
|
242
|
+
.firstSiteCenterFromImagingAreaTopLeftMicrometers
|
|
243
|
+
.x +
|
|
244
|
+
siteX * lattice.pitchXMicrometers;
|
|
245
|
+
const siteCenterFromTopLeftY = lattice
|
|
246
|
+
.firstSiteCenterFromImagingAreaTopLeftMicrometers
|
|
247
|
+
.y +
|
|
248
|
+
siteY * lattice.pitchYMicrometers;
|
|
249
|
+
const apertureCenterFromTopLeftX = siteCenterFromTopLeftX +
|
|
250
|
+
aperture
|
|
251
|
+
.centerOffsetFromSiteCenterMicrometers
|
|
252
|
+
.x;
|
|
253
|
+
const apertureCenterFromTopLeftY = siteCenterFromTopLeftY +
|
|
254
|
+
aperture
|
|
255
|
+
.centerOffsetFromSiteCenterMicrometers
|
|
256
|
+
.y;
|
|
257
|
+
const apertureLeftTopX = apertureCenterFromTopLeftX -
|
|
258
|
+
aperture.widthMicrometers / 2;
|
|
259
|
+
const apertureRightBottomX = apertureCenterFromTopLeftX +
|
|
260
|
+
aperture.widthMicrometers / 2;
|
|
261
|
+
const apertureLeftTopY = apertureCenterFromTopLeftY -
|
|
262
|
+
aperture.heightMicrometers / 2;
|
|
263
|
+
const apertureRightBottomY = apertureCenterFromTopLeftY +
|
|
264
|
+
aperture.heightMicrometers / 2;
|
|
265
|
+
if (apertureLeftTopX < 0 ||
|
|
266
|
+
apertureLeftTopY < 0 ||
|
|
267
|
+
apertureRightBottomX >
|
|
268
|
+
imagingWidthMicrometers ||
|
|
269
|
+
apertureRightBottomY >
|
|
270
|
+
imagingHeightMicrometers) {
|
|
271
|
+
throw new InvalidScientificInputError("Resolved geometric sensitive aperture extends beyond the supplied physical imaging area.");
|
|
272
|
+
}
|
|
273
|
+
const siteCenterFromOpticalAxisMm = {
|
|
274
|
+
x: -input.imagingArea.widthMm / 2 +
|
|
275
|
+
siteCenterFromTopLeftX / 1000,
|
|
276
|
+
y: -input.imagingArea.heightMm / 2 +
|
|
277
|
+
siteCenterFromTopLeftY / 1000
|
|
278
|
+
};
|
|
279
|
+
const apertureCenterFromOpticalAxisMm = {
|
|
280
|
+
x: -input.imagingArea.widthMm / 2 +
|
|
281
|
+
apertureCenterFromTopLeftX / 1000,
|
|
282
|
+
y: -input.imagingArea.heightMm / 2 +
|
|
283
|
+
apertureCenterFromTopLeftY / 1000
|
|
284
|
+
};
|
|
285
|
+
const boundsFromOpticalAxisMm = {
|
|
286
|
+
left: -input.imagingArea.widthMm / 2 +
|
|
287
|
+
apertureLeftTopX / 1000,
|
|
288
|
+
right: -input.imagingArea.widthMm / 2 +
|
|
289
|
+
apertureRightBottomX / 1000,
|
|
290
|
+
top: -input.imagingArea.heightMm / 2 +
|
|
291
|
+
apertureLeftTopY / 1000,
|
|
292
|
+
bottom: -input.imagingArea.heightMm / 2 +
|
|
293
|
+
apertureRightBottomY / 1000
|
|
294
|
+
};
|
|
295
|
+
const areaSquareMicrometers = aperture.widthMicrometers *
|
|
296
|
+
aperture.heightMicrometers;
|
|
297
|
+
const nominalCellAreaSquareMicrometers = lattice.pitchXMicrometers *
|
|
298
|
+
lattice.pitchYMicrometers;
|
|
299
|
+
const geometricSensitiveAreaFractionOfLatticeCell = areaSquareMicrometers /
|
|
300
|
+
nominalCellAreaSquareMicrometers;
|
|
301
|
+
if (!Number.isFinite(areaSquareMicrometers) ||
|
|
302
|
+
!Number.isFinite(nominalCellAreaSquareMicrometers) ||
|
|
303
|
+
!Number.isFinite(geometricSensitiveAreaFractionOfLatticeCell)) {
|
|
304
|
+
throw new InvalidScientificInputError("Derived sampling-aperture geometry must remain finite.");
|
|
305
|
+
}
|
|
306
|
+
const channel = resolveColorSamplingSite({
|
|
307
|
+
profile: input.colorSamplingProfile,
|
|
308
|
+
site: {
|
|
309
|
+
x: siteX,
|
|
310
|
+
y: siteY
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
return {
|
|
314
|
+
profileId: profile.profileId,
|
|
315
|
+
colorSamplingProfileId: profile.colorSamplingProfileId,
|
|
316
|
+
colorSamplingBindingId: profile.colorSamplingBindingId,
|
|
317
|
+
coordinateSystem: "native-sensor-physical",
|
|
318
|
+
site: {
|
|
319
|
+
x: siteX,
|
|
320
|
+
y: siteY
|
|
321
|
+
},
|
|
322
|
+
channelId: channel.mapping.channelId,
|
|
323
|
+
siteGrid: {
|
|
324
|
+
widthSites: gridWidth,
|
|
325
|
+
heightSites: gridHeight
|
|
326
|
+
},
|
|
327
|
+
lattice: {
|
|
328
|
+
pitchXMicrometers: lattice.pitchXMicrometers,
|
|
329
|
+
pitchYMicrometers: lattice.pitchYMicrometers,
|
|
330
|
+
firstSiteCenterFromImagingAreaTopLeftMicrometers: {
|
|
331
|
+
...lattice
|
|
332
|
+
.firstSiteCenterFromImagingAreaTopLeftMicrometers
|
|
333
|
+
},
|
|
334
|
+
siteCenterFromImagingAreaTopLeftMicrometers: {
|
|
335
|
+
x: siteCenterFromTopLeftX,
|
|
336
|
+
y: siteCenterFromTopLeftY
|
|
337
|
+
},
|
|
338
|
+
siteCenterFromOpticalAxisMm,
|
|
339
|
+
nominalCellAreaSquareMicrometers
|
|
340
|
+
},
|
|
341
|
+
geometricSensitiveAperture: {
|
|
342
|
+
kind: "uniform-axis-aligned-rectangle",
|
|
343
|
+
widthMicrometers: aperture.widthMicrometers,
|
|
344
|
+
heightMicrometers: aperture.heightMicrometers,
|
|
345
|
+
centerOffsetFromSiteCenterMicrometers: {
|
|
346
|
+
...aperture
|
|
347
|
+
.centerOffsetFromSiteCenterMicrometers
|
|
348
|
+
},
|
|
349
|
+
centerFromOpticalAxisMm: apertureCenterFromOpticalAxisMm,
|
|
350
|
+
boundsFromOpticalAxisMm,
|
|
351
|
+
areaSquareMicrometers,
|
|
352
|
+
geometricSensitiveAreaFractionOfLatticeCell,
|
|
353
|
+
spatialWeighting: "uniform-unit-area-average",
|
|
354
|
+
neighboringGeometricApertureOverlap: "none-by-model"
|
|
355
|
+
},
|
|
356
|
+
sitePitchDerivedFromNativeImageRaster: false,
|
|
357
|
+
apertureDerivedFromSitePitch: false,
|
|
358
|
+
antiAliasingResponseIncluded: false,
|
|
359
|
+
microlensSpatialRedistributionIncluded: false,
|
|
360
|
+
chargeDiffusionIncluded: false,
|
|
361
|
+
electricalCrosstalkIncluded: false,
|
|
362
|
+
spectralResponseIncluded: false,
|
|
363
|
+
quantumEfficiencyIncluded: false,
|
|
364
|
+
opticalThroughputIncluded: false,
|
|
365
|
+
radiometricCollectionAreaEstablished: false,
|
|
366
|
+
physicalPhotodiodeGeometryEstablished: false,
|
|
367
|
+
provenance: {
|
|
368
|
+
profile: profile.evidence,
|
|
369
|
+
lattice: lattice.evidence,
|
|
370
|
+
aperture: aperture.evidence
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=sampling-aperture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampling-aperture.js","sourceRoot":"","sources":["../../src/sensor/sampling-aperture.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,gDAAgD,EAEjD,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,wBAAwB,EAGzB,MAAM,qBAAqB,CAAC;AAoJ7B,SAAS,aAAa,CACpB,KAAc,EACd,IAAY;IAEZ,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;QACD,MAAM,IAAI,yBAAyB,CACjC,IAAI,GAAG,qBAAqB,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED,SAAS,qBAAqB,CAC5B,KAAc,EACd,IAAY;IAEZ,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACzB,CAAC;QACD,MAAM,IAAI,yBAAyB,CACjC,IAAI,GAAG,8BAA8B,CACtC,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,qBAAqB,CAC5B,KAAc,EACd,IAAY;IAEZ,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CA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EAAE,QAAQ,CAAC,QAAQ;SAC5B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type CalculationResult } from "../core/calculation-result.js";
|
|
2
|
+
import type { SensorSpatialSamplingQuadrature } from "./spatial-sampling-quadrature.js";
|
|
3
|
+
export type SensorSpatialSampleValueDomain = {
|
|
4
|
+
kind: "relative-linear";
|
|
5
|
+
unit: "relative";
|
|
6
|
+
semantic: "nonnegative-sensor-plane-irradiance-proxy";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "radiometric-irradiance";
|
|
9
|
+
unit: "W/m^2";
|
|
10
|
+
semantic: "sensor-plane-irradiance";
|
|
11
|
+
};
|
|
12
|
+
export interface SensorSpatialQuadratureNodeIdentity {
|
|
13
|
+
antiAliasingComponentIndex: number;
|
|
14
|
+
apertureSampleXIndex: number;
|
|
15
|
+
apertureSampleYIndex: number;
|
|
16
|
+
}
|
|
17
|
+
export interface SensorSpatialQuadratureNodeValue {
|
|
18
|
+
node: SensorSpatialQuadratureNodeIdentity;
|
|
19
|
+
/**
|
|
20
|
+
* Nonnegative finite scalar in the declared value domain.
|
|
21
|
+
*
|
|
22
|
+
* Values are evaluated at the corresponding quadrature node's
|
|
23
|
+
* preAntiAliasingSourcePointMm.
|
|
24
|
+
*/
|
|
25
|
+
value: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ReduceSensorSpatialSamplingQuadratureInput {
|
|
28
|
+
quadrature: SensorSpatialSamplingQuadrature;
|
|
29
|
+
valueDomain: SensorSpatialSampleValueDomain;
|
|
30
|
+
/**
|
|
31
|
+
* Exactly one explicitly identified value per quadrature node.
|
|
32
|
+
*
|
|
33
|
+
* Ordering is not significant; node identity is.
|
|
34
|
+
*/
|
|
35
|
+
nodeValues: readonly SensorSpatialQuadratureNodeValue[];
|
|
36
|
+
}
|
|
37
|
+
export type SensorSpatialSampleReductionValue = {
|
|
38
|
+
kind: "relative-linear";
|
|
39
|
+
unit: "relative";
|
|
40
|
+
semantic: "nonnegative-sensor-plane-irradiance-proxy";
|
|
41
|
+
/**
|
|
42
|
+
* Dimensionless weighted spatial average in the same relative domain.
|
|
43
|
+
*/
|
|
44
|
+
normalizedSpatialAverageRelative: number;
|
|
45
|
+
/**
|
|
46
|
+
* Relative value × square micrometres.
|
|
47
|
+
*
|
|
48
|
+
* This is a geometric area-weighted diagnostic, not radiometric power.
|
|
49
|
+
*/
|
|
50
|
+
geometricAreaIntegralRelativeSquareMicrometers: number;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "radiometric-irradiance";
|
|
53
|
+
unit: "W/m^2";
|
|
54
|
+
semantic: "sensor-plane-irradiance";
|
|
55
|
+
/**
|
|
56
|
+
* Weighted mean irradiance over the geometric aperture after applying
|
|
57
|
+
* the declared normalized AA spatial redistribution.
|
|
58
|
+
*/
|
|
59
|
+
normalizedSpatialAverageIrradianceWattsPerSquareMeter: number;
|
|
60
|
+
/**
|
|
61
|
+
* Incident radiant flux represented by integrating the supplied
|
|
62
|
+
* irradiance over the geometric aperture under the declared normalized
|
|
63
|
+
* AA redistribution. Units: watts.
|
|
64
|
+
*
|
|
65
|
+
* This remains pre-CFA-response, pre-QE, pre-microlens-response and
|
|
66
|
+
* excludes any optical-stack throughput not already present in the
|
|
67
|
+
* caller-supplied irradiance values.
|
|
68
|
+
*/
|
|
69
|
+
geometricApertureIncidentFluxWatts: number;
|
|
70
|
+
};
|
|
71
|
+
export interface SensorSpatialSampleReduction {
|
|
72
|
+
site: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Semantic destination CFA/color-site label only.
|
|
78
|
+
*
|
|
79
|
+
* No spectral filter response is applied by this reducer.
|
|
80
|
+
*/
|
|
81
|
+
channelId: string;
|
|
82
|
+
outputMeaning: "channel-tagged-pre-response-spatial-sample";
|
|
83
|
+
valueDomain: SensorSpatialSampleValueDomain;
|
|
84
|
+
nodeCount: number;
|
|
85
|
+
sourceValuesMatchedBy: "quadrature-node-identity";
|
|
86
|
+
sourceValuesSuppliedForAllNodes: true;
|
|
87
|
+
outsideImagingAreaSourceValuesRequired: boolean;
|
|
88
|
+
normalizedSpatialWeightSum: number;
|
|
89
|
+
geometricApertureAreaSquareMicrometers: number;
|
|
90
|
+
reducedValue: SensorSpatialSampleReductionValue;
|
|
91
|
+
cfaSpectralFilteringApplied: false;
|
|
92
|
+
channelIdIsSpectralResponse: false;
|
|
93
|
+
temporalIntegrationApplied: false;
|
|
94
|
+
exposureDurationApplied: false;
|
|
95
|
+
quantumEfficiencyApplied: false;
|
|
96
|
+
microlensResponseApplied: false;
|
|
97
|
+
opticalThroughputAppliedByReducer: false;
|
|
98
|
+
photonsCalculated: false;
|
|
99
|
+
electronsCalculated: false;
|
|
100
|
+
shotNoiseApplied: false;
|
|
101
|
+
readNoiseApplied: false;
|
|
102
|
+
adcQuantizationApplied: false;
|
|
103
|
+
blackLevelApplied: false;
|
|
104
|
+
saturationApplied: false;
|
|
105
|
+
rawCodeValueProduced: false;
|
|
106
|
+
demosaicOrReconstructionApplied: false;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Reduces explicitly identified nonnegative linear scalar values over a
|
|
110
|
+
* validated sensor spatial quadrature.
|
|
111
|
+
*
|
|
112
|
+
* This function does not sample a renderer or optical model itself. Callers
|
|
113
|
+
* evaluate one value at every quadrature node's preAntiAliasingSourcePointMm
|
|
114
|
+
* and provide those values with exact node identity. Ordering is deliberately
|
|
115
|
+
* irrelevant.
|
|
116
|
+
*
|
|
117
|
+
* Two domains are supported:
|
|
118
|
+
*
|
|
119
|
+
* - relative-linear: dimensionless nonnegative irradiance-like proxy for
|
|
120
|
+
* deterministic renderer/science regression;
|
|
121
|
+
* - radiometric-irradiance: physical sensor-plane irradiance in W/m^2.
|
|
122
|
+
*
|
|
123
|
+
* The destination site's channelId is metadata only. No CFA spectral
|
|
124
|
+
* transmittance/sensitivity is applied, so the output must not be called a
|
|
125
|
+
* physically color-filtered mosaic sample or RAW value.
|
|
126
|
+
*/
|
|
127
|
+
export declare function reduceSensorSpatialSamplingQuadrature(input: ReduceSensorSpatialSamplingQuadratureInput): CalculationResult<SensorSpatialSampleReduction>;
|
|
128
|
+
//# sourceMappingURL=spatial-sample-reduction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-sample-reduction.d.ts","sourceRoot":"","sources":["../../src/sensor/spatial-sample-reduction.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EACV,+BAA+B,EAEhC,MAAM,kCAAkC,CAAC;AAM1C,MAAM,MAAM,8BAA8B,GACtC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACN,2CAA2C,CAAC;CAC/C,GACD;IACE,IAAI,EAAE,wBAAwB,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAEN,MAAM,WAAW,mCAAmC;IAClD,0BAA0B,EAAE,MAAM,CAAC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,mCAAmC,CAAC;IAC1C;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,+BAA+B,CAAC;IAC5C,WAAW,EAAE,8BAA8B,CAAC;IAC5C;;;;OAIG;IACH,UAAU,EAAE,SAAS,gCAAgC,EAAE,CAAC;CACzD;AAED,MAAM,MAAM,iCAAiC,GACzC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACN,2CAA2C,CAAC;IAC9C;;OAEG;IACH,gCAAgC,EA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