@photivra/engine 1.5.0 → 2.0.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 +393 -6
- package/CITATION.cff +1 -1
- package/NODE_SUPPORT.md +64 -12
- package/README.md +301 -182
- package/SECURITY.md +37 -28
- package/THIRD_PARTY.md +148 -4
- package/dist/camera/equivalent-focal-length.d.ts +13 -14
- package/dist/camera/equivalent-focal-length.js +15 -13
- package/dist/camera/equivalent-focal-length.js.map +1 -1
- package/dist/camera/field-of-view.d.ts +30 -19
- package/dist/camera/field-of-view.js +67 -18
- package/dist/camera/field-of-view.js.map +1 -1
- package/dist/camera/lens-projection.d.ts +170 -0
- package/dist/camera/lens-projection.js +444 -0
- package/dist/camera/lens-projection.js.map +1 -0
- package/dist/camera/projected-object-size.d.ts +10 -11
- package/dist/camera/projected-object-size.js +12 -10
- package/dist/camera/projected-object-size.js.map +1 -1
- package/dist/capture/capture-export-metadata.d.ts +9 -10
- package/dist/capture/capture-export-metadata.js +8 -5
- package/dist/capture/capture-export-metadata.js.map +1 -1
- package/dist/capture/dng-import.d.ts +91 -0
- package/dist/capture/dng-import.js +343 -0
- package/dist/capture/dng-import.js.map +1 -0
- package/dist/capture/environment-raw-producer.d.ts +37 -17
- package/dist/capture/environment-raw-producer.js +43 -19
- package/dist/capture/environment-raw-producer.js.map +1 -1
- package/dist/capture/export-jpeg.d.ts +35 -4
- package/dist/capture/export-jpeg.js +133 -47
- package/dist/capture/export-jpeg.js.map +1 -1
- package/dist/capture/export-tiff.d.ts +48 -24
- package/dist/capture/export-tiff.js +91 -31
- package/dist/capture/export-tiff.js.map +1 -1
- package/dist/capture/focus-control.d.ts +42 -65
- package/dist/capture/focus-control.js +56 -75
- package/dist/capture/focus-control.js.map +1 -1
- package/dist/capture/host-yield-cadence.d.ts +25 -0
- package/dist/capture/host-yield-cadence.js +25 -0
- package/dist/capture/host-yield-cadence.js.map +1 -0
- package/dist/capture/linear-encoding.d.ts +14 -12
- package/dist/capture/linear-encoding.js +14 -13
- package/dist/capture/linear-encoding.js.map +1 -1
- package/dist/capture/lossless-jpeg.d.ts +27 -0
- package/dist/capture/lossless-jpeg.js +237 -0
- package/dist/capture/lossless-jpeg.js.map +1 -0
- package/dist/capture/native-environment-lean.d.ts +227 -0
- package/dist/capture/native-environment-lean.js +974 -0
- package/dist/capture/native-environment-lean.js.map +1 -0
- package/dist/capture/native-environment-optical-stage.d.ts +97 -0
- package/dist/capture/native-environment-optical-stage.js +340 -0
- package/dist/capture/native-environment-optical-stage.js.map +1 -0
- package/dist/capture/native-environment-raw.d.ts +140 -6
- package/dist/capture/native-environment-raw.js +435 -34
- package/dist/capture/native-environment-raw.js.map +1 -1
- package/dist/capture/native-raw-development.d.ts +116 -9
- package/dist/capture/native-raw-development.js +221 -62
- package/dist/capture/native-raw-development.js.map +1 -1
- package/dist/capture/native-raw-dng.d.ts +60 -0
- package/dist/capture/native-raw-dng.js +167 -0
- package/dist/capture/native-raw-dng.js.map +1 -0
- package/dist/capture/native-raw.d.ts +65 -12
- package/dist/capture/native-raw.js +81 -19
- package/dist/capture/native-raw.js.map +1 -1
- package/dist/capture/packed-sensor-raw.d.ts +160 -0
- package/dist/capture/packed-sensor-raw.js +221 -0
- package/dist/capture/packed-sensor-raw.js.map +1 -0
- package/dist/capture/photographic-export.d.ts +58 -35
- package/dist/capture/photographic-export.js +177 -70
- package/dist/capture/photographic-export.js.map +1 -1
- package/dist/capture/raw-development-kernel.d.ts +52 -0
- package/dist/capture/raw-development-kernel.js +88 -0
- package/dist/capture/raw-development-kernel.js.map +1 -0
- package/dist/capture/raw-frame-limits.d.ts +7 -7
- package/dist/capture/raw-frame-limits.js +7 -6
- package/dist/capture/raw-frame-limits.js.map +1 -1
- package/dist/capture/raw-frame-reconstruction.d.ts +8 -9
- package/dist/capture/raw-frame-reconstruction.js +9 -8
- package/dist/capture/raw-frame-reconstruction.js.map +1 -1
- package/dist/capture/raw-white-level.d.ts +55 -0
- package/dist/capture/raw-white-level.js +165 -0
- package/dist/capture/raw-white-level.js.map +1 -0
- package/dist/capture/release-sequence.d.ts +5 -7
- package/dist/capture/release-sequence.js +15 -13
- package/dist/capture/release-sequence.js.map +1 -1
- package/dist/capture/sensor-raw-frame.d.ts +5 -6
- package/dist/capture/sensor-raw-frame.js +26 -9
- package/dist/capture/sensor-raw-frame.js.map +1 -1
- package/dist/capture/sensor-raw-producer.d.ts +21 -13
- package/dist/capture/sensor-raw-producer.js +86 -25
- package/dist/capture/sensor-raw-producer.js.map +1 -1
- package/dist/capture/simulated-capture.d.ts +15 -16
- package/dist/capture/simulated-capture.js +22 -12
- package/dist/capture/simulated-capture.js.map +1 -1
- package/dist/color/camera-color-matrix.d.ts +69 -0
- package/dist/color/camera-color-matrix.js +132 -0
- package/dist/color/camera-color-matrix.js.map +1 -0
- package/dist/color/capture-color.d.ts +17 -10
- package/dist/color/capture-color.js +50 -17
- package/dist/color/capture-color.js.map +1 -1
- package/dist/color/chromatic-adaptation.d.ts +63 -0
- package/dist/color/chromatic-adaptation.js +91 -0
- package/dist/color/chromatic-adaptation.js.map +1 -0
- package/dist/color/color-difference.d.ts +104 -0
- package/dist/color/color-difference.js +205 -0
- package/dist/color/color-difference.js.map +1 -0
- package/dist/color/color-matching-functions.d.ts +168 -0
- package/dist/color/color-matching-functions.js +309 -0
- package/dist/color/color-matching-functions.js.map +1 -0
- package/dist/color/colorimetry-math.d.ts +52 -0
- package/dist/color/colorimetry-math.js +144 -0
- package/dist/color/colorimetry-math.js.map +1 -0
- package/dist/color/gamut-mapping.d.ts +54 -0
- package/dist/color/gamut-mapping.js +107 -0
- package/dist/color/gamut-mapping.js.map +1 -0
- package/dist/color/illuminants.d.ts +182 -0
- package/dist/color/illuminants.js +434 -0
- package/dist/color/illuminants.js.map +1 -0
- package/dist/color/rgb-color-spaces.d.ts +79 -0
- package/dist/color/rgb-color-spaces.js +115 -0
- package/dist/color/rgb-color-spaces.js.map +1 -0
- package/dist/color/sensor-color-development.d.ts +33 -11
- package/dist/color/sensor-color-development.js +104 -30
- package/dist/color/sensor-color-development.js.map +1 -1
- package/dist/color/srgb-icc.d.ts +9 -2
- package/dist/color/srgb-icc.js +16 -5
- package/dist/color/srgb-icc.js.map +1 -1
- package/dist/color/srgb-transfer.d.ts +1 -2
- package/dist/color/srgb-transfer.js +1 -1
- package/dist/color/srgb-transfer.js.map +1 -1
- package/dist/color/white-balance.d.ts +68 -19
- package/dist/color/white-balance.js +168 -35
- package/dist/color/white-balance.js.map +1 -1
- package/dist/composition/image-formation-plan.d.ts +152 -128
- package/dist/composition/image-formation-plan.js +292 -138
- package/dist/composition/image-formation-plan.js.map +1 -1
- package/dist/composition/plan-consumer.d.ts +6 -7
- package/dist/composition/plan-consumer.js +14 -11
- package/dist/composition/plan-consumer.js.map +1 -1
- package/dist/core/calculation-result.d.ts +21 -14
- package/dist/core/calculation-result.js +209 -11
- package/dist/core/calculation-result.js.map +1 -1
- package/dist/core/canonical-json.d.ts +13 -8
- package/dist/core/canonical-json.js +34 -15
- package/dist/core/canonical-json.js.map +1 -1
- package/dist/core/configuration-error.d.ts +5 -4
- package/dist/core/configuration-error.js +5 -3
- package/dist/core/configuration-error.js.map +1 -1
- package/dist/core/evidence-provenance.d.ts +12 -12
- package/dist/core/evidence-provenance.js +10 -9
- package/dist/core/evidence-provenance.js.map +1 -1
- package/dist/core/image-formation.d.ts +11 -10
- package/dist/core/image-formation.js +11 -9
- package/dist/core/image-formation.js.map +1 -1
- package/dist/core/owned-data.d.ts +9 -17
- package/dist/core/owned-data.js +9 -16
- package/dist/core/owned-data.js.map +1 -1
- package/dist/core/portable-math.d.ts +15 -0
- package/dist/core/portable-math.js +56 -0
- package/dist/core/portable-math.js.map +1 -0
- package/dist/core/record-validation.d.ts +48 -9
- package/dist/core/record-validation.js +93 -19
- package/dist/core/record-validation.js.map +1 -1
- package/dist/core/scientific-assurance.d.ts +16 -14
- package/dist/core/scientific-assurance.js +22 -18
- package/dist/core/scientific-assurance.js.map +1 -1
- package/dist/core/spectral-composition.d.ts +13 -14
- package/dist/core/spectral-composition.js +30 -27
- package/dist/core/spectral-composition.js.map +1 -1
- package/dist/core/spectral.d.ts +5 -6
- package/dist/core/spectral.js +9 -7
- package/dist/core/spectral.js.map +1 -1
- package/dist/core/validation.d.ts +3 -6
- package/dist/core/validation.js +3 -5
- package/dist/core/validation.js.map +1 -1
- package/dist/core/version.d.ts +6 -6
- package/dist/core/version.js +6 -5
- package/dist/core/version.js.map +1 -1
- package/dist/equipment/exposure-capabilities.d.ts +10 -10
- package/dist/equipment/exposure-capabilities.js +40 -30
- package/dist/equipment/exposure-capabilities.js.map +1 -1
- package/dist/equipment/generic-tier-assets.d.ts +13 -6
- package/dist/equipment/generic-tier-assets.js +34 -15
- package/dist/equipment/generic-tier-assets.js.map +1 -1
- package/dist/equipment/generic-tier-presets.d.ts +5 -6
- package/dist/equipment/generic-tier-presets.js +15 -13
- package/dist/equipment/generic-tier-presets.js.map +1 -1
- package/dist/equipment/iso-capabilities.d.ts +21 -22
- package/dist/equipment/iso-capabilities.js +49 -44
- package/dist/equipment/iso-capabilities.js.map +1 -1
- package/dist/equipment/metering-capabilities.d.ts +5 -6
- package/dist/equipment/metering-capabilities.js +22 -19
- package/dist/equipment/metering-capabilities.js.map +1 -1
- package/dist/equipment/release-capabilities.d.ts +3 -4
- package/dist/equipment/release-capabilities.js +18 -14
- package/dist/equipment/release-capabilities.js.map +1 -1
- package/dist/exposure/exposure-duration-control.d.ts +19 -17
- package/dist/exposure/exposure-duration-control.js +27 -23
- package/dist/exposure/exposure-duration-control.js.map +1 -1
- package/dist/exposure/exposure-mode-resolver.d.ts +42 -39
- package/dist/exposure/exposure-mode-resolver.js +127 -82
- package/dist/exposure/exposure-mode-resolver.js.map +1 -1
- package/dist/exposure/exposure.d.ts +17 -16
- package/dist/exposure/exposure.js +22 -15
- package/dist/exposure/exposure.js.map +1 -1
- package/dist/exposure/flash-ttl.d.ts +135 -0
- package/dist/exposure/flash-ttl.js +193 -0
- package/dist/exposure/flash-ttl.js.map +1 -0
- package/dist/exposure/flash.d.ts +144 -36
- package/dist/exposure/flash.js +259 -59
- package/dist/exposure/flash.js.map +1 -1
- package/dist/exposure/metering-scene-radiance.d.ts +10 -10
- package/dist/exposure/metering-scene-radiance.js +42 -23
- package/dist/exposure/metering-scene-radiance.js.map +1 -1
- package/dist/exposure/metering-target.d.ts +8 -8
- package/dist/exposure/metering-target.js +30 -20
- package/dist/exposure/metering-target.js.map +1 -1
- package/dist/exposure/metering-temporal.d.ts +16 -15
- package/dist/exposure/metering-temporal.js +41 -19
- package/dist/exposure/metering-temporal.js.map +1 -1
- package/dist/exposure/metering.d.ts +64 -17
- package/dist/exposure/metering.js +159 -30
- package/dist/exposure/metering.js.map +1 -1
- package/dist/exposure/program-line.d.ts +5 -5
- package/dist/exposure/program-line.js +20 -13
- package/dist/exposure/program-line.js.map +1 -1
- package/dist/facade/camera-preset.d.ts +8 -0
- package/dist/facade/camera-preset.js +102 -0
- package/dist/facade/camera-preset.js.map +1 -0
- package/dist/facade/chart-radiance-batch.d.ts +57 -0
- package/dist/facade/chart-radiance-batch.js +121 -0
- package/dist/facade/chart-radiance-batch.js.map +1 -0
- package/dist/facade/chart-scenes.d.ts +177 -0
- package/dist/facade/chart-scenes.js +232 -0
- package/dist/facade/chart-scenes.js.map +1 -0
- package/dist/facade/host-yield.d.ts +7 -0
- package/dist/facade/host-yield.js +23 -0
- package/dist/facade/host-yield.js.map +1 -0
- package/dist/facade/scene-radiance.d.ts +117 -0
- package/dist/facade/scene-radiance.js +205 -0
- package/dist/facade/scene-radiance.js.map +1 -0
- package/dist/facade/simulate-capture.d.ts +284 -0
- package/dist/facade/simulate-capture.js +1026 -0
- package/dist/facade/simulate-capture.js.map +1 -0
- package/dist/gpu/chart-radiance-gpu.d.ts +17 -0
- package/dist/gpu/chart-radiance-gpu.js +176 -0
- package/dist/gpu/chart-radiance-gpu.js.map +1 -0
- package/dist/gpu/image-kernel-accelerator.d.ts +132 -0
- package/dist/gpu/image-kernel-accelerator.js +720 -0
- package/dist/gpu/image-kernel-accelerator.js.map +1 -0
- package/dist/gpu/image-kernel-execution.d.ts +92 -0
- package/dist/gpu/image-kernel-execution.js +84 -0
- package/dist/gpu/image-kernel-execution.js.map +1 -0
- package/dist/gpu/sensor-stage-gpu.d.ts +44 -0
- package/dist/gpu/sensor-stage-gpu.js +317 -0
- package/dist/gpu/sensor-stage-gpu.js.map +1 -0
- package/dist/gpu/temporal-sum-gpu.d.ts +23 -0
- package/dist/gpu/temporal-sum-gpu.js +150 -0
- package/dist/gpu/temporal-sum-gpu.js.map +1 -0
- package/dist/gpu/webgpu-runtime.d.ts +63 -0
- package/dist/gpu/webgpu-runtime.js +215 -0
- package/dist/gpu/webgpu-runtime.js.map +1 -0
- package/dist/gpu/wgsl-chart-kernel.d.ts +30 -0
- package/dist/gpu/wgsl-chart-kernel.js +165 -0
- package/dist/gpu/wgsl-chart-kernel.js.map +1 -0
- package/dist/gpu/wgsl-kernels.d.ts +53 -0
- package/dist/gpu/wgsl-kernels.js +365 -0
- package/dist/gpu/wgsl-kernels.js.map +1 -0
- package/dist/gpu/wgsl-sensor-kernel.d.ts +64 -0
- package/dist/gpu/wgsl-sensor-kernel.js +409 -0
- package/dist/gpu/wgsl-sensor-kernel.js.map +1 -0
- package/dist/index.d.ts +89 -25
- package/dist/index.js +59 -15
- package/dist/index.js.map +1 -1
- package/dist/motion/camera-rotation.d.ts +92 -40
- package/dist/motion/camera-rotation.js +84 -47
- package/dist/motion/camera-rotation.js.map +1 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts +37 -34
- package/dist/motion/capture-rotation-inverse-mapping.js +32 -24
- package/dist/motion/capture-rotation-inverse-mapping.js.map +1 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts +39 -35
- package/dist/motion/capture-rotation-temporal-quadrature.js +37 -28
- package/dist/motion/capture-rotation-temporal-quadrature.js.map +1 -1
- package/dist/motion/capture-rotation-trajectory.d.ts +32 -28
- package/dist/motion/capture-rotation-trajectory.js +36 -26
- package/dist/motion/capture-rotation-trajectory.js.map +1 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts +23 -21
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js +33 -14
- package/dist/motion/capture-translation-parallax-temporal-quadrature.js.map +1 -1
- package/dist/motion/extended-object-projection.d.ts +19 -16
- package/dist/motion/extended-object-projection.js +38 -18
- package/dist/motion/extended-object-projection.js.map +1 -1
- package/dist/motion/projected-motion.d.ts +18 -17
- package/dist/motion/projected-motion.js +25 -17
- package/dist/motion/projected-motion.js.map +1 -1
- package/dist/motion/temporal-exposure-sum.d.ts +55 -0
- package/dist/motion/temporal-exposure-sum.js +141 -0
- package/dist/motion/temporal-exposure-sum.js.map +1 -0
- package/dist/motion/video-sequence.d.ts +111 -0
- package/dist/motion/video-sequence.js +179 -0
- package/dist/motion/video-sequence.js.map +1 -0
- package/dist/optics/aperture.d.ts +14 -15
- package/dist/optics/aperture.js +13 -11
- package/dist/optics/aperture.js.map +1 -1
- package/dist/optics/atmospheric-haze.d.ts +83 -0
- package/dist/optics/atmospheric-haze.js +113 -0
- package/dist/optics/atmospheric-haze.js.map +1 -0
- package/dist/optics/brown-conrady-distortion.d.ts +116 -0
- package/dist/optics/brown-conrady-distortion.js +291 -0
- package/dist/optics/brown-conrady-distortion.js.map +1 -0
- package/dist/optics/circle-of-confusion.d.ts +10 -10
- package/dist/optics/circle-of-confusion.js +15 -11
- package/dist/optics/circle-of-confusion.js.map +1 -1
- package/dist/optics/complex-pupil-psf.d.ts +64 -33
- package/dist/optics/complex-pupil-psf.js +190 -98
- package/dist/optics/complex-pupil-psf.js.map +1 -1
- package/dist/optics/depth-of-field.d.ts +25 -15
- package/dist/optics/depth-of-field.js +67 -27
- package/dist/optics/depth-of-field.js.map +1 -1
- package/dist/optics/diffraction.d.ts +14 -13
- package/dist/optics/diffraction.js +14 -10
- package/dist/optics/diffraction.js.map +1 -1
- package/dist/optics/focus-breathing.d.ts +88 -27
- package/dist/optics/focus-breathing.js +114 -23
- package/dist/optics/focus-breathing.js.map +1 -1
- package/dist/optics/focus-state.d.ts +18 -18
- package/dist/optics/focus-state.js +21 -15
- package/dist/optics/focus-state.js.map +1 -1
- package/dist/optics/front-of-lens-filter.d.ts +45 -14
- package/dist/optics/front-of-lens-filter.js +259 -88
- package/dist/optics/front-of-lens-filter.js.map +1 -1
- package/dist/optics/illumination-vignetting.d.ts +16 -17
- package/dist/optics/illumination-vignetting.js +40 -17
- package/dist/optics/illumination-vignetting.js.map +1 -1
- package/dist/optics/irradiance-convolution.d.ts +59 -0
- package/dist/optics/irradiance-convolution.js +138 -0
- package/dist/optics/irradiance-convolution.js.map +1 -0
- package/dist/optics/lateral-chromatic-aberration.d.ts +33 -30
- package/dist/optics/lateral-chromatic-aberration.js +33 -23
- package/dist/optics/lateral-chromatic-aberration.js.map +1 -1
- package/dist/optics/lens-psf-kernels.d.ts +89 -0
- package/dist/optics/lens-psf-kernels.js +175 -0
- package/dist/optics/lens-psf-kernels.js.map +1 -0
- package/dist/optics/lens-psf-profile.d.ts +78 -46
- package/dist/optics/lens-psf-profile.js +335 -124
- package/dist/optics/lens-psf-profile.js.map +1 -1
- package/dist/optics/longitudinal-chromatic-aberration.d.ts +102 -0
- package/dist/optics/longitudinal-chromatic-aberration.js +210 -0
- package/dist/optics/longitudinal-chromatic-aberration.js.map +1 -0
- package/dist/optics/polygon-diffraction.d.ts +80 -23
- package/dist/optics/polygon-diffraction.js +130 -25
- package/dist/optics/polygon-diffraction.js.map +1 -1
- package/dist/optics/profile-contract.d.ts +5 -6
- package/dist/optics/profile-contract.js +14 -11
- package/dist/optics/profile-contract.js.map +1 -1
- package/dist/optics/psf-foundation.d.ts +23 -23
- package/dist/optics/psf-foundation.js +24 -21
- package/dist/optics/psf-foundation.js.map +1 -1
- package/dist/optics/pupil-vignetting.d.ts +118 -0
- package/dist/optics/pupil-vignetting.js +264 -0
- package/dist/optics/pupil-vignetting.js.map +1 -0
- package/dist/optics/radial-distortion.d.ts +34 -33
- package/dist/optics/radial-distortion.js +37 -30
- package/dist/optics/radial-distortion.js.map +1 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts +47 -33
- package/dist/optics/scene-to-sensor-irradiance.js +73 -45
- package/dist/optics/scene-to-sensor-irradiance.js.map +1 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts +23 -18
- package/dist/optics/scene-to-sensor-quadrature.js +16 -11
- package/dist/optics/scene-to-sensor-quadrature.js.map +1 -1
- package/dist/optics/sensor-aperture-rays.d.ts +20 -4
- package/dist/optics/sensor-aperture-rays.js +32 -14
- package/dist/optics/sensor-aperture-rays.js.map +1 -1
- package/dist/optics/sensor-environment-query.d.ts +81 -16
- package/dist/optics/sensor-environment-query.js +145 -12
- package/dist/optics/sensor-environment-query.js.map +1 -1
- package/dist/optics/sensor-psf-quadrature.d.ts +12 -10
- package/dist/optics/sensor-psf-quadrature.js +18 -11
- package/dist/optics/sensor-psf-quadrature.js.map +1 -1
- package/dist/optics/sensor-psf-support.d.ts +8 -6
- package/dist/optics/sensor-psf-support.js +8 -5
- package/dist/optics/sensor-psf-support.js.map +1 -1
- package/dist/optics/stray-light.d.ts +22 -19
- package/dist/optics/stray-light.js +18 -12
- package/dist/optics/stray-light.js.map +1 -1
- package/dist/optics/thin-lens.d.ts +10 -9
- package/dist/optics/thin-lens.js +12 -8
- package/dist/optics/thin-lens.js.map +1 -1
- package/dist/optics/zernike-wavefront.d.ts +154 -0
- package/dist/optics/zernike-wavefront.js +352 -0
- package/dist/optics/zernike-wavefront.js.map +1 -0
- package/dist/output/capture-corrected-sdr.d.ts +16 -8
- package/dist/output/capture-corrected-sdr.js +16 -8
- package/dist/output/capture-corrected-sdr.js.map +1 -1
- package/dist/output/capture-geometry.d.ts +34 -36
- package/dist/output/capture-geometry.js +52 -32
- package/dist/output/capture-geometry.js.map +1 -1
- package/dist/output/capture-sdr.d.ts +7 -6
- package/dist/output/capture-sdr.js +11 -8
- package/dist/output/capture-sdr.js.map +1 -1
- package/dist/output/crop.d.ts +22 -6
- package/dist/output/crop.js +40 -6
- package/dist/output/crop.js.map +1 -1
- package/dist/output/geometric-transforms.d.ts +60 -23
- package/dist/output/geometric-transforms.js +111 -24
- package/dist/output/geometric-transforms.js.map +1 -1
- package/dist/output/lens-corrections.d.ts +27 -19
- package/dist/output/lens-corrections.js +29 -13
- package/dist/output/lens-corrections.js.map +1 -1
- package/dist/output/native-capture-sdr.d.ts +71 -16
- package/dist/output/native-capture-sdr.js +190 -33
- package/dist/output/native-capture-sdr.js.map +1 -1
- package/dist/output/png-encoder.d.ts +65 -0
- package/dist/output/png-encoder.js +461 -0
- package/dist/output/png-encoder.js.map +1 -0
- package/dist/output/print-contrast-reference.d.ts +10 -9
- package/dist/output/print-contrast-reference.js +10 -8
- package/dist/output/print-contrast-reference.js.map +1 -1
- package/dist/output/print-detail.d.ts +18 -17
- package/dist/output/print-detail.js +12 -10
- package/dist/output/print-detail.js.map +1 -1
- package/dist/output/print-jpeg.d.ts +26 -5
- package/dist/output/print-jpeg.js +117 -50
- package/dist/output/print-jpeg.js.map +1 -1
- package/dist/output/print-plan.d.ts +19 -19
- package/dist/output/print-plan.js +11 -10
- package/dist/output/print-plan.js.map +1 -1
- package/dist/output/print-region-statistics.d.ts +14 -15
- package/dist/output/print-region-statistics.js +11 -11
- package/dist/output/print-region-statistics.js.map +1 -1
- package/dist/output/sdr-rendering.d.ts +48 -10
- package/dist/output/sdr-rendering.js +114 -25
- package/dist/output/sdr-rendering.js.map +1 -1
- package/dist/output/subject-framing-crop.d.ts +6 -10
- package/dist/output/subject-framing-crop.js +23 -13
- package/dist/output/subject-framing-crop.js.map +1 -1
- package/dist/processing/demosaic.d.ts +90 -0
- package/dist/processing/demosaic.js +275 -0
- package/dist/processing/demosaic.js.map +1 -0
- package/dist/processing/denoise.d.ts +68 -0
- package/dist/processing/denoise.js +214 -0
- package/dist/processing/denoise.js.map +1 -0
- package/dist/processing/focus-stacking.d.ts +17 -0
- package/dist/processing/focus-stacking.js +80 -0
- package/dist/processing/focus-stacking.js.map +1 -0
- package/dist/processing/hdr.d.ts +54 -0
- package/dist/processing/hdr.js +172 -0
- package/dist/processing/hdr.js.map +1 -0
- package/dist/processing/image-ops.d.ts +66 -0
- package/dist/processing/image-ops.js +192 -0
- package/dist/processing/image-ops.js.map +1 -0
- package/dist/processing/panorama.d.ts +51 -0
- package/dist/processing/panorama.js +305 -0
- package/dist/processing/panorama.js.map +1 -0
- package/dist/processing/processing-task.d.ts +85 -0
- package/dist/processing/processing-task.js +164 -0
- package/dist/processing/processing-task.js.map +1 -0
- package/dist/processing/tone-mapping.d.ts +69 -0
- package/dist/processing/tone-mapping.js +310 -0
- package/dist/processing/tone-mapping.js.map +1 -0
- package/dist/schema/camera.d.ts +5 -4
- package/dist/schema/illumination-spectral.d.ts +13 -19
- package/dist/schema/illumination-spectral.js +23 -19
- package/dist/schema/illumination-spectral.js.map +1 -1
- package/dist/schema/illumination-temporal.d.ts +12 -15
- package/dist/schema/illumination-temporal.js +43 -28
- package/dist/schema/illumination-temporal.js.map +1 -1
- package/dist/schema/illumination.d.ts +5 -4
- package/dist/schema/illumination.js +55 -20
- package/dist/schema/illumination.js.map +1 -1
- package/dist/schema/scene-radiance-temporal.d.ts +9 -11
- package/dist/schema/scene-radiance-temporal.js +26 -23
- package/dist/schema/scene-radiance-temporal.js.map +1 -1
- package/dist/schema/scene-radiance.d.ts +17 -17
- package/dist/schema/scene-radiance.js +56 -34
- package/dist/schema/scene-radiance.js.map +1 -1
- package/dist/schema/scene.d.ts +14 -13
- package/dist/schema/validation.d.ts +0 -1
- package/dist/schema/validation.js +17 -15
- package/dist/schema/validation.js.map +1 -1
- package/dist/sensor/accumulated-charge.d.ts +45 -64
- package/dist/sensor/accumulated-charge.js +41 -47
- package/dist/sensor/accumulated-charge.js.map +1 -1
- package/dist/sensor/architecture.d.ts +22 -25
- package/dist/sensor/architecture.js +17 -16
- package/dist/sensor/architecture.js.map +1 -1
- package/dist/sensor/camera-saturation-capacity.d.ts +21 -28
- package/dist/sensor/camera-saturation-capacity.js +36 -34
- package/dist/sensor/camera-saturation-capacity.js.map +1 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts +46 -51
- package/dist/sensor/capture-color-sampling-binding.js +39 -41
- package/dist/sensor/capture-color-sampling-binding.js.map +1 -1
- package/dist/sensor/capture-mode-timing.d.ts +8 -9
- package/dist/sensor/capture-mode-timing.js +24 -21
- package/dist/sensor/capture-mode-timing.js.map +1 -1
- package/dist/sensor/capture-mode.d.ts +28 -30
- package/dist/sensor/capture-mode.js +33 -31
- package/dist/sensor/capture-mode.js.map +1 -1
- package/dist/sensor/color-sampling.d.ts +30 -33
- package/dist/sensor/color-sampling.js +32 -37
- package/dist/sensor/color-sampling.js.map +1 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts +19 -23
- package/dist/sensor/constant-rate-temporal-integration.js +28 -26
- package/dist/sensor/constant-rate-temporal-integration.js.map +1 -1
- package/dist/sensor/dark-current.d.ts +53 -49
- package/dist/sensor/dark-current.js +87 -46
- package/dist/sensor/dark-current.js.map +1 -1
- package/dist/sensor/environment-photo-signal.d.ts +71 -30
- package/dist/sensor/environment-photo-signal.js +127 -46
- package/dist/sensor/environment-photo-signal.js.map +1 -1
- package/dist/sensor/eqe-electron-rate.d.ts +14 -13
- package/dist/sensor/eqe-electron-rate.js +34 -14
- package/dist/sensor/eqe-electron-rate.js.map +1 -1
- package/dist/sensor/eqe-local-exposure.d.ts +24 -24
- package/dist/sensor/eqe-local-exposure.js +15 -11
- package/dist/sensor/eqe-local-exposure.js.map +1 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts +11 -11
- package/dist/sensor/eqe-temporal-exposure.js +15 -10
- package/dist/sensor/eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/exposure-window.d.ts +48 -34
- package/dist/sensor/exposure-window.js +77 -36
- package/dist/sensor/exposure-window.js.map +1 -1
- package/dist/sensor/fixed-pattern-noise.d.ts +108 -0
- package/dist/sensor/fixed-pattern-noise.js +166 -0
- package/dist/sensor/fixed-pattern-noise.js.map +1 -0
- package/dist/sensor/iso-gain.d.ts +44 -0
- package/dist/sensor/iso-gain.js +119 -0
- package/dist/sensor/iso-gain.js.map +1 -0
- package/dist/sensor/iso-signal-chain.d.ts +25 -48
- package/dist/sensor/iso-signal-chain.js +52 -66
- package/dist/sensor/iso-signal-chain.js.map +1 -1
- package/dist/sensor/local-exposure-binding.d.ts +21 -21
- package/dist/sensor/local-exposure-binding.js +22 -18
- package/dist/sensor/local-exposure-binding.js.map +1 -1
- package/dist/sensor/optical-stack.d.ts +36 -40
- package/dist/sensor/optical-stack.js +34 -37
- package/dist/sensor/optical-stack.js.map +1 -1
- package/dist/sensor/photon-energy.d.ts +22 -28
- package/dist/sensor/photon-energy.js +42 -34
- package/dist/sensor/photon-energy.js.map +1 -1
- package/dist/sensor/physical-charge-capacity.d.ts +20 -30
- package/dist/sensor/physical-charge-capacity.js +35 -36
- package/dist/sensor/physical-charge-capacity.js.map +1 -1
- package/dist/sensor/pixel-pitch.d.ts +2 -3
- package/dist/sensor/pixel-pitch.js +4 -2
- package/dist/sensor/pixel-pitch.js.map +1 -1
- package/dist/sensor/radiometry-readiness.d.ts +13 -15
- package/dist/sensor/radiometry-readiness.js +20 -17
- package/dist/sensor/radiometry-readiness.js.map +1 -1
- package/dist/sensor/raw-readout.d.ts +173 -83
- package/dist/sensor/raw-readout.js +425 -160
- package/dist/sensor/raw-readout.js.map +1 -1
- package/dist/sensor/raw-reconstruction.d.ts +112 -44
- package/dist/sensor/raw-reconstruction.js +200 -47
- package/dist/sensor/raw-reconstruction.js.map +1 -1
- package/dist/sensor/readout-exposure-linkage.d.ts +103 -34
- package/dist/sensor/readout-exposure-linkage.js +125 -27
- package/dist/sensor/readout-exposure-linkage.js.map +1 -1
- package/dist/sensor/readout-timing.d.ts +43 -44
- package/dist/sensor/readout-timing.js +38 -30
- package/dist/sensor/readout-timing.js.map +1 -1
- package/dist/sensor/response-application-compatibility.d.ts +21 -28
- package/dist/sensor/response-application-compatibility.js +35 -34
- package/dist/sensor/response-application-compatibility.js.map +1 -1
- package/dist/sensor/response-operating-range.d.ts +26 -35
- package/dist/sensor/response-operating-range.js +40 -39
- package/dist/sensor/response-operating-range.js.map +1 -1
- package/dist/sensor/responsivity-photocurrent.d.ts +21 -29
- package/dist/sensor/responsivity-photocurrent.js +57 -40
- package/dist/sensor/responsivity-photocurrent.js.map +1 -1
- package/dist/sensor/sampling-aperture.d.ts +21 -25
- package/dist/sensor/sampling-aperture.js +29 -28
- package/dist/sensor/sampling-aperture.js.map +1 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts +14 -12
- package/dist/sensor/scene-eqe-temporal-exposure.js +13 -8
- package/dist/sensor/scene-eqe-temporal-exposure.js.map +1 -1
- package/dist/sensor/sensor-geometry.d.ts +28 -32
- package/dist/sensor/sensor-geometry.js +35 -20
- package/dist/sensor/sensor-geometry.js.map +1 -1
- package/dist/sensor/signal-noise.d.ts +14 -16
- package/dist/sensor/signal-noise.js +15 -13
- package/dist/sensor/signal-noise.js.map +1 -1
- package/dist/sensor/spatial-sample-reduction.d.ts +45 -60
- package/dist/sensor/spatial-sample-reduction.js +39 -48
- package/dist/sensor/spatial-sample-reduction.js.map +1 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts +46 -54
- package/dist/sensor/spatial-sampling-quadrature.js +31 -36
- package/dist/sensor/spatial-sampling-quadrature.js.map +1 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts +32 -42
- package/dist/sensor/spatio-spectral-reduction.js +24 -29
- package/dist/sensor/spatio-spectral-reduction.js.map +1 -1
- package/dist/sensor/spectral-coverage.d.ts +6 -9
- package/dist/sensor/spectral-coverage.js +9 -6
- package/dist/sensor/spectral-coverage.js.map +1 -1
- package/dist/sensor/spectral-quadrature.d.ts +46 -60
- package/dist/sensor/spectral-quadrature.js +38 -48
- package/dist/sensor/spectral-quadrature.js.map +1 -1
- package/dist/sensor/spectral-response.d.ts +53 -41
- package/dist/sensor/spectral-response.js +80 -47
- package/dist/sensor/spectral-response.js.map +1 -1
- package/dist/sensor/stochastic-seed.d.ts +50 -0
- package/dist/sensor/stochastic-seed.js +123 -0
- package/dist/sensor/stochastic-seed.js.map +1 -0
- package/dist/sensor/temporal-eqe-sum.d.ts +2 -4
- package/dist/sensor/temporal-eqe-sum.js +5 -6
- package/dist/sensor/temporal-eqe-sum.js.map +1 -1
- package/dist/sensor/temporal-photo-signal.d.ts +5 -6
- package/dist/sensor/temporal-photo-signal.js +11 -10
- package/dist/sensor/temporal-photo-signal.js.map +1 -1
- package/dist/sensor/temporal-sample-binding.d.ts +1 -2
- package/dist/sensor/temporal-sample-binding.js +3 -3
- package/dist/sensor/temporal-sample-binding.js.map +1 -1
- package/dist/simulation/poc-simulation.d.ts +16 -16
- package/dist/simulation/poc-simulation.js +20 -15
- package/dist/simulation/poc-simulation.js.map +1 -1
- package/dist/stabilization/camera-shake.d.ts +42 -18
- package/dist/stabilization/camera-shake.js +43 -20
- package/dist/stabilization/camera-shake.js.map +1 -1
- package/dist/stabilization/system.d.ts +44 -41
- package/dist/stabilization/system.js +196 -108
- package/dist/stabilization/system.js.map +1 -1
- package/docs/AGENT_GUIDE.md +183 -0
- package/docs/API_REFERENCE.md +761 -2
- package/docs/QUICK_START.md +495 -0
- package/docs/USAGE.md +1719 -714
- package/docs/api/camera-equivalent-focal-length.md +6 -7
- package/docs/api/camera-field-of-view.md +16 -8
- package/docs/api/camera-lens-projection.md +246 -0
- package/docs/api/camera-projected-object-size.md +6 -5
- package/docs/api/capture-capture-export-metadata.md +10 -10
- package/docs/api/capture-dng-import.md +134 -0
- package/docs/api/capture-environment-raw-producer.md +17 -11
- package/docs/api/capture-export-jpeg.md +16 -0
- package/docs/api/capture-focus-control.md +25 -47
- package/docs/api/capture-linear-encoding.md +21 -12
- package/docs/api/capture-lossless-jpeg.md +49 -0
- package/docs/api/capture-native-environment-optical-stage.md +75 -0
- package/docs/api/capture-native-environment-raw.md +161 -4
- package/docs/api/capture-native-raw-development.md +69 -8
- package/docs/api/capture-native-raw-dng.md +84 -0
- package/docs/api/capture-native-raw.md +21 -10
- package/docs/api/capture-packed-sensor-raw.md +156 -0
- package/docs/api/capture-photographic-export.md +69 -31
- package/docs/api/capture-raw-frame-reconstruction.md +8 -8
- package/docs/api/capture-raw-white-level.md +37 -0
- package/docs/api/capture-release-sequence.md +6 -7
- package/docs/api/capture-sensor-raw-frame.md +6 -6
- package/docs/api/capture-sensor-raw-producer.md +17 -11
- package/docs/api/capture-simulated-capture.md +15 -15
- package/docs/api/color-camera-color-matrix.md +103 -0
- package/docs/api/color-capture-color.md +22 -11
- package/docs/api/color-chromatic-adaptation.md +82 -0
- package/docs/api/color-color-difference.md +134 -0
- package/docs/api/color-color-matching-functions.md +259 -0
- package/docs/api/color-colorimetry-math.md +54 -0
- package/docs/api/color-gamut-mapping.md +72 -0
- package/docs/api/color-illuminants.md +280 -0
- package/docs/api/color-rgb-color-spaces.md +151 -0
- package/docs/api/color-sensor-color-development.md +27 -0
- package/docs/api/color-srgb-icc.md +2 -4
- package/docs/api/color-white-balance.md +95 -19
- package/docs/api/composition-image-formation-plan.md +124 -95
- package/docs/api/composition-plan-consumer.md +7 -7
- package/docs/api/core-calculation-result.md +18 -14
- package/docs/api/core-configuration-error.md +1 -1
- package/docs/api/core-image-formation.md +7 -7
- package/docs/api/core-scientific-assurance.md +12 -10
- package/docs/api/core-spectral-composition.md +14 -14
- package/docs/api/core-spectral.md +6 -6
- package/docs/api/core-validation.md +3 -3
- package/docs/api/core-version.md +7 -6
- package/docs/api/equipment-exposure-capabilities.md +11 -10
- package/docs/api/equipment-generic-tier-assets.md +7 -2
- package/docs/api/equipment-generic-tier-presets.md +6 -6
- package/docs/api/equipment-iso-capabilities.md +18 -18
- package/docs/api/equipment-metering-capabilities.md +6 -6
- package/docs/api/equipment-release-capabilities.md +4 -4
- package/docs/api/exports.json +2213 -8
- package/docs/api/exposure-exposure-duration-control.md +9 -9
- package/docs/api/exposure-exposure-mode-resolver.md +35 -31
- package/docs/api/exposure-exposure.md +10 -10
- package/docs/api/exposure-flash-ttl.md +182 -0
- package/docs/api/exposure-flash.md +183 -28
- package/docs/api/exposure-metering-scene-radiance.md +11 -10
- package/docs/api/exposure-metering-target.md +9 -8
- package/docs/api/exposure-metering-temporal.md +8 -8
- package/docs/api/exposure-metering.md +69 -9
- package/docs/api/exposure-program-line.md +6 -5
- package/docs/api/facade-chart-radiance-batch.md +96 -0
- package/docs/api/facade-chart-scenes.md +240 -0
- package/docs/api/facade-scene-radiance.md +122 -0
- package/docs/api/facade-simulate-capture.md +324 -0
- package/docs/api/gpu-image-kernel-accelerator.md +157 -0
- package/docs/api/gpu-image-kernel-execution.md +152 -0
- package/docs/api/motion-camera-rotation.md +43 -26
- package/docs/api/motion-capture-rotation-inverse-mapping.md +24 -23
- package/docs/api/motion-capture-rotation-temporal-quadrature.md +22 -22
- package/docs/api/motion-capture-rotation-trajectory.md +15 -15
- package/docs/api/motion-capture-translation-parallax-temporal-quadrature.md +15 -14
- package/docs/api/motion-extended-object-projection.md +10 -8
- package/docs/api/motion-projected-motion.md +8 -8
- package/docs/api/motion-temporal-exposure-sum.md +98 -0
- package/docs/api/motion-video-sequence.md +159 -0
- package/docs/api/optics-aperture.md +8 -8
- package/docs/api/optics-atmospheric-haze.md +104 -0
- package/docs/api/optics-brown-conrady-distortion.md +123 -0
- package/docs/api/optics-circle-of-confusion.md +5 -4
- package/docs/api/optics-complex-pupil-psf.md +57 -16
- package/docs/api/optics-depth-of-field.md +12 -6
- package/docs/api/optics-diffraction.md +8 -7
- package/docs/api/optics-focus-breathing.md +104 -16
- package/docs/api/optics-focus-state.md +9 -10
- package/docs/api/optics-front-of-lens-filter.md +72 -14
- package/docs/api/optics-illumination-vignetting.md +10 -10
- package/docs/api/optics-irradiance-convolution.md +95 -0
- package/docs/api/optics-lateral-chromatic-aberration.md +22 -21
- package/docs/api/optics-lens-psf-kernels.md +72 -0
- package/docs/api/optics-lens-psf-profile.md +48 -26
- package/docs/api/optics-longitudinal-chromatic-aberration.md +128 -0
- package/docs/api/optics-polygon-diffraction.md +78 -13
- package/docs/api/optics-profile-contract.md +4 -4
- package/docs/api/optics-psf-foundation.md +12 -12
- package/docs/api/optics-pupil-vignetting.md +132 -0
- package/docs/api/optics-radial-distortion.md +12 -12
- package/docs/api/optics-scene-to-sensor-irradiance.md +25 -14
- package/docs/api/optics-scene-to-sensor-quadrature.md +15 -12
- package/docs/api/optics-sensor-aperture-rays.md +3 -2
- package/docs/api/optics-sensor-environment-query.md +52 -9
- package/docs/api/optics-sensor-psf-quadrature.md +13 -10
- package/docs/api/optics-stray-light.md +12 -11
- package/docs/api/optics-thin-lens.md +4 -3
- package/docs/api/optics-zernike-wavefront.md +229 -0
- package/docs/api/output-capture-corrected-sdr.md +10 -7
- package/docs/api/output-capture-geometry.md +35 -36
- package/docs/api/output-capture-sdr.md +4 -4
- package/docs/api/output-crop.md +7 -4
- package/docs/api/output-geometric-transforms.md +65 -19
- package/docs/api/output-lens-corrections.md +17 -15
- package/docs/api/output-native-capture-sdr.md +26 -13
- package/docs/api/output-png-encoder.md +105 -0
- package/docs/api/output-print-contrast-reference.md +8 -8
- package/docs/api/output-print-detail.md +14 -14
- package/docs/api/output-print-jpeg.md +22 -5
- package/docs/api/output-print-plan.md +18 -18
- package/docs/api/output-print-region-statistics.md +14 -14
- package/docs/api/output-sdr-rendering.md +52 -10
- package/docs/api/output-subject-framing-crop.md +5 -6
- package/docs/api/processing-demosaic.md +120 -0
- package/docs/api/processing-denoise.md +148 -0
- package/docs/api/processing-focus-stacking.md +41 -0
- package/docs/api/processing-hdr.md +113 -0
- package/docs/api/processing-panorama.md +82 -0
- package/docs/api/processing-processing-task.md +107 -0
- package/docs/api/processing-tone-mapping.md +142 -0
- package/docs/api/schema-camera.md +6 -4
- package/docs/api/schema-illumination-spectral.md +10 -11
- package/docs/api/schema-illumination-temporal.md +13 -15
- package/docs/api/schema-illumination.md +4 -4
- package/docs/api/schema-scene-radiance-temporal.md +10 -11
- package/docs/api/schema-scene-radiance.md +18 -17
- package/docs/api/schema-scene.md +9 -9
- package/docs/api/schema-validation.md +1 -1
- package/docs/api/sensor-accumulated-charge.md +12 -20
- package/docs/api/sensor-architecture.md +15 -16
- package/docs/api/sensor-camera-saturation-capacity.md +9 -11
- package/docs/api/sensor-capture-color-sampling-binding.md +47 -51
- package/docs/api/sensor-capture-mode-timing.md +9 -9
- package/docs/api/sensor-capture-mode.md +29 -30
- package/docs/api/sensor-color-sampling.md +31 -33
- package/docs/api/sensor-constant-rate-temporal-integration.md +10 -11
- package/docs/api/sensor-dark-current.md +30 -14
- package/docs/api/sensor-environment-photo-signal.md +13 -6
- package/docs/api/sensor-eqe-electron-rate.md +9 -8
- package/docs/api/sensor-eqe-local-exposure.md +18 -17
- package/docs/api/sensor-eqe-temporal-exposure.md +12 -11
- package/docs/api/sensor-exposure-window.md +24 -24
- package/docs/api/sensor-fixed-pattern-noise.md +104 -0
- package/docs/api/sensor-iso-gain.md +63 -0
- package/docs/api/sensor-iso-signal-chain.md +13 -22
- package/docs/api/sensor-local-exposure-binding.md +12 -13
- package/docs/api/sensor-optical-stack.md +37 -40
- package/docs/api/sensor-photon-energy.md +10 -11
- package/docs/api/sensor-physical-charge-capacity.md +8 -13
- package/docs/api/sensor-pixel-pitch.md +1 -1
- package/docs/api/sensor-radiometry-readiness.md +9 -9
- package/docs/api/sensor-raw-readout.md +118 -52
- package/docs/api/sensor-raw-reconstruction.md +97 -20
- package/docs/api/sensor-readout-exposure-linkage.md +120 -24
- package/docs/api/sensor-readout-timing.md +33 -35
- package/docs/api/sensor-response-application-compatibility.md +9 -11
- package/docs/api/sensor-response-operating-range.md +14 -18
- package/docs/api/sensor-responsivity-photocurrent.md +9 -12
- package/docs/api/sensor-sampling-aperture.md +22 -25
- package/docs/api/sensor-scene-eqe-temporal-exposure.md +9 -8
- package/docs/api/sensor-sensor-geometry.md +23 -24
- package/docs/api/sensor-signal-noise.md +10 -10
- package/docs/api/sensor-spatial-sample-reduction.md +27 -30
- package/docs/api/sensor-spatial-sampling-quadrature.md +37 -39
- package/docs/api/sensor-spatio-spectral-reduction.md +27 -29
- package/docs/api/sensor-spectral-coverage.md +5 -5
- package/docs/api/sensor-spectral-quadrature.md +33 -35
- package/docs/api/sensor-spectral-response.md +28 -16
- package/docs/api/sensor-temporal-photo-signal.md +6 -6
- package/docs/api/simulation-poc-simulation.md +17 -16
- package/docs/api/stabilization-camera-shake.md +29 -10
- package/docs/api/stabilization-system.md +25 -21
- package/docs/examples/production-request.json +3821 -2157
- package/docs/examples/simulate-capture.mjs +14 -0
- package/llms.txt +35 -0
- package/package.json +32 -12
- package/AGENTS.md +0 -674
- package/CONTRIBUTING.md +0 -76
- package/DCO +0 -33
- package/dist/camera/equivalent-focal-length.d.ts.map +0 -1
- package/dist/camera/field-of-view.d.ts.map +0 -1
- package/dist/camera/projected-object-size.d.ts.map +0 -1
- package/dist/capture/capture-export-metadata.d.ts.map +0 -1
- package/dist/capture/environment-raw-producer.d.ts.map +0 -1
- package/dist/capture/export-jpeg.d.ts.map +0 -1
- package/dist/capture/export-tiff.d.ts.map +0 -1
- package/dist/capture/focus-control.d.ts.map +0 -1
- package/dist/capture/linear-encoding.d.ts.map +0 -1
- package/dist/capture/native-environment-raw.d.ts.map +0 -1
- package/dist/capture/native-raw-development.d.ts.map +0 -1
- package/dist/capture/native-raw.d.ts.map +0 -1
- package/dist/capture/photographic-export.d.ts.map +0 -1
- package/dist/capture/raw-frame-limits.d.ts.map +0 -1
- package/dist/capture/raw-frame-reconstruction.d.ts.map +0 -1
- package/dist/capture/release-sequence.d.ts.map +0 -1
- package/dist/capture/sensor-raw-frame.d.ts.map +0 -1
- package/dist/capture/sensor-raw-producer.d.ts.map +0 -1
- package/dist/capture/simulated-capture.d.ts.map +0 -1
- package/dist/color/capture-color.d.ts.map +0 -1
- package/dist/color/sensor-color-development.d.ts.map +0 -1
- package/dist/color/srgb-icc.d.ts.map +0 -1
- package/dist/color/srgb-transfer.d.ts.map +0 -1
- package/dist/color/white-balance.d.ts.map +0 -1
- package/dist/composition/image-formation-plan.d.ts.map +0 -1
- package/dist/composition/plan-consumer.d.ts.map +0 -1
- package/dist/core/calculation-result.d.ts.map +0 -1
- package/dist/core/canonical-json.d.ts.map +0 -1
- package/dist/core/configuration-error.d.ts.map +0 -1
- package/dist/core/evidence-provenance.d.ts.map +0 -1
- package/dist/core/image-formation.d.ts.map +0 -1
- package/dist/core/owned-data.d.ts.map +0 -1
- package/dist/core/record-validation.d.ts.map +0 -1
- package/dist/core/scientific-assurance.d.ts.map +0 -1
- package/dist/core/spectral-composition.d.ts.map +0 -1
- package/dist/core/spectral.d.ts.map +0 -1
- package/dist/core/validation.d.ts.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/equipment/exposure-capabilities.d.ts.map +0 -1
- package/dist/equipment/generic-tier-assets.d.ts.map +0 -1
- package/dist/equipment/generic-tier-presets.d.ts.map +0 -1
- package/dist/equipment/iso-capabilities.d.ts.map +0 -1
- package/dist/equipment/metering-capabilities.d.ts.map +0 -1
- package/dist/equipment/release-capabilities.d.ts.map +0 -1
- package/dist/exposure/exposure-duration-control.d.ts.map +0 -1
- package/dist/exposure/exposure-mode-resolver.d.ts.map +0 -1
- package/dist/exposure/exposure.d.ts.map +0 -1
- package/dist/exposure/flash.d.ts.map +0 -1
- package/dist/exposure/metering-scene-radiance.d.ts.map +0 -1
- package/dist/exposure/metering-target.d.ts.map +0 -1
- package/dist/exposure/metering-temporal.d.ts.map +0 -1
- package/dist/exposure/metering.d.ts.map +0 -1
- package/dist/exposure/program-line.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/motion/camera-rotation.d.ts.map +0 -1
- package/dist/motion/capture-rotation-inverse-mapping.d.ts.map +0 -1
- package/dist/motion/capture-rotation-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/capture-rotation-trajectory.d.ts.map +0 -1
- package/dist/motion/capture-translation-parallax-temporal-quadrature.d.ts.map +0 -1
- package/dist/motion/extended-object-projection.d.ts.map +0 -1
- package/dist/motion/projected-motion.d.ts.map +0 -1
- package/dist/optics/aperture.d.ts.map +0 -1
- package/dist/optics/circle-of-confusion.d.ts.map +0 -1
- package/dist/optics/complex-pupil-psf.d.ts.map +0 -1
- package/dist/optics/depth-of-field.d.ts.map +0 -1
- package/dist/optics/diffraction.d.ts.map +0 -1
- package/dist/optics/focus-breathing.d.ts.map +0 -1
- package/dist/optics/focus-state.d.ts.map +0 -1
- package/dist/optics/front-of-lens-filter.d.ts.map +0 -1
- package/dist/optics/illumination-vignetting.d.ts.map +0 -1
- package/dist/optics/lateral-chromatic-aberration.d.ts.map +0 -1
- package/dist/optics/lens-psf-profile.d.ts.map +0 -1
- package/dist/optics/polygon-diffraction.d.ts.map +0 -1
- package/dist/optics/profile-contract.d.ts.map +0 -1
- package/dist/optics/psf-foundation.d.ts.map +0 -1
- package/dist/optics/radial-distortion.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-irradiance.d.ts.map +0 -1
- package/dist/optics/scene-to-sensor-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-aperture-rays.d.ts.map +0 -1
- package/dist/optics/sensor-environment-query.d.ts.map +0 -1
- package/dist/optics/sensor-psf-quadrature.d.ts.map +0 -1
- package/dist/optics/sensor-psf-support.d.ts.map +0 -1
- package/dist/optics/stray-light.d.ts.map +0 -1
- package/dist/optics/thin-lens.d.ts.map +0 -1
- package/dist/output/capture-corrected-sdr.d.ts.map +0 -1
- package/dist/output/capture-geometry.d.ts.map +0 -1
- package/dist/output/capture-sdr.d.ts.map +0 -1
- package/dist/output/crop.d.ts.map +0 -1
- package/dist/output/geometric-transforms.d.ts.map +0 -1
- package/dist/output/lens-corrections.d.ts.map +0 -1
- package/dist/output/native-capture-sdr.d.ts.map +0 -1
- package/dist/output/print-contrast-reference.d.ts.map +0 -1
- package/dist/output/print-detail.d.ts.map +0 -1
- package/dist/output/print-jpeg.d.ts.map +0 -1
- package/dist/output/print-plan.d.ts.map +0 -1
- package/dist/output/print-region-statistics.d.ts.map +0 -1
- package/dist/output/sdr-rendering.d.ts.map +0 -1
- package/dist/output/subject-framing-crop.d.ts.map +0 -1
- package/dist/schema/camera.d.ts.map +0 -1
- package/dist/schema/camera.js +0 -3
- package/dist/schema/camera.js.map +0 -1
- package/dist/schema/illumination-spectral.d.ts.map +0 -1
- package/dist/schema/illumination-temporal.d.ts.map +0 -1
- package/dist/schema/illumination.d.ts.map +0 -1
- package/dist/schema/scene-radiance-temporal.d.ts.map +0 -1
- package/dist/schema/scene-radiance.d.ts.map +0 -1
- package/dist/schema/scene.d.ts.map +0 -1
- package/dist/schema/scene.js +0 -3
- package/dist/schema/scene.js.map +0 -1
- package/dist/schema/validation.d.ts.map +0 -1
- package/dist/sensor/accumulated-charge.d.ts.map +0 -1
- package/dist/sensor/architecture.d.ts.map +0 -1
- package/dist/sensor/camera-saturation-capacity.d.ts.map +0 -1
- package/dist/sensor/capture-color-sampling-binding.d.ts.map +0 -1
- package/dist/sensor/capture-mode-timing.d.ts.map +0 -1
- package/dist/sensor/capture-mode.d.ts.map +0 -1
- package/dist/sensor/color-sampling.d.ts.map +0 -1
- package/dist/sensor/constant-rate-temporal-integration.d.ts.map +0 -1
- package/dist/sensor/dark-current.d.ts.map +0 -1
- package/dist/sensor/environment-photo-signal.d.ts.map +0 -1
- package/dist/sensor/eqe-electron-rate.d.ts.map +0 -1
- package/dist/sensor/eqe-local-exposure.d.ts.map +0 -1
- package/dist/sensor/eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/exposure-window.d.ts.map +0 -1
- package/dist/sensor/iso-signal-chain.d.ts.map +0 -1
- package/dist/sensor/local-exposure-binding.d.ts.map +0 -1
- package/dist/sensor/optical-stack.d.ts.map +0 -1
- package/dist/sensor/photon-energy.d.ts.map +0 -1
- package/dist/sensor/physical-charge-capacity.d.ts.map +0 -1
- package/dist/sensor/pixel-pitch.d.ts.map +0 -1
- package/dist/sensor/radiometry-readiness.d.ts.map +0 -1
- package/dist/sensor/raw-readout.d.ts.map +0 -1
- package/dist/sensor/raw-reconstruction.d.ts.map +0 -1
- package/dist/sensor/readout-exposure-linkage.d.ts.map +0 -1
- package/dist/sensor/readout-timing.d.ts.map +0 -1
- package/dist/sensor/response-application-compatibility.d.ts.map +0 -1
- package/dist/sensor/response-operating-range.d.ts.map +0 -1
- package/dist/sensor/responsivity-photocurrent.d.ts.map +0 -1
- package/dist/sensor/sampling-aperture.d.ts.map +0 -1
- package/dist/sensor/scene-eqe-temporal-exposure.d.ts.map +0 -1
- package/dist/sensor/sensor-geometry.d.ts.map +0 -1
- package/dist/sensor/signal-noise.d.ts.map +0 -1
- package/dist/sensor/spatial-sample-reduction.d.ts.map +0 -1
- package/dist/sensor/spatial-sampling-quadrature.d.ts.map +0 -1
- package/dist/sensor/spatio-spectral-reduction.d.ts.map +0 -1
- package/dist/sensor/spectral-coverage.d.ts.map +0 -1
- package/dist/sensor/spectral-quadrature.d.ts.map +0 -1
- package/dist/sensor/spectral-response.d.ts.map +0 -1
- package/dist/sensor/temporal-eqe-sum.d.ts.map +0 -1
- package/dist/sensor/temporal-photo-signal.d.ts.map +0 -1
- package/dist/sensor/temporal-sample-binding.d.ts.map +0 -1
- package/dist/simulation/poc-simulation.d.ts.map +0 -1
- package/dist/stabilization/camera-shake.d.ts.map +0 -1
- package/dist/stabilization/system.d.ts.map +0 -1
- package/docs/API_STYLE.md +0 -235
- package/docs/ARCHITECTURE.md +0 -356
- package/docs/AUTOMATION_COORDINATION.md +0 -190
- package/docs/CAPTURE_COLOR.md +0 -25
- package/docs/CAPTURE_CORRECTED_SDR.md +0 -25
- package/docs/CAPTURE_EXPORT_METADATA.md +0 -27
- package/docs/CAPTURE_SDR.md +0 -22
- package/docs/DENSE_PUPIL_QUALIFICATION.md +0 -121
- package/docs/DEVELOPERS.md +0 -68
- package/docs/DIGITAL_OPTICS_FOUNDATION.md +0 -69
- package/docs/ENVIRONMENT_RAW_CAPTURE.md +0 -208
- package/docs/EXPORT_ACCEPTANCE.md +0 -133
- package/docs/GENERIC_TIER_PRESETS.md +0 -269
- package/docs/GEOMETRIC_PREPARATION_REUSE.md +0 -141
- package/docs/IMAGE_FORMATION.md +0 -247
- package/docs/LINEAR_CAPTURE_ENCODING.md +0 -25
- package/docs/MOTION_AND_SIGNAL.md +0 -250
- package/docs/NATIVE_CAPTURE_SDR.md +0 -70
- package/docs/NATIVE_CAPTURE_SDR_REVIEW.md +0 -37
- package/docs/NATIVE_CAPTURE_SDR_VALIDATION.md +0 -34
- package/docs/NATIVE_RAW_AND_PRINT.md +0 -54
- package/docs/NUMERICAL_CORRECTNESS.md +0 -191
- package/docs/PERFORMANCE_BASELINE.md +0 -56
- package/docs/PHOTOGRAPHIC_EXPORT.md +0 -206
- package/docs/PHYSICS_FOUNDATION.md +0 -426
- package/docs/POC_API.md +0 -278
- package/docs/POC_PROJECTION_PLATFORM_REFERENCE.md +0 -12
- package/docs/POC_PROJECTION_REUSE.md +0 -124
- package/docs/PRINT_195_196_REVIEW.md +0 -93
- package/docs/PRINT_196_ENGINE_ACCEPTANCE.md +0 -45
- package/docs/PRINT_CONTRAST_REFERENCE.md +0 -43
- package/docs/PRINT_DETAIL_ASSESSMENT.md +0 -81
- package/docs/PRINT_DETAIL_JPEG_EVIDENCE.md +0 -36
- package/docs/PRINT_DETAIL_SDR_EVIDENCE.md +0 -29
- package/docs/PRINT_DETAIL_VALIDATION.md +0 -36
- package/docs/PRINT_PLANNING.md +0 -75
- package/docs/PRINT_REGION_STATISTICS.md +0 -38
- package/docs/PROCESSED_OUTPUT.md +0 -157
- package/docs/PRODUCTION_COMPOSITION.md +0 -373
- package/docs/PRODUCTION_ENVIRONMENT_CAPTURE.md +0 -131
- package/docs/PROVENANCE.md +0 -115
- package/docs/PSF_FOUNDATION.md +0 -165
- package/docs/RAW_FRAME_ENVELOPE.md +0 -56
- package/docs/RAW_FRAME_RECONSTRUCTION.md +0 -30
- package/docs/RELEASE_1_0.md +0 -66
- package/docs/RELEASE_1_0_1.md +0 -61
- package/docs/RELEASE_1_1_0.md +0 -25
- package/docs/RELEASE_1_2_0.md +0 -51
- package/docs/RELEASE_1_3_0.md +0 -15
- package/docs/RELEASE_1_4_0.md +0 -23
- package/docs/RELEASE_1_5_0.md +0 -105
- package/docs/RELEASE_AUDIT.md +0 -39
- package/docs/SCENE_RADIANCE_AND_ILLUMINATION.md +0 -298
- package/docs/SCENE_SENSOR_QUADRATURE.md +0 -98
- package/docs/SCENE_SENSOR_TEMPORAL_EXPOSURE.md +0 -86
- package/docs/SCIENTIFIC_ASSURANCE.md +0 -280
- package/docs/SCIENTIFIC_CONFORMANCE.md +0 -83
- package/docs/SDR_RENDERING.md +0 -33
- package/docs/SENSOR_APERTURE_RAYS.md +0 -23
- package/docs/SENSOR_ENVIRONMENT_QUERY.md +0 -86
- package/docs/SENSOR_EQE_LOCAL_EXPOSURE.md +0 -104
- package/docs/SENSOR_EQE_TEMPORAL_EXPOSURE.md +0 -74
- package/docs/SENSOR_PSF_QUADRATURE.md +0 -90
- package/docs/SENSOR_RAW_FRAME.md +0 -20
- package/docs/SENSOR_RAW_PRODUCER.md +0 -77
- package/docs/SEPARABLE_EMISSION_DRAFT.md +0 -103
- package/docs/SIGNAL_CONFORMANCE.md +0 -23
- package/docs/SIMULATED_CAPTURE.md +0 -65
- package/docs/STABILIZATION.md +0 -234
- package/docs/TEMPORAL_PHOTO_RAW.md +0 -83
- package/docs/TIER_ACCEPTANCE.md +0 -129
- package/docs/TIER_PRESET_ACCEPTANCE.md +0 -59
- package/docs/V1_COMPOSITION_MAP.md +0 -123
- package/docs/V1_HELPER_REUSE_REVIEW.md +0 -60
- package/docs/V1_PERFORMANCE_DISPOSITION.md +0 -88
- package/docs/benchmarks/2026-10-01-main-baseline.json +0 -694
- package/docs/benchmarks/2026-10-02-geometric-preparation-reuse.json +0 -2190
- package/docs/benchmarks/2026-10-02-poc-projection-reuse.json +0 -2423
- package/docs/benchmarks/2026-10-02-v1-environment-gc-profile.json +0 -210
- package/docs/benchmarks/2026-10-02-v1-environment-ordinary.json +0 -187
- package/docs/benchmarks/2026-10-02-v1-geometry-gc-profile.json +0 -756
- package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-1.json +0 -711
- package/docs/benchmarks/2026-10-02-v1-geometry-ordinary-2.json +0 -711
- package/docs/benchmarks/2026-10-02-v1-poc-gc-profile.json +0 -885
- package/docs/benchmarks/2026-10-02-v1-poc-ordinary-1.json +0 -868
- package/docs/benchmarks/2026-10-02-v1-poc-ordinary-2.json +0 -868
- package/docs/licenses/castleCSF-MIT.txt +0 -21
- package/docs/validation/dense-pupil-2026-10-06/pilot.jsonl +0 -6
- package/docs/validation/documentation-fragments.json +0 -212
- package/docs/validation/native-capture-sdr-darwin-arm64-node26-review.jsonl +0 -4
- package/docs/validation/native-capture-sdr-darwin-arm64.jsonl +0 -3
- package/docs/validation/native-raw-print-2026-10-04/fractional-asymmetric-crop.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/gray-ramp.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/linear-area-checker.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/manifest.json +0 -218
- package/docs/validation/native-raw-print-2026-10-04/megapixel-native.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/native-color.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel-validation.json +0 -9
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json +0 -29
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.codes.u16le.gz +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.jpg +0 -0
- package/docs/validation/native-raw-print-2026-10-04/photivra-native-full-megapixel.json.rgb.gz +0 -0
- package/docs/validation/native-raw-print-2026-10-04/srgb.icc +0 -0
- package/docs/validation/native-raw-print-2026-10-04/validation.json +0 -41
- package/docs/validation/print-196-candidate-capabilities.json +0 -28
- package/docs/validation/print-196-candidate-evidence.json +0 -356
- package/docs/validation/print-196-engine-acceptance.json +0 -81
- package/docs/validation/print-detail-capabilities.json +0 -103
- package/docs/validation/print-detail-jpeg-evidence.json +0 -116
- package/docs/validation/print-detail-sdr-evidence.json +0 -81
- package/docs/validation/release-audit-inventory.json +0 -1306
- package/docs/validation/tier-acceptance-report-v1.json +0 -2538
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lens-psf-profile.js","sourceRoot":"","sources":["../../src/optics/lens-psf-profile.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AACvC,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,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,CAAC,MAAM,uCAAuC,GAClD,OAAgB,CAAC;AACnB,MAAM,CAAC,MAAM,0CAA0C,GACrD,OAAgB,CAAC;AAoOnB,MAAM,SAAS,GAAG;IAChB,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,UAAU;IACV,UAAU;IACV,cAAc;IACd,oCAAoC;CAC5B,CAAC;AAKX,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;A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AAK,CACb;QACH,eAAe,EACb,qBAAqB,CACnB,MAAM,CAAC,eAAe,EACtB,gCAAgC,CACjC;QACH,YAAY,EACV,UAAU;QACZ,OAAO;QACP,QAAQ,EACN,iBAAiB,CACf,MAAM,CAAC,QAAQ,EACf,yBAAyB,CAC1B;QACH,WAAW,EACT,gBAAgB,CACd,MAAM,CAAC,WAAW,EAClB,4BAA4B,CAC7B;KACJ,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAC0B;IAE1B,MAAM,MAAM,GACV,6BAA6B,CAC3B,OAAO,CACR,CAAC;IACJ,OAAO;QACL,SAAS,EACP,MAAM,CAAC,SAAS;QAClB,2BAA2B,EACzB,KAAK;QACP,MAAM,EACJ,+DAA+D;QACjE,uBAAuB,EACrB,IAAI;KACP,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"lens-psf-profile.js","sourceRoot":"","sources":["../../src/optics/lens-psf-profile.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EACL,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAI7I,MAAM,CAAC,MAAM,uCAAuC,GAClD,OAAgB,CAAC;AACnB,MAAM,CAAC,MAAM,0CAA0C,GACrD,OAAgB,CAAC;AAoCnB,MAAM,+BAA+B,GAA2C;IAC9E,k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AAqB,CACnB,MAAM,CAAC,SAAS,EAChB,0BAA0B,CAC3B;QACH,cAAc,EACZ,qBAAqB,CACnB,MAAM,CAAC,cAAc,EACrB,+BAA+B,CAChC;QACH,aAAa,EACX,gCAAgC;QAClC,yBAAyB,EACvB,KAAK;QACP,gBAAgB,EACd,oBAAoB;QACtB,YAAY,EAAE;YACZ,CAAC,EACC,aAAa,CACX,KAAK,CAAC,CAAC,EACP,+BAA+B,CAChC;YACH,CAAC,EACC,aAAa,CACX,KAAK,CAAC,CAAC,EACP,+BAA+B,CAChC;SACJ;QACD,aAAa,EACX,qBAAqB,CACnB,MAAM,CAAC,aAAa,EACpB,8BAA8B,CAC/B;QACH,KAAK,EACH,eAAe,CACb,MAAM,CAAC,KAAK,CACb;QACH,eAAe,EACb,qBAAqB,CACnB,MAAM,CAAC,eAAe,EACtB,gCAAgC,CACjC;QACH,YAAY,EACV,UAAU;QACZ,OAAO;QACP,QAAQ,EACN,iBAAiB,CACf,MAAM,CAAC,QAAQ,EACf,yBAAyB,CAC1B;QACH,WAAW,EACT,gBAAgB,CACd,MAAM,CAAC,WAAW,EAClB,4BAA4B,CAC7B;KACJ,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAC0B;IAE1B,MAAM,MAAM,GACV,6BAA6B,CAC3B,OAAO,CACR,CAAC;IACJ,OAAO;QACL,SAAS,EACP,MAAM,CAAC,SAAS;QAClB,2BAA2B,EACzB,KAAK;QACP,MAAM,EACJ,+DAA+D;QACjE,uBAAuB,EACrB,IAAI;KACP,CAAC;AACJ,CAAC","sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Sampled lens PSF (point-spread function) profiles, and MTF-only diagnostic profiles.\n *\n * The parsers validate untrusted input and return the normalized typed contract. Unknown enum\n * values, missing required fields and incompatible scientific data are rejected.\n *\n * The resolver finds the sampled PSF for a declared optical state and query point. It never\n * extrapolates and never invents missing dimensions.\n *\n * A sampled lens PSF is tied to an exact generic optical state and to declared ranges of field\n * position, wavelength and signed defocus. Interpolation stays inside those declared ranges. It keeps\n * the normalized shape separate from the throughput. MTF (modulation transfer function) data alone\n * has no phase or spatial information, so it cannot justify rendering one unique PSF.\n * @see docs/PSF_FOUNDATION.md for the equations, units, coordinate conventions, known blockers and\n * support limits.\n */\n\nimport {\n approximationResult,\n type CalculationResult\n} from \"../core/calculation-result.js\";\nimport { InvalidConfigurationError } from \"../core/configuration-error.js\";\nimport { freezeOwnedData } from \"../core/owned-data.js\";\nimport {\n parseEvidenceList,\n type EvidenceProvenance\n} from \"../core/evidence-provenance.js\";\nimport { InvalidScientificInputError } from \"../core/validation.js\";\nimport {\n parseFocusPlane,\n type FocusPlane\n} from \"./focus-state.js\";\nimport { requireInputKeys, rejectUnknownFields, rejectUnknownVariantFields, UNCERTAINTY_VARIANT_FIELDS } from \"../core/record-validation.js\";\n\ntype UnknownRecord = Record<string, unknown>;\n\nexport const LENS_SAMPLED_PSF_PROFILE_SCHEMA_VERSION =\n \"0.1.0\" as const;\nexport const LENS_MTF_DIAGNOSTIC_PROFILE_SCHEMA_VERSION =\n \"0.1.0\" as const;\n\nexport type LensPsfScientificStatus =\n | \"calibrated\"\n | \"approximation\";\n\nexport type LensPsfUncertainty =\n | {\n kind: \"relative\";\n fraction: number;\n basis: string;\n }\n | {\n kind: \"not-quantified\";\n limitation: string;\n };\n\n/**\n * Kernel interpolation between regular-grid nodes.\n * - `bounded-regular-grid-multilinear`: the legacy weighted sum of kernel values. Blending kernels\n * whose peaks sit at different positions gives several peaks.\n * - `bounded-regular-grid-centroid-aligned`: each node kernel is first shifted so its intensity\n * centroid sits at the weighted (interpolated) centroid. Then the same multilinear weights are\n * applied. Shifted or asymmetric PSFs therefore blend into one peak at the interpolated position.\n * - `rotationally-symmetric-radial-field-centroid-aligned`: for a rotationally symmetric lens. Nodes\n * are declared only along the +X field axis (fieldYmm = [0], fieldXmm >= 0). A query at field\n * (x, y) is interpolated, with centroid alignment, at radius hypot(x, y). The kernel is then\n * rotated by atan2(y, x) about its centre. The sample pitch must be square.\n * Shifts and rotations use bilinear resampling. This smooths the kernel slightly (by at most about\n * one sample). Samples outside the kernel are zero, and the result is renormalised to unit energy.\n */\nexport type LensSampledPsfInterpolation =\n | \"bounded-regular-grid-multilinear\"\n | \"bounded-regular-grid-centroid-aligned\"\n | \"rotationally-symmetric-radial-field-centroid-aligned\";\n\nconst LENS_SAMPLED_PSF_INTERPOLATIONS: readonly LensSampledPsfInterpolation[] = [\n \"bounded-regular-grid-multilinear\",\n \"bounded-regular-grid-centroid-aligned\",\n \"rotationally-symmetric-radial-field-centroid-aligned\"\n];\n\nexport interface LensPsfKernel {\n widthSamples: number;\n heightSamples: number;\n samplePitchMicrometersX: number;\n samplePitchMicrometersY: number;\n centerSampleX: number;\n centerSampleY: number;\n normalizedIntensity:\n readonly number[];\n}\n\nexport interface LensPsfGridAxes {\n focalLengthMm:\n readonly number[];\n focusDiopters:\n readonly number[];\n apertureFNumber:\n readonly number[];\n fieldXmm:\n readonly number[];\n fieldYmm:\n readonly number[];\n wavelengthNm:\n readonly number[];\n signedDefocusImagePlaneMicrometers:\n readonly number[];\n}\n\nexport interface LensSampledPsfGridCoordinate {\n focalLengthMm: number;\n focusDiopters: number;\n apertureFNumber: number;\n fieldXmm: number;\n fieldYmm: number;\n wavelengthNm: number;\n signedDefocusImagePlaneMicrometers:\n number;\n}\n\nexport interface LensSampledPsfGridNode {\n nodeId: string;\n coordinate:\n LensSampledPsfGridCoordinate;\n kernel: LensPsfKernel;\n bestFocusImagePlaneOffsetMicrometers:\n number;\n relativePupilThroughputFactor:\n number;\n evidence:\n readonly EvidenceProvenance[];\n uncertainty:\n LensPsfUncertainty;\n}\n\nexport interface LensSampledPsfProfile {\n schemaVersion:\n typeof LENS_SAMPLED_PSF_PROFILE_SCHEMA_VERSION;\n profileId: string;\n profileVersion: string;\n scientificStatus:\n LensPsfScientificStatus;\n opticalDomain:\n \"lens-primary-optical-path-only\";\n coordinateSystem:\n \"image-plane-metric\";\n fieldAxes:\n \"+X right, +Y up\";\n kernelEnergyNormalization:\n \"unit-energy-shape\";\n interpolation:\n LensSampledPsfInterpolation;\n throughputOwnership:\n \"separate-relative-pupil-throughput-factor\";\n responseIncludes: {\n diffraction: boolean;\n aberration: boolean;\n defocus: boolean;\n pupilClippingShape:\n boolean;\n };\n sensorOpticalStackIncluded:\n false;\n sensorSamplingIncluded:\n false;\n reconstructionIncluded:\n false;\n strayLightIncluded: false;\n axes: LensPsfGridAxes;\n nodes:\n readonly LensSampledPsfGridNode[];\n evidence:\n readonly EvidenceProvenance[];\n limitations: readonly string[];\n}\n\nexport interface ResolveLensSampledPsfInput {\n profile:\n LensSampledPsfProfile;\n focalLengthMm: number;\n focus: FocusPlane;\n apertureFNumber: number;\n fieldPointMm: {\n x: number;\n y: number;\n };\n wavelengthNm: number;\n signedDefocusImagePlaneMicrometers:\n number;\n}\n\nexport interface ResolvedLensSampledPsf {\n profileId: string;\n profileVersion: string;\n scientificStatus:\n LensPsfScientificStatus;\n resolutionStatus:\n | \"exact-grid-sample\"\n | \"interpolated\";\n coordinate:\n LensSampledPsfGridCoordinate;\n focus: FocusPlane;\n kernel: LensPsfKernel;\n bestFocusImagePlaneOffsetMicrometers:\n number;\n relativePupilThroughputFactor:\n number;\n sourceNodes:\n readonly {\n nodeId: string;\n weight: number;\n evidence:\n readonly EvidenceProvenance[];\n uncertainty:\n LensPsfUncertainty;\n }[];\n responseIncludes:\n LensSampledPsfProfile[\"responseIncludes\"];\n throughputOwnership:\n \"separate-relative-pupil-throughput-factor\";\n longitudinalChromaticFocusMayVaryWithWavelength:\n true;\n fieldCurvatureMayVaryWithFieldPosition:\n true;\n geometricDistortionModified:\n false;\n lateralChromaticPositionShiftApplied:\n false;\n sensorOpticalStackIncluded:\n false;\n sensorSamplingIncluded: false;\n reconstructionIncluded: false;\n strayLightIncluded: false;\n scalarSharpnessScoreProduced:\n false;\n}\n\nexport interface LensMtfDiagnosticSample {\n spatialFrequencyCyclesPerMm:\n number;\n sagittalMagnitude: number;\n tangentialMagnitude: number;\n}\n\nexport interface LensMtfDiagnosticProfile {\n schemaVersion:\n typeof LENS_MTF_DIAGNOSTIC_PROFILE_SCHEMA_VERSION;\n profileId: string;\n profileVersion: string;\n opticalDomain:\n \"lens-primary-optical-path-only\";\n phaseInformationAvailable:\n false;\n magnitudeMeaning:\n \"mtf-magnitude-only\";\n fieldPointMm: {\n x: number;\n y: number;\n };\n focalLengthMm: number;\n focus: FocusPlane;\n apertureFNumber: number;\n wavelengthNm: number | null;\n samples:\n readonly LensMtfDiagnosticSample[];\n evidence:\n readonly EvidenceProvenance[];\n limitations: readonly string[];\n}\n\nexport interface MtfOnlyPsfRenderabilityAssessment {\n profileId: string;\n psfReconstructionAuthorized:\n false;\n reason:\n \"mtf-magnitude-lacks-phase-and-does-not-uniquely-determine-psf\";\n diagnosticUseAuthorized: true;\n}\n\ninterface AxisBracket {\n lower: number;\n upper: number;\n /** Positions of lower and upper in the axis values. */\n lowerIndex: number;\n upperIndex: number;\n fraction: number;\n exact: boolean;\n}\n\ninterface WeightedNode {\n node:\n LensSampledPsfGridNode;\n weight: number;\n}\n\nconst AXIS_KEYS = [\n \"focalLengthMm\",\n \"focusDiopters\",\n \"apertureFNumber\",\n \"fieldXmm\",\n \"fieldYmm\",\n \"wavelengthNm\",\n \"signedDefocusImagePlaneMicrometers\"\n] as const;\n\ntype AxisKey =\n typeof AXIS_KEYS[number];\n\nfunction requireRecord(\n value: unknown,\n path: string,\n allowedKeys: readonly string[] | null\n): UnknownRecord {\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value)\n ) {\n throw new InvalidConfigurationError(\n path + \" must be an object.\"\n );\n }\n if (allowedKeys !== null) rejectUnknownFields(value, allowedKeys, path);\n return value as UnknownRecord;\n}\n\nfunction requireNonEmptyString(\n value: unknown,\n path: string\n): string {\n if (\n typeof value !== \"string\" ||\n value.trim().length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty string.\"\n );\n }\n return value.trim();\n}\n\nfunction requireFinite(\n value: unknown,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value)\n ) {\n throw new InvalidConfigurationError(\n path + \" must be finite.\"\n );\n }\n return value;\n}\n\nfunction requirePositiveFinite(\n value: unknown,\n path: string\n): number {\n const parsed =\n requireFinite(value, path);\n if (parsed <= 0) {\n throw new InvalidConfigurationError(\n path +\n \" must be greater than zero.\"\n );\n }\n return parsed;\n}\n\nfunction requireNonNegativeFinite(\n value: unknown,\n path: string\n): number {\n const parsed =\n requireFinite(value, path);\n if (parsed < 0) {\n throw new InvalidConfigurationError(\n path +\n \" must be greater than or equal to zero.\"\n );\n }\n return parsed;\n}\n\nfunction requireUnitInterval(\n value: unknown,\n path: string\n): number {\n const parsed =\n requireFinite(value, path);\n if (\n parsed < 0 ||\n parsed > 1\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must lie from zero through one.\"\n );\n }\n return parsed;\n}\n\nfunction requirePositiveSafeInteger(\n value: unknown,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isSafeInteger(value) ||\n value <= 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a positive safe integer.\"\n );\n }\n return value;\n}\n\nfunction requireNonNegativeSafeInteger(\n value: unknown,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isSafeInteger(value) ||\n value < 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-negative safe integer.\"\n );\n }\n return value;\n}\n\nfunction parseStatus(\n value: unknown,\n path: string\n): LensPsfScientificStatus {\n if (\n value !== \"calibrated\" &&\n value !== \"approximation\"\n ) {\n throw new InvalidConfigurationError(\n path + \" is invalid.\"\n );\n }\n return value;\n}\n\nfunction parseUncertainty(\n value: unknown,\n path: string\n): LensPsfUncertainty {\n const record =\n requireRecord(value, path, null);\n rejectUnknownVariantFields(record, \"kind\", UNCERTAINTY_VARIANT_FIELDS, path);\n if (record.kind === \"relative\") {\n return {\n kind: \"relative\",\n fraction:\n requireNonNegativeFinite(\n record.fraction,\n path + \".fraction\"\n ),\n basis:\n requireNonEmptyString(\n record.basis,\n path + \".basis\"\n )\n };\n }\n if (\n record.kind ===\n \"not-quantified\"\n ) {\n return {\n kind: \"not-quantified\",\n limitation:\n requireNonEmptyString(\n record.limitation,\n path +\n \".limitation\"\n )\n };\n }\n throw new InvalidConfigurationError(\n path + \".kind is invalid.\"\n );\n}\n\nfunction parseLimitations(\n value: unknown,\n path: string\n): readonly string[] {\n if (!Array.isArray(value)) {\n throw new InvalidConfigurationError(\n path + \" must be an array.\"\n );\n }\n const parsed =\n value.map(\n (entry, index) =>\n requireNonEmptyString(\n entry,\n path +\n \"[\" +\n index +\n \"]\"\n )\n );\n if (\n new Set(parsed).size !==\n parsed.length\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must not contain duplicates.\"\n );\n }\n return parsed;\n}\n\nfunction parseAxis(\n value: unknown,\n path: string,\n options: {\n positive?: boolean;\n nonNegative?: boolean;\n } = {}\n): readonly number[] {\n if (\n !Array.isArray(value) ||\n value.length === 0\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be a non-empty array.\"\n );\n }\n const parsed =\n value.map(\n (entry, index) => {\n const itemPath =\n path +\n \"[\" +\n index +\n \"]\";\n if (options.positive) {\n return requirePositiveFinite(\n entry,\n itemPath\n );\n }\n if (\n options.nonNegative\n ) {\n return requireNonNegativeFinite(\n entry,\n itemPath\n );\n }\n return requireFinite(\n entry,\n itemPath\n );\n }\n );\n for (\n let index = 1;\n index < parsed.length;\n index += 1\n ) {\n if (\n parsed[index]! <=\n parsed[index - 1]!\n ) {\n throw new InvalidConfigurationError(\n path +\n \" must be strictly increasing with unique values.\"\n );\n }\n }\n return parsed;\n}\n\nfunction parseKernel(\n value: unknown,\n path: string\n): LensPsfKernel {\n const record =\n requireRecord(value, path, [\"widthSamples\", \"heightSamples\", \"centerSampleX\", \"centerSampleY\", \"normalizedIntensity\", \"samplePitchMicrometersX\", \"samplePitchMicrometersY\"]);\n const widthSamples =\n requirePositiveSafeInteger(\n record.widthSamples,\n path + \".widthSamples\"\n );\n const heightSamples =\n requirePositiveSafeInteger(\n record.heightSamples,\n path + \".heightSamples\"\n );\n const total =\n widthSamples *\n heightSamples;\n if (!Number.isSafeInteger(total)) {\n throw new InvalidConfigurationError(\n path +\n \" sample count must remain a safe integer.\"\n );\n }\n const centerSampleX =\n requireNonNegativeSafeInteger(\n record.centerSampleX,\n path + \".centerSampleX\"\n );\n const centerSampleY =\n requireNonNegativeSafeInteger(\n record.centerSampleY,\n path + \".centerSampleY\"\n );\n if (\n centerSampleX >=\n widthSamples ||\n centerSampleY >=\n heightSamples\n ) {\n throw new InvalidConfigurationError(\n path +\n \" center sample must lie within the kernel grid.\"\n );\n }\n if (\n !Array.isArray(\n record.normalizedIntensity\n ) ||\n record\n .normalizedIntensity\n .length !== total\n ) {\n throw new InvalidConfigurationError(\n path +\n \".normalizedIntensity length must equal widthSamples × heightSamples.\"\n );\n }\n const normalizedIntensity =\n record\n .normalizedIntensity\n .map(\n (entry, index) =>\n requireNonNegativeFinite(\n entry,\n path +\n \".normalizedIntensity[\" +\n index +\n \"]\"\n )\n );\n const sum =\n normalizedIntensity.reduce(\n (acc, entry) =>\n acc + entry,\n 0\n );\n if (\n !Number.isFinite(sum) ||\n Math.abs(sum - 1) >\n 1e-10\n ) {\n throw new InvalidConfigurationError(\n path +\n \".normalizedIntensity must sum to one.\"\n );\n }\n\n return {\n widthSamples,\n heightSamples,\n samplePitchMicrometersX:\n requirePositiveFinite(\n record\n .samplePitchMicrometersX,\n path +\n \".samplePitchMicrometersX\"\n ),\n samplePitchMicrometersY:\n requirePositiveFinite(\n record\n .samplePitchMicrometersY,\n path +\n \".samplePitchMicrometersY\"\n ),\n centerSampleX,\n centerSampleY,\n normalizedIntensity\n };\n}\n\nfunction parseAxes(\n value: unknown\n): LensPsfGridAxes {\n const record =\n requireRecord(\n value,\n \"lensPsfProfile.axes\", [\"focalLengthMm\", \"focusDiopters\", \"apertureFNumber\", \"fieldXmm\", \"fieldYmm\", \"wavelengthNm\", \"signedDefocusImagePlaneMicrometers\"]\n );\n return {\n focalLengthMm:\n parseAxis(\n record.focalLengthMm,\n \"lensPsfProfile.axes.focalLengthMm\",\n {\n positive: true\n }\n ),\n focusDiopters:\n parseAxis(\n record.focusDiopters,\n \"lensPsfProfile.axes.focusDiopters\",\n {\n nonNegative: true\n }\n ),\n apertureFNumber:\n parseAxis(\n record.apertureFNumber,\n \"lensPsfProfile.axes.apertureFNumber\",\n {\n positive: true\n }\n ),\n fieldXmm:\n parseAxis(\n record.fieldXmm,\n \"lensPsfProfile.axes.fieldXmm\"\n ),\n fieldYmm:\n parseAxis(\n record.fieldYmm,\n \"lensPsfProfile.axes.fieldYmm\"\n ),\n wavelengthNm:\n parseAxis(\n record.wavelengthNm,\n \"lensPsfProfile.axes.wavelengthNm\",\n {\n positive: true\n }\n ),\n signedDefocusImagePlaneMicrometers:\n parseAxis(\n record\n .signedDefocusImagePlaneMicrometers,\n \"lensPsfProfile.axes.signedDefocusImagePlaneMicrometers\"\n )\n };\n}\n\nfunction parseCoordinate(\n value: unknown,\n path: string\n): LensSampledPsfGridCoordinate {\n const record =\n requireRecord(value, path, [\"focalLengthMm\", \"focusDiopters\", \"apertureFNumber\", \"fieldXmm\", \"fieldYmm\", \"wavelengthNm\", \"signedDefocusImagePlaneMicrometers\"]);\n return {\n focalLengthMm:\n requirePositiveFinite(\n record.focalLengthMm,\n path + \".focalLengthMm\"\n ),\n focusDiopters:\n requireNonNegativeFinite(\n record.focusDiopters,\n path + \".focusDiopters\"\n ),\n apertureFNumber:\n requirePositiveFinite(\n record.apertureFNumber,\n path +\n \".apertureFNumber\"\n ),\n fieldXmm:\n requireFinite(\n record.fieldXmm,\n path + \".fieldXmm\"\n ),\n fieldYmm:\n requireFinite(\n record.fieldYmm,\n path + \".fieldYmm\"\n ),\n wavelengthNm:\n requirePositiveFinite(\n record.wavelengthNm,\n path + \".wavelengthNm\"\n ),\n signedDefocusImagePlaneMicrometers:\n requireFinite(\n record\n .signedDefocusImagePlaneMicrometers,\n path +\n \".signedDefocusImagePlaneMicrometers\"\n )\n };\n}\n\nfunction coordinateKey(\n coordinate:\n LensSampledPsfGridCoordinate\n): string {\n return AXIS_KEYS.map(\n (key) =>\n coordinate[key]\n .toString()\n ).join(\"|\");\n}\n\nfunction axisContains(\n values:\n readonly number[],\n target: number\n): boolean {\n return values.some(\n (value) =>\n value === target\n );\n}\n\nfunction validateNodeCoordinate(\n axes: LensPsfGridAxes,\n coordinate:\n LensSampledPsfGridCoordinate,\n path: string\n): void {\n for (\n const key of AXIS_KEYS\n ) {\n if (\n !axisContains(\n axes[key],\n coordinate[key]\n )\n ) {\n throw new InvalidConfigurationError(\n path +\n \".\" +\n key +\n \" must exactly match one declared grid-axis value.\"\n );\n }\n }\n}\n\nfunction parseNode(\n value: unknown,\n index: number,\n axes: LensPsfGridAxes,\n status:\n LensPsfScientificStatus\n): LensSampledPsfGridNode {\n const path =\n \"lensPsfProfile.nodes[\" +\n index +\n \"]\";\n const record =\n requireRecord(value, path, [\"coordinate\", \"uncertainty\", \"nodeId\", \"kernel\", \"bestFocusImagePlaneOffsetMicrometers\", \"relativePupilThroughputFactor\", \"evidence\"]);\n const coordinate =\n parseCoordinate(\n record.coordinate,\n path + \".coordinate\"\n );\n validateNodeCoordinate(\n axes,\n coordinate,\n path + \".coordinate\"\n );\n const uncertainty =\n parseUncertainty(\n record.uncertainty,\n path + \".uncertainty\"\n );\n if (\n status === \"calibrated\" &&\n uncertainty.kind ===\n \"not-quantified\"\n ) {\n throw new InvalidConfigurationError(\n path +\n \" calibrated PSF data must declare quantified relative uncertainty.\"\n );\n }\n\n return {\n nodeId:\n requireNonEmptyString(\n record.nodeId,\n path + \".nodeId\"\n ),\n coordinate,\n kernel:\n parseKernel(\n record.kernel,\n path + \".kernel\"\n ),\n bestFocusImagePlaneOffsetMicrometers:\n requireFinite(\n record\n .bestFocusImagePlaneOffsetMicrometers,\n path +\n \".bestFocusImagePlaneOffsetMicrometers\"\n ),\n relativePupilThroughputFactor:\n requireUnitInterval(\n record\n .relativePupilThroughputFactor,\n path +\n \".relativePupilThroughputFactor\"\n ),\n evidence:\n parseEvidenceList(\n record.evidence,\n path + \".evidence\"\n ),\n uncertainty\n };\n}\n\nfunction expectedNodeCount(\n axes: LensPsfGridAxes\n): number {\n let count = 1;\n for (\n const key of AXIS_KEYS\n ) {\n count *= axes[key].length;\n if (\n !Number.isSafeInteger(count) ||\n count > 100_000\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile regular grid must contain at most 100000 nodes.\"\n );\n }\n }\n return count;\n}\n\nfunction sameKernelGeometry(\n first: LensPsfKernel,\n second: LensPsfKernel\n): boolean {\n return (\n first.widthSamples ===\n second.widthSamples &&\n first.heightSamples ===\n second.heightSamples &&\n first\n .samplePitchMicrometersX ===\n second\n .samplePitchMicrometersX &&\n first\n .samplePitchMicrometersY ===\n second\n .samplePitchMicrometersY &&\n first.centerSampleX ===\n second.centerSampleX &&\n first.centerSampleY ===\n second.centerSampleY\n );\n}\n\n/** Private profile declarations owned by the engine, registered by markEngineOwnedLensSampledPsfProfile. */\nconst ENGINE_OWNED_PROFILES = new WeakSet<object>();\n/** Deep-frozen parse of a deep-frozen engine-owned declaration. */\nconst PARSED_OWNED_PROFILES = new WeakMap<object, LensSampledPsfProfile>();\n/** Nodes by grid position (see buildGridNodeIndex). */\ninterface GridNodeIndex {\n readonly strides: readonly number[];\n readonly nodes: readonly (LensSampledPsfGridNode | undefined)[];\n}\n/** Grid node index of a cached, deep-frozen parse. */\nconst TRUSTED_NODE_INDEX = new WeakMap<LensSampledPsfProfile, GridNodeIndex>();\n\n/**\n * Internal: registers a private profile declaration owned by the engine, so that repeated\n * resolveLensSampledPsf calls reuse one parse. The declaration is a structured clone that caller code\n * never sees.\n *\n * The first resolve parses it exactly like untrusted input. It then deep-freezes the declaration and\n * caches the frozen parse with its node index. A frozen declaration cannot change, so the cached\n * parse stays exact. Caller objects that were never registered are always parsed again.\n */\nexport function markEngineOwnedLensSampledPsfProfile(value: unknown): void {\n if (typeof value === \"object\" && value !== null) ENGINE_OWNED_PROFILES.add(value);\n}\n\nfunction parseOwnedOrUntrustedProfile(value: unknown): LensSampledPsfProfile {\n if (typeof value !== \"object\" || value === null || !ENGINE_OWNED_PROFILES.has(value)) {\n return parseLensSampledPsfProfile(value);\n }\n const cached = PARSED_OWNED_PROFILES.get(value);\n if (cached !== undefined) return cached;\n const parsed = parseLensSampledPsfProfile(value);\n try {\n freezeOwnedData(value);\n } catch {\n // Not plain data that freezeOwnedData accepts (for example typed-array storage), so do not cache.\n ENGINE_OWNED_PROFILES.delete(value);\n return parsed;\n }\n freezeOwnedData(parsed);\n TRUSTED_NODE_INDEX.set(parsed, buildGridNodeIndex(parsed));\n PARSED_OWNED_PROFILES.set(value, parsed);\n return parsed;\n}\n\n/**\n * Validates an untrusted declaration and returns the normalized typed contract. Unknown enum values,\n * missing required fields and incompatible scientific data are rejected here.\n *\n * A sampled lens PSF is tied to an exact generic optical state and to declared ranges of field\n * position, wavelength and signed defocus. Interpolation stays inside those declared ranges. It keeps\n * the normalized shape separate from the throughput. MTF (modulation transfer function) data alone\n * has no phase or spatial information, so it cannot justify rendering one unique PSF.\n * @param value - unknown. Untrusted input; TypeScript types alone are not validation.\n * @returns LensSampledPsfProfile. The result states its shape and scientific status; a successful call does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the root export and exact type graph.\n */\nexport function parseLensSampledPsfProfile(\n value: unknown\n): LensSampledPsfProfile {\n const record =\n requireRecord(\n value,\n \"lensPsfProfile\", [\"schemaVersion\", \"opticalDomain\", \"coordinateSystem\", \"fieldAxes\", \"kernelEnergyNormalization\", \"interpolation\", \"throughputOwnership\", \"sensorOpticalStackIncluded\", \"sensorSamplingIncluded\", \"reconstructionIncluded\", \"strayLightIncluded\", \"scientificStatus\", \"responseIncludes\", \"axes\", \"nodes\", \"profileId\", \"profileVersion\", \"evidence\", \"limitations\"]\n );\n if (\n record.schemaVersion !==\n LENS_SAMPLED_PSF_PROFILE_SCHEMA_VERSION\n ) {\n throw new InvalidConfigurationError(\n 'lensPsfProfile.schemaVersion must be \"' +\n LENS_SAMPLED_PSF_PROFILE_SCHEMA_VERSION +\n '\".'\n );\n }\n if (\n record.opticalDomain !==\n \"lens-primary-optical-path-only\"\n ) {\n throw new InvalidConfigurationError(\n 'lensPsfProfile.opticalDomain must be \"lens-primary-optical-path-only\".'\n );\n }\n if (\n record.coordinateSystem !==\n \"image-plane-metric\" ||\n record.fieldAxes !==\n \"+X right, +Y up\"\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile image-plane coordinate semantics are invalid.\"\n );\n }\n if (\n record.kernelEnergyNormalization !==\n \"unit-energy-shape\" ||\n !(LENS_SAMPLED_PSF_INTERPOLATIONS as readonly unknown[]).includes(\n record.interpolation\n ) ||\n record.throughputOwnership !==\n \"separate-relative-pupil-throughput-factor\"\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile normalization/interpolation/throughput ownership is invalid.\"\n );\n }\n if (\n record.sensorOpticalStackIncluded !==\n false ||\n record.sensorSamplingIncluded !==\n false ||\n record.reconstructionIncluded !==\n false ||\n record.strayLightIncluded !==\n false\n ) {\n throw new InvalidConfigurationError(\n \"V1 lens PSF profiles must remain lens-primary-optical-path-only and exclude sensor/reconstruction/stray-light effects.\"\n );\n }\n\n const status =\n parseStatus(\n record.scientificStatus,\n \"lensPsfProfile.scientificStatus\"\n );\n const response =\n requireRecord(\n record.responseIncludes,\n \"lensPsfProfile.responseIncludes\", [\"diffraction\", \"aberration\", \"defocus\", \"pupilClippingShape\"]\n );\n for (\n const key of [\n \"diffraction\",\n \"aberration\",\n \"defocus\",\n \"pupilClippingShape\"\n ] as const\n ) {\n if (\n typeof response[key] !==\n \"boolean\"\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.responseIncludes.\" +\n key +\n \" must be boolean.\"\n );\n }\n }\n const axes =\n parseAxes(record.axes);\n if (\n !Array.isArray(\n record.nodes\n )\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.nodes must be an array.\"\n );\n }\n if (\n record.nodes.length !==\n expectedNodeCount(axes)\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.nodes must contain exactly one node for every regular-grid coordinate.\"\n );\n }\n const nodes =\n record.nodes.map(\n (node, index) =>\n parseNode(\n node,\n index,\n axes,\n status\n )\n );\n const ids =\n nodes.map(\n (node) =>\n node.nodeId\n );\n if (\n new Set(ids).size !==\n ids.length\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.nodes must not contain duplicate nodeId values.\"\n );\n }\n const coordinateKeys =\n nodes.map(\n (node) =>\n coordinateKey(\n node.coordinate\n )\n );\n if (\n new Set(coordinateKeys).size !==\n coordinateKeys.length\n ) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.nodes must not contain duplicate grid coordinates.\"\n );\n }\n\n const firstKernel =\n nodes[0]?.kernel;\n if (firstKernel === undefined) {\n throw new InvalidConfigurationError(\n \"lensPsfProfile.nodes must not be empty.\"\n );\n }\n for (\n const node of nodes\n ) {\n if (\n !sameKernelGeometry(\n firstKernel,\n node.kernel\n )\n ) {\n throw new InvalidConfigurationError(\n \"Every lensPsfProfile node must use identical PSF kernel grid geometry for multilinear interpolation.\"\n );\n }\n }\n\n if (\n record.interpolation ===\n \"rotationally-symmetric-radial-field-centroid-aligned\"\n ) {\n if (\n axes.fieldYmm.length !== 1 ||\n axes.fieldYmm[0] !== 0 ||\n axes.fieldXmm.some((value) => value < 0)\n ) {\n throw new InvalidConfigurationError(\n \"Rotationally symmetric PSF profiles must declare fieldYmm = [0] and non-negative fieldXmm radii.\"\n );\n }\n if (\n firstKernel.samplePitchMicrometersX !==\n firstKernel.samplePitchMicrometersY\n ) {\n throw new InvalidConfigurationError(\n \"Rotationally symmetric PSF profiles require square kernel sample pitch for rotation.\"\n );\n }\n }\n\n return {\n schemaVersion:\n LENS_SAMPLED_PSF_PROFILE_SCHEMA_VERSION,\n profileId:\n requireNonEmptyString(\n record.profileId,\n \"lensPsfProfile.profileId\"\n ),\n profileVersion:\n requireNonEmptyString(\n record.profileVersion,\n \"lensPsfProfile.profileVersion\"\n ),\n scientificStatus:\n status,\n opticalDomain:\n \"lens-primary-optical-path-only\",\n coordinateSystem:\n \"image-plane-metric\",\n fieldAxes:\n \"+X right, +Y up\",\n kernelEnergyNormalization:\n \"unit-energy-shape\",\n interpolation:\n record.interpolation as LensSampledPsfInterpolation,\n throughputOwnership:\n \"separate-relative-pupil-throughput-factor\",\n responseIncludes: {\n diffraction:\n response.diffraction as boolean,\n aberration:\n response.aberration as boolean,\n defocus:\n response.defocus as boolean,\n pupilClippingShape:\n response\n .pupilClippingShape as boolean\n },\n sensorOpticalStackIncluded:\n false,\n sensorSamplingIncluded:\n false,\n reconstructionIncluded:\n false,\n strayLightIncluded:\n false,\n axes,\n nodes,\n evidence:\n parseEvidenceList(\n record.evidence,\n \"lensPsfProfile.evidence\"\n ),\n limitations:\n parseLimitations(\n record.limitations,\n \"lensPsfProfile.limitations\"\n )\n };\n}\n\nfunction focusDiopters(\n focus: FocusPlane\n): number {\n const parsed =\n parseFocusPlane(focus);\n return parsed.kind ===\n \"infinity\"\n ? 0\n : 1 /\n parsed.distanceM;\n}\n\nfunction requireScientificFinite(\n value: number,\n path: string\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value)\n ) {\n throw new InvalidScientificInputError(\n path + \" must be finite.\"\n );\n }\n return value;\n}\n\nfunction requireScientificPositiveFinite(\n value: number,\n path: string\n): number {\n const parsed =\n requireScientificFinite(\n value,\n path\n );\n if (parsed <= 0) {\n throw new InvalidScientificInputError(\n path +\n \" must be greater than zero.\"\n );\n }\n return parsed;\n}\n\nfunction bracketAxis(\n values:\n readonly number[],\n target: number,\n path: string\n): AxisBracket {\n const minimum =\n values[0]!;\n const maximum =\n values[\n values.length - 1\n ]!;\n const scale =\n Math.max(\n 1,\n Math.abs(target),\n Math.abs(minimum),\n Math.abs(maximum)\n );\n const tolerance =\n Number.EPSILON *\n 64 *\n scale;\n if (\n target <\n minimum - tolerance ||\n target >\n maximum + tolerance\n ) {\n throw new InvalidScientificInputError(\n path +\n \" lies outside the declared PSF profile grid; extrapolation is not permitted.\"\n );\n }\n\n for (\n let index = 0;\n index < values.length;\n index += 1\n ) {\n const value = values[index]!;\n if (\n Math.abs(\n target - value\n ) <= tolerance\n ) {\n return {\n lower: value,\n upper: value,\n lowerIndex: index,\n upperIndex: index,\n fraction: 0,\n exact: true\n };\n }\n }\n\n for (\n let index = 0;\n index <\n values.length - 1;\n index += 1\n ) {\n const lower =\n values[index]!;\n const upper =\n values[index + 1]!;\n if (\n target > lower &&\n target < upper\n ) {\n return {\n lower,\n upper,\n lowerIndex: index,\n upperIndex: index + 1,\n fraction:\n (target - lower) /\n (upper - lower),\n exact: false\n };\n }\n }\n\n throw new InvalidScientificInputError(\n path +\n \" could not be bracketed inside the declared PSF profile grid.\"\n );\n}\n\nfunction queryCoordinate(\n input:\n ResolveLensSampledPsfInput\n): {\n coordinate:\n LensSampledPsfGridCoordinate;\n focus: FocusPlane;\n} {\n const focus =\n parseFocusPlane(\n input.focus\n );\n return {\n coordinate: {\n focalLengthMm:\n requireScientificPositiveFinite(\n input.focalLengthMm,\n \"focalLengthMm\"\n ),\n focusDiopters:\n focusDiopters(focus),\n apertureFNumber:\n requireScientificPositiveFinite(\n input.apertureFNumber,\n \"apertureFNumber\"\n ),\n fieldXmm:\n requireScientificFinite(\n input.fieldPointMm.x,\n \"fieldPointMm.x\"\n ),\n fieldYmm:\n requireScientificFinite(\n input.fieldPointMm.y,\n \"fieldPointMm.y\"\n ),\n wavelengthNm:\n requireScientificPositiveFinite(\n input.wavelengthNm,\n \"wavelengthNm\"\n ),\n signedDefocusImagePlaneMicrometers:\n requireScientificFinite(\n input\n .signedDefocusImagePlaneMicrometers,\n \"signedDefocusImagePlaneMicrometers\"\n )\n },\n focus\n };\n}\n\nfunction bracketCoordinate(\n axes: LensPsfGridAxes,\n coordinate:\n LensSampledPsfGridCoordinate\n): Record<AxisKey, AxisBracket> {\n return {\n focalLengthMm:\n bracketAxis(\n axes.focalLengthMm,\n coordinate.focalLengthMm,\n \"focalLengthMm\"\n ),\n focusDiopters:\n bracketAxis(\n axes.focusDiopters,\n coordinate.focusDiopters,\n \"focus\"\n ),\n apertureFNumber:\n bracketAxis(\n axes.apertureFNumber,\n coordinate.apertureFNumber,\n \"apertureFNumber\"\n ),\n fieldXmm:\n bracketAxis(\n axes.fieldXmm,\n coordinate.fieldXmm,\n \"fieldPointMm.x\"\n ),\n fieldYmm:\n bracketAxis(\n axes.fieldYmm,\n coordinate.fieldYmm,\n \"fieldPointMm.y\"\n ),\n wavelengthNm:\n bracketAxis(\n axes.wavelengthNm,\n coordinate.wavelengthNm,\n \"wavelengthNm\"\n ),\n signedDefocusImagePlaneMicrometers:\n bracketAxis(\n axes\n .signedDefocusImagePlaneMicrometers,\n coordinate\n .signedDefocusImagePlaneMicrometers,\n \"signedDefocusImagePlaneMicrometers\"\n )\n };\n}\n\n/** Flat-index strides of the regular grid over AXIS_KEYS (the last axis varies fastest). */\nfunction gridStrides(axes: LensPsfGridAxes): number[] {\n const strides = new Array<number>(AXIS_KEYS.length);\n let stride = 1;\n for (let a = AXIS_KEYS.length - 1; a >= 0; a -= 1) {\n strides[a] = stride;\n stride *= axes[AXIS_KEYS[a]!].length;\n }\n return strides;\n}\n\n/**\n * Nodes indexed by grid position. Node coordinates match declared axis values exactly (checked by the\n * parser, with `===`, so −0 and 0 are one position) and are unique, so each position holds at most one node.\n */\nfunction buildGridNodeIndex(profile: LensSampledPsfProfile): GridNodeIndex {\n const strides = gridStrides(profile.axes);\n const nodes = new Array<LensSampledPsfGridNode | undefined>(AXIS_KEYS.reduce((n, key) => n * profile.axes[key].length, 1));\n for (const node of profile.nodes) {\n let flat = 0;\n for (let a = 0; a < AXIS_KEYS.length; a += 1) {\n const key = AXIS_KEYS[a]!;\n flat += profile.axes[key].indexOf(node.coordinate[key]) * strides[a]!;\n }\n nodes[flat] = node;\n }\n return { strides, nodes };\n}\n\n/**\n * The multilinear corners of a bracketed query and their weights, in a fixed order: axes in AXIS_KEYS order,\n * lower before upper, zero-weight options skipped. Each weight is the product of its per-axis weights in that order.\n */\nfunction resolveWeightedNodes(\n profile:\n LensSampledPsfProfile,\n brackets:\n Record<\n AxisKey,\n AxisBracket\n >\n): readonly WeightedNode[] {\n const index = TRUSTED_NODE_INDEX.get(profile) ?? buildGridNodeIndex(profile);\n let flats = [0], weights = [1];\n for (let a = 0; a < AXIS_KEYS.length; a += 1) {\n const bracket = brackets[AXIS_KEYS[a]!], stride = index.strides[a]!;\n const nextFlats: number[] = [], nextWeights: number[] = [];\n for (let c = 0; c < flats.length; c += 1) {\n if (bracket.exact) {\n nextFlats.push(flats[c]! + bracket.lowerIndex * stride);\n nextWeights.push(weights[c]! * 1);\n continue;\n }\n const lowerWeight = 1 - bracket.fraction, upperWeight = bracket.fraction;\n if (lowerWeight !== 0) { nextFlats.push(flats[c]! + bracket.lowerIndex * stride); nextWeights.push(weights[c]! * lowerWeight); }\n if (upperWeight !== 0) { nextFlats.push(flats[c]! + bracket.upperIndex * stride); nextWeights.push(weights[c]! * upperWeight); }\n }\n flats = nextFlats;\n weights = nextWeights;\n }\n return flats.map((flat, c) => {\n const node = index.nodes[flat];\n if (node === undefined) {\n throw new InvalidScientificInputError(\n \"PSF profile grid is missing a required interpolation corner.\"\n );\n }\n return { node, weight: weights[c]! };\n });\n}\n\nfunction interpolateKernel(\n weighted:\n readonly WeightedNode[]\n): LensPsfKernel {\n const first =\n weighted[0]?.node.kernel;\n if (first === undefined) {\n throw new InvalidScientificInputError(\n \"PSF interpolation requires at least one source node.\"\n );\n }\n const values =\n new Array<number>(\n first\n .normalizedIntensity\n .length\n ).fill(0);\n\n for (\n const entry of weighted\n ) {\n for (\n let index = 0;\n index < values.length;\n index += 1\n ) {\n values[index]! +=\n entry.weight *\n entry.node.kernel\n .normalizedIntensity[index]!;\n }\n }\n\n const sum =\n values.reduce(\n (acc, value) =>\n acc + value,\n 0\n );\n if (\n !Number.isFinite(sum) ||\n sum <= 0\n ) {\n throw new InvalidScientificInputError(\n \"Interpolated PSF energy must remain finite and positive.\"\n );\n }\n const normalized =\n values.map(\n (value) =>\n value / sum\n );\n\n return {\n widthSamples:\n first.widthSamples,\n heightSamples:\n first.heightSamples,\n samplePitchMicrometersX:\n first\n .samplePitchMicrometersX,\n samplePitchMicrometersY:\n first\n .samplePitchMicrometersY,\n centerSampleX:\n first.centerSampleX,\n centerSampleY:\n first.centerSampleY,\n normalizedIntensity:\n normalized\n };\n}\n\nfunction kernelCentroid(\n kernel: LensPsfKernel\n): { x: number; y: number } {\n let sum = 0;\n let x = 0;\n let y = 0;\n for (let row = 0; row < kernel.heightSamples; row += 1) {\n for (let column = 0; column < kernel.widthSamples; column += 1) {\n const value = kernel.normalizedIntensity[row * kernel.widthSamples + column]!;\n sum += value;\n x += value * (column - kernel.centerSampleX);\n y += value * (row - kernel.centerSampleY);\n }\n }\n return { x: x / sum, y: y / sum };\n}\n\n/** Bilinear sample at fractional array coordinates; zero outside the kernel. */\nfunction bilinearSample(\n kernel: LensPsfKernel,\n column: number,\n row: number\n): number {\n const x0 = Math.floor(column);\n const y0 = Math.floor(row);\n const fx = column - x0;\n const fy = row - y0;\n const at = (x: number, y: number): number =>\n x < 0 || y < 0 || x >= kernel.widthSamples || y >= kernel.heightSamples\n ? 0\n : kernel.normalizedIntensity[y * kernel.widthSamples + x]!;\n const top = fx === 0 ? at(x0, y0) : (1 - fx) * at(x0, y0) + fx * at(x0 + 1, y0);\n if (fy === 0) {\n return top;\n }\n const bottom = fx === 0 ? at(x0, y0 + 1) : (1 - fx) * at(x0, y0 + 1) + fx * at(x0 + 1, y0 + 1);\n return (1 - fy) * top + fy * bottom;\n}\n\nfunction normalizedKernel(\n template: LensPsfKernel,\n values: readonly number[]\n): LensPsfKernel {\n const sum = values.reduce((acc, value) => acc + value, 0);\n if (!Number.isFinite(sum) || sum <= 0) {\n throw new InvalidScientificInputError(\n \"Interpolated PSF energy must remain finite and positive.\"\n );\n }\n return {\n widthSamples: template.widthSamples,\n heightSamples: template.heightSamples,\n samplePitchMicrometersX: template.samplePitchMicrometersX,\n samplePitchMicrometersY: template.samplePitchMicrometersY,\n centerSampleX: template.centerSampleX,\n centerSampleY: template.centerSampleY,\n normalizedIntensity: values.map((value) => value / sum)\n };\n}\n\n/**\n * Centroid-aligned interpolation. Each node kernel is shifted so its intensity centroid lands on the\n * weighted centroid. Then the multilinear weights are applied. A single exact node is returned\n * unchanged.\n */\nfunction interpolateKernelCentroidAligned(\n weighted: readonly WeightedNode[]\n): LensPsfKernel {\n const first = weighted[0]?.node.kernel;\n if (first === undefined) {\n throw new InvalidScientificInputError(\n \"PSF interpolation requires at least one source node.\"\n );\n }\n if (weighted.length === 1) {\n // An exact grid node is already a validated unit-energy kernel; return it bit-for-bit.\n return { ...first, normalizedIntensity: [...first.normalizedIntensity] };\n }\n const centroids = weighted.map((entry) => kernelCentroid(entry.node.kernel));\n const target = centroids.reduce(\n (acc, centroid, index) => ({\n x: acc.x + weighted[index]!.weight * centroid.x,\n y: acc.y + weighted[index]!.weight * centroid.y\n }),\n { x: 0, y: 0 }\n );\n const values = new Array<number>(first.normalizedIntensity.length).fill(0);\n weighted.forEach((entry, index) => {\n const dx = centroids[index]!.x - target.x;\n const dy = centroids[index]!.y - target.y;\n for (let row = 0; row < first.heightSamples; row += 1) {\n for (let column = 0; column < first.widthSamples; column += 1) {\n values[row * first.widthSamples + column]! +=\n entry.weight * bilinearSample(entry.node.kernel, column + dx, row + dy);\n }\n }\n });\n return normalizedKernel(first, values);\n}\n\n/** Rotates a kernel by angleRadians (counter-clockwise, +Y up) about its centre sample. */\nfunction rotateKernel(\n kernel: LensPsfKernel,\n angleRadians: number\n): LensPsfKernel {\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n const values: number[] = [];\n for (let row = 0; row < kernel.heightSamples; row += 1) {\n // Array rows increase downward; image +Y is up.\n const y = kernel.centerSampleY - row;\n for (let column = 0; column < kernel.widthSamples; column += 1) {\n const x = column - kernel.centerSampleX;\n // Inverse rotation: destination (x, y) samples source R(-angle) (x, y).\n const sourceX = cos * x + sin * y;\n const sourceY = -sin * x + cos * y;\n values.push(\n bilinearSample(\n kernel,\n kernel.centerSampleX + sourceX,\n kernel.centerSampleY - sourceY\n )\n );\n }\n }\n return normalizedKernel(kernel, values);\n}\n\nfunction weightedScalar(\n weighted:\n readonly WeightedNode[],\n select:\n (\n node:\n LensSampledPsfGridNode\n ) => number\n): number {\n return weighted.reduce(\n (sum, entry) =>\n sum +\n entry.weight *\n select(entry.node),\n 0\n );\n}\n\n/** The resolved PSF before its result envelope; resolveLensSampledPsf and the lean native executor share it. */\ninterface ResolvedLensSampledPsfCore {\n profile: LensSampledPsfProfile;\n query: ReturnType<typeof queryCoordinate>;\n rotational: boolean;\n exact: boolean;\n weighted: readonly WeightedNode[];\n kernel: LensPsfKernel;\n bestFocus: number;\n throughput: number;\n}\n\nfunction resolveLensSampledPsfCore(\n input:\n ResolveLensSampledPsfInput\n): ResolvedLensSampledPsfCore {\n requireInputKeys(input, \"resolveLensSampledPsf\", [\"profile\", \"focalLengthMm\", \"focus\", \"apertureFNumber\", \"fieldPointMm\", \"wavelengthNm\", \"signedDefocusImagePlaneMicrometers\"]);\n const profile =\n parseOwnedOrUntrustedProfile(\n input.profile\n );\n const query =\n queryCoordinate(input);\n const rotational =\n profile.interpolation ===\n \"rotationally-symmetric-radial-field-centroid-aligned\";\n const fieldRadiusMm = Math.hypot(\n query.coordinate.fieldXmm,\n query.coordinate.fieldYmm\n );\n const fieldAngleRadians = rotational\n ? Math.atan2(query.coordinate.fieldYmm, query.coordinate.fieldXmm)\n : 0;\n const brackets =\n bracketCoordinate(\n profile.axes,\n rotational\n ? { ...query.coordinate, fieldXmm: fieldRadiusMm, fieldYmm: 0 }\n : query.coordinate\n );\n const weighted =\n resolveWeightedNodes(\n profile,\n brackets\n );\n const exact =\n AXIS_KEYS.every(\n (key) =>\n brackets[key].exact\n ) && fieldAngleRadians === 0;\n const kernel =\n profile.interpolation === \"bounded-regular-grid-multilinear\"\n ? interpolateKernel(weighted)\n : fieldAngleRadians === 0\n ? interpolateKernelCentroidAligned(weighted)\n : rotateKernel(\n interpolateKernelCentroidAligned(weighted),\n fieldAngleRadians\n );\n const bestFocus =\n weightedScalar(\n weighted,\n (node) =>\n node\n .bestFocusImagePlaneOffsetMicrometers\n );\n // A multilinear blend is a convex combination, so it cannot exceed its largest node value. But its\n // floating-point weights can sum to a few ulps above 1. A result above 1 that lies within\n // 8·ε·(node count)·max of the largest node is that rounding error. It is clamped to the largest node\n // value (≤ 1, so the result is again a declared value). Results already within [0, 1] are unchanged.\n const blended =\n weightedScalar(\n weighted,\n (node) =>\n node\n .relativePupilThroughputFactor\n );\n const largestThroughput = Math.max(...weighted.map((entry) => entry.node.relativePupilThroughputFactor));\n const throughput =\n blended > 1 && largestThroughput <= 1 &&\n blended - largestThroughput <= 8 * Number.EPSILON * weighted.length * Math.max(1, largestThroughput)\n ? largestThroughput\n : blended;\n if (\n !Number.isFinite(\n bestFocus\n ) ||\n !Number.isFinite(\n throughput\n ) ||\n throughput < 0 ||\n throughput > 1\n ) {\n throw new InvalidScientificInputError(\n \"Interpolated PSF metadata must remain finite and physically bounded.\"\n );\n }\n\n return { profile, query, rotational, exact, weighted, kernel, bestFocus, throughput };\n}\n\n/**\n * Internal (2.0 performance): the kernel resolveLensSampledPsf returns for the same input, computed by\n * the same code without building the result envelope. Throws whenever resolveLensSampledPsf would throw\n * before its envelope. Not exported from the package.\n */\nexport function resolveLensSampledPsfKernel(\n input:\n ResolveLensSampledPsfInput\n): LensPsfKernel {\n return resolveLensSampledPsfCore(input).kernel;\n}\n\n/**\n * Resolves the sampled PSF for a declared optical state and query point. It never extrapolates and\n * never invents missing dimensions.\n *\n * A sampled lens PSF is tied to an exact generic optical state and to declared ranges of field\n * position, wavelength and signed defocus. Interpolation stays inside those declared ranges. It keeps\n * the normalized shape separate from the throughput. MTF (modulation transfer function) data alone\n * has no phase or spatial information, so it cannot justify rendering one unique PSF.\n * @param input - ResolveLensSampledPsfInput. See that type for coordinates, units and profile binding.\n * @returns CalculationResult<ResolvedLensSampledPsf>. The result states its shape and scientific status; a successful call does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the root export and exact type graph.\n */\nexport function resolveLensSampledPsf(\n input:\n ResolveLensSampledPsfInput\n): CalculationResult<ResolvedLensSampledPsf> {\n const { profile, query, rotational, exact, weighted, kernel, bestFocus, throughput } =\n resolveLensSampledPsfCore(input);\n return approximationResult(\n {\n profileId:\n profile.profileId,\n profileVersion:\n profile.profileVersion,\n scientificStatus:\n profile.scientificStatus,\n resolutionStatus:\n exact\n ? \"exact-grid-sample\"\n : \"interpolated\",\n coordinate:\n query.coordinate,\n focus:\n query.focus,\n kernel,\n bestFocusImagePlaneOffsetMicrometers:\n bestFocus,\n relativePupilThroughputFactor:\n throughput,\n sourceNodes:\n weighted.map(\n (entry) => ({\n nodeId:\n entry.node.nodeId,\n weight:\n entry.weight,\n evidence:\n entry.node.evidence,\n uncertainty:\n entry.node\n .uncertainty\n })\n ),\n responseIncludes: {\n ...profile\n .responseIncludes\n },\n throughputOwnership:\n \"separate-relative-pupil-throughput-factor\",\n longitudinalChromaticFocusMayVaryWithWavelength:\n true,\n fieldCurvatureMayVaryWithFieldPosition:\n true,\n geometricDistortionModified:\n false,\n lateralChromaticPositionShiftApplied:\n false,\n sensorOpticalStackIncluded:\n false,\n sensorSamplingIncluded:\n false,\n reconstructionIncluded:\n false,\n strayLightIncluded:\n false,\n scalarSharpnessScoreProduced:\n false\n },\n profile.interpolation === \"bounded-regular-grid-multilinear\"\n ? \"lens-sampled-psf-bounded-interpolation\"\n : rotational\n ? \"lens-sampled-psf-rotational-centroid-aligned-interpolation\"\n : \"lens-sampled-psf-centroid-aligned-interpolation\",\n \"1.0.0\",\n [\n ...(profile.interpolation === \"bounded-regular-grid-multilinear\"\n ? []\n : [\n \"Node kernels are translated to the weighted intensity centroid before blending (bilinear resampling, outside samples zero, renormalised), so shifted PSFs blend into one peak.\",\n ...(rotational\n ? [\"Rotationally symmetric lens: nodes along +X are interpolated at the field radius and the kernel is rotated by the field azimuth.\"]\n : [])\n ]),\n \"PSF intensity is a unit-energy shape; relative pupil throughput remains a separate factor for the optical-throughput path.\",\n \"Regular-grid interpolation is bounded and never extrapolates beyond declared focal-length, focus, aperture, field, wavelength or signed-defocus axes.\",\n \"Full 2D image-plane kernel orientation is preserved in +X right, +Y up coordinates; no radial or sagittal/tangential averaging is forced.\",\n \"bestFocusImagePlaneOffsetMicrometers may vary with field and wavelength, representing field-curvature and longitudinal-chromatic-focus behavior without changing geometric distortion or lateral chromatic position.\",\n \"Lens PSF remains upstream of sensor optical stack, sampling and reconstruction, and excludes stray-light/ghosting contributions.\",\n \"No scalar lens-quality, sharpness or bokeh-quality score is produced.\"\n ]\n );\n}\n\n/**\n * Validates an untrusted declaration and returns the normalized typed contract. Unknown enum values,\n * missing required fields and incompatible scientific data are rejected here.\n *\n * A sampled lens PSF is tied to an exact generic optical state and to declared ranges of field\n * position, wavelength and signed defocus. Interpolation stays inside those declared ranges. It keeps\n * the normalized shape separate from the throughput. MTF (modulation transfer function) data alone\n * has no phase or spatial information, so it cannot justify rendering one unique PSF.\n * @param value - unknown. Untrusted input; TypeScript types alone are not validation.\n * @returns LensMtfDiagnosticProfile. The result states its shape and scientific status; a successful call does not imply calibration.\n *\n * @see docs/API_REFERENCE.md for the root export and exact type graph.\n */\nexport function parseLensMtfDiagnosticProfile(\n value: unknown\n): LensMtfDiagnosticProfile {\n const record =\n requireRecord(\n value,\n \"lensMtfProfile\", [\"schemaVersion\", \"opticalDomain\", \"phaseInformationAvailable\", \"magnitudeMeaning\", \"samples\", \"fieldPointMm\", \"wavelengthNm\", \"profileId\", \"profileVersion\", \"focalLengthMm\", \"focus\", \"apertureFNumber\", \"evidence\", \"limitations\"]\n );\n if (\n record.schemaVersion !==\n LENS_MTF_DIAGNOSTIC_PROFILE_SCHEMA_VERSION\n ) {\n throw new InvalidConfigurationError(\n 'lensMtfProfile.schemaVersion must be \"' +\n LENS_MTF_DIAGNOSTIC_PROFILE_SCHEMA_VERSION +\n '\".'\n );\n }\n if (\n record.opticalDomain !==\n \"lens-primary-optical-path-only\" ||\n record.phaseInformationAvailable !==\n false ||\n record.magnitudeMeaning !==\n \"mtf-magnitude-only\"\n ) {\n throw new InvalidConfigurationError(\n \"lensMtfProfile optical/phase semantics are invalid.\"\n );\n }\n if (\n !Array.isArray(\n record.samples\n ) ||\n record.samples.length ===\n 0\n ) {\n throw new InvalidConfigurationError(\n \"lensMtfProfile.samples must be a non-empty array.\"\n );\n }\n let priorFrequency =\n -1;\n const samples =\n record.samples.map(\n (entry, index) => {\n const path =\n \"lensMtfProfile.samples[\" +\n index +\n \"]\";\n const sample =\n requireRecord(\n entry,\n path, [\"spatialFrequencyCyclesPerMm\", \"sagittalMagnitude\", \"tangentialMagnitude\"]\n );\n const frequency =\n requireNonNegativeFinite(\n sample\n .spatialFrequencyCyclesPerMm,\n path +\n \".spatialFrequencyCyclesPerMm\"\n );\n if (\n frequency <=\n priorFrequency\n ) {\n throw new InvalidConfigurationError(\n \"lensMtfProfile sample frequencies must be strictly increasing.\"\n );\n }\n priorFrequency =\n frequency;\n return {\n spatialFrequencyCyclesPerMm:\n frequency,\n sagittalMagnitude:\n requireUnitInterval(\n sample\n .sagittalMagnitude,\n path +\n \".sagittalMagnitude\"\n ),\n tangentialMagnitude:\n requireUnitInterval(\n sample\n .tangentialMagnitude,\n path +\n \".tangentialMagnitude\"\n )\n };\n }\n );\n const field =\n requireRecord(\n record.fieldPointMm,\n \"lensMtfProfile.fieldPointMm\", [\"x\", \"y\"]\n );\n const wavelength =\n record.wavelengthNm ===\n null\n ? null\n : requirePositiveFinite(\n record.wavelengthNm,\n \"lensMtfProfile.wavelengthNm\"\n );\n\n return {\n schemaVersion:\n LENS_MTF_DIAGNOSTIC_PROFILE_SCHEMA_VERSION,\n profileId:\n requireNonEmptyString(\n record.profileId,\n \"lensMtfProfile.profileId\"\n ),\n profileVersion:\n requireNonEmptyString(\n record.profileVersion,\n \"lensMtfProfile.profileVersion\"\n ),\n opticalDomain:\n \"lens-primary-optical-path-only\",\n phaseInformationAvailable:\n false,\n magnitudeMeaning:\n \"mtf-magnitude-only\",\n fieldPointMm: {\n x:\n requireFinite(\n field.x,\n \"lensMtfProfile.fieldPointMm.x\"\n ),\n y:\n requireFinite(\n field.y,\n \"lensMtfProfile.fieldPointMm.y\"\n )\n },\n focalLengthMm:\n requirePositiveFinite(\n record.focalLengthMm,\n \"lensMtfProfile.focalLengthMm\"\n ),\n focus:\n parseFocusPlane(\n record.focus\n ),\n apertureFNumber:\n requirePositiveFinite(\n record.apertureFNumber,\n \"lensMtfProfile.apertureFNumber\"\n ),\n wavelengthNm:\n wavelength,\n samples,\n evidence:\n parseEvidenceList(\n record.evidence,\n \"lensMtfProfile.evidence\"\n ),\n limitations:\n parseLimitations(\n record.limitations,\n \"lensMtfProfile.limitations\"\n )\n };\n}\n\n/**\n * Explains why MTF-only evidence cannot determine one unique renderable PSF. Returns blockers instead\n * of making up phase information.\n *\n * A sampled lens PSF is tied to an exact generic optical state and to declared ranges of field\n * position, wavelength and signed defocus. Interpolation stays inside those declared ranges. It keeps\n * the normalized shape separate from the throughput. MTF (modulation transfer function) data alone\n * has no phase or spatial information, so it cannot justify rendering one unique PSF.\n * @param profile - LensMtfDiagnosticProfile. See that type for coordinates, units and profile binding.\n * @returns MtfOnlyPsfRenderabilityAssessment. Read the structured blockers before relying on any authorization.\n *\n * @see docs/API_REFERENCE.md for the root export and exact type graph.\n */\nexport function assessMtfOnlyPsfRenderability(\n profile:\n LensMtfDiagnosticProfile\n): MtfOnlyPsfRenderabilityAssessment {\n const parsed =\n parseLensMtfDiagnosticProfile(\n profile\n );\n return {\n profileId:\n parsed.profileId,\n psfReconstructionAuthorized:\n false,\n reason:\n \"mtf-magnitude-lacks-phase-and-does-not-uniquely-determine-psf\",\n diagnosticUseAuthorized:\n true\n };\n}\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Longitudinal (axial) chromatic aberration: wavelength-dependent focal length and the resulting
|
|
3
|
+
* per-wavelength image-plane defocus for a sensor focused at a reference wavelength.
|
|
4
|
+
*
|
|
5
|
+
* Two dispersion inputs:
|
|
6
|
+
* - thin-singlet-abbe: an ideal thin singlet whose index follows a two-term Cauchy dispersion
|
|
7
|
+
* n(lambda) = A + B / lambda^2 fitted to n_d and the Abbe number V_d = (n_d - 1) / (n_F - n_C)
|
|
8
|
+
* (Cauchy 1836; Oh 2023, arXiv:2309.09375, sec. 2.3.1(b), free; Abbe number: Greivenkamp,
|
|
9
|
+
* OPTI-502 course notes, University of Arizona, sec. 17, free. Also see: Born & Wolf, Principles
|
|
10
|
+
* of Optics, sec. 2.3; Hecht, Optics, 5th ed., sec. 3.5 and 6.3). Lensmaker scaling gives
|
|
11
|
+
* f(lambda) = f_ref (n_ref - 1) / (n(lambda) - 1), so f_C - f_F ~ f_d / V_d (Greivenkamp,
|
|
12
|
+
* OPTI-502 course notes, sec. 20, free. Also see: Hecht sec. 6.3.2; Kingslake & Johnson, Lens
|
|
13
|
+
* Design Fundamentals, 2nd ed., ch. 5). The Fraunhofer d, F and C wavelengths (587.5618, 486.1327, 656.2725 nm) are standard
|
|
14
|
+
* spectral-line constants (SCHOTT Technical Information TIE-29, 2023, free; also specified in
|
|
15
|
+
* ISO 7944). A real multi-element lens is not a singlet, so this is an educational
|
|
16
|
+
* approximation.
|
|
17
|
+
* - declared-focal-shift: a caller-supplied table of focal-length shift versus wavelength
|
|
18
|
+
* (for example a corrected lens's secondary spectrum), interpolated linearly without extrapolation.
|
|
19
|
+
*
|
|
20
|
+
* How defocus is computed:
|
|
21
|
+
* - The sensor sits at the Gaussian thin-lens image distance for focusDistanceM at the reference
|
|
22
|
+
* wavelength.
|
|
23
|
+
* - At each wavelength, the image distance of subjectDistanceM uses f(lambda).
|
|
24
|
+
* - The signed image-plane defocus dz is the sensor distance minus that image distance.
|
|
25
|
+
* - The geometric blur diameter is D |dz| / v(lambda), where D = f_ref / N is the entrance-pupil
|
|
26
|
+
* diameter. This is the same thin-lens form as calculateDefocusCircle().
|
|
27
|
+
* The defocus also feeds calculateDefocusWavefront(), so a complex-pupil PSF (point-spread function)
|
|
28
|
+
* can be evaluated per wavelength.
|
|
29
|
+
* @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers
|
|
30
|
+
* and support limits.
|
|
31
|
+
*/
|
|
32
|
+
import { type CalculationResult } from "../core/calculation-result.js";
|
|
33
|
+
/** Fraunhofer spectral-line wavelengths in nm (SCHOTT TIE-29 table; also ISO 7944 reference wavelengths). */
|
|
34
|
+
export declare const FRAUNHOFER_D_LINE_NM = 587.5618;
|
|
35
|
+
export declare const FRAUNHOFER_F_LINE_NM = 486.1327;
|
|
36
|
+
export declare const FRAUNHOFER_C_LINE_NM = 656.2725;
|
|
37
|
+
export type LongitudinalChromaticDispersion = {
|
|
38
|
+
kind: "thin-singlet-abbe";
|
|
39
|
+
/** Refractive index at the d line. */
|
|
40
|
+
refractiveIndexD: number;
|
|
41
|
+
/** Abbe number V_d = (n_d - 1) / (n_F - n_C). */
|
|
42
|
+
abbeNumberD: number;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "declared-focal-shift";
|
|
45
|
+
/** Strictly increasing wavelengths; shift is f(lambda) - f_nominal in micrometres. */
|
|
46
|
+
samples: readonly {
|
|
47
|
+
wavelengthNm: number;
|
|
48
|
+
focalLengthShiftMicrometers: number;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
export interface CalculateLongitudinalChromaticFocusInput {
|
|
52
|
+
/** Focal length at the reference wavelength, in mm. */
|
|
53
|
+
focalLengthMm: number;
|
|
54
|
+
/** Wavelength at which the sensor is focused, in nm. */
|
|
55
|
+
referenceWavelengthNm: number;
|
|
56
|
+
/** Wavelength to evaluate, in nm (same wavelength basis as the dispersion data). */
|
|
57
|
+
wavelengthNm: number;
|
|
58
|
+
/** Nominal f-number at the reference wavelength (entrance-pupil diameter = f / N). */
|
|
59
|
+
apertureFNumber: number;
|
|
60
|
+
/** Focus (object) distance at the reference wavelength, metres from the principal plane. */
|
|
61
|
+
focusDistanceM: number;
|
|
62
|
+
/** Subject distance in metres; defaults to focusDistanceM. */
|
|
63
|
+
subjectDistanceM?: number;
|
|
64
|
+
dispersion: LongitudinalChromaticDispersion;
|
|
65
|
+
}
|
|
66
|
+
export interface LongitudinalChromaticFocus {
|
|
67
|
+
wavelengthNm: number;
|
|
68
|
+
referenceWavelengthNm: number;
|
|
69
|
+
focalLengthAtWavelengthMm: number;
|
|
70
|
+
/** f(lambda) - f(reference), micrometres. */
|
|
71
|
+
focalShiftMicrometers: number;
|
|
72
|
+
/** Sensor plane distance (reference-wavelength image of the focus plane), mm. */
|
|
73
|
+
sensorImageDistanceMm: number;
|
|
74
|
+
/** Image distance of the subject at this wavelength, mm. */
|
|
75
|
+
imageDistanceAtWavelengthMm: number;
|
|
76
|
+
/** Sensor minus image distance, micrometres. */
|
|
77
|
+
signedDefocusImagePlaneMicrometers: number;
|
|
78
|
+
/** Geometric thin-lens blur-circle diameter at the sensor, mm. */
|
|
79
|
+
geometricBlurDiameterMm: number;
|
|
80
|
+
/** Image-side working f-number v(lambda) / D. */
|
|
81
|
+
workingFNumberAtWavelength: number;
|
|
82
|
+
/** Defocus wave aberration W020 for the complex-pupil PSF, micrometres. */
|
|
83
|
+
w020Micrometers: number;
|
|
84
|
+
/** Equivalent Noll Z4 coefficient, micrometres. */
|
|
85
|
+
zernikeZ4Micrometers: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Two-term Cauchy refractive index fitted to n_d and V_d. Valid as an approximation over
|
|
89
|
+
* 360-830 nm only.
|
|
90
|
+
*/
|
|
91
|
+
export declare function calculateCauchyRefractiveIndex(input: {
|
|
92
|
+
refractiveIndexD: number;
|
|
93
|
+
abbeNumberD: number;
|
|
94
|
+
wavelengthNm: number;
|
|
95
|
+
}): CalculationResult<{
|
|
96
|
+
refractiveIndex: number;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Wavelength-dependent focus for one wavelength: focal length, image distance, signed defocus at
|
|
100
|
+
* a sensor focused at the reference wavelength, geometric blur and the defocus wavefront.
|
|
101
|
+
*/
|
|
102
|
+
export declare function calculateLongitudinalChromaticFocus(input: CalculateLongitudinalChromaticFocusInput): CalculationResult<LongitudinalChromaticFocus>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Longitudinal (axial) chromatic aberration: wavelength-dependent focal length and the resulting
|
|
4
|
+
* per-wavelength image-plane defocus for a sensor focused at a reference wavelength.
|
|
5
|
+
*
|
|
6
|
+
* Two dispersion inputs:
|
|
7
|
+
* - thin-singlet-abbe: an ideal thin singlet whose index follows a two-term Cauchy dispersion
|
|
8
|
+
* n(lambda) = A + B / lambda^2 fitted to n_d and the Abbe number V_d = (n_d - 1) / (n_F - n_C)
|
|
9
|
+
* (Cauchy 1836; Oh 2023, arXiv:2309.09375, sec. 2.3.1(b), free; Abbe number: Greivenkamp,
|
|
10
|
+
* OPTI-502 course notes, University of Arizona, sec. 17, free. Also see: Born & Wolf, Principles
|
|
11
|
+
* of Optics, sec. 2.3; Hecht, Optics, 5th ed., sec. 3.5 and 6.3). Lensmaker scaling gives
|
|
12
|
+
* f(lambda) = f_ref (n_ref - 1) / (n(lambda) - 1), so f_C - f_F ~ f_d / V_d (Greivenkamp,
|
|
13
|
+
* OPTI-502 course notes, sec. 20, free. Also see: Hecht sec. 6.3.2; Kingslake & Johnson, Lens
|
|
14
|
+
* Design Fundamentals, 2nd ed., ch. 5). The Fraunhofer d, F and C wavelengths (587.5618, 486.1327, 656.2725 nm) are standard
|
|
15
|
+
* spectral-line constants (SCHOTT Technical Information TIE-29, 2023, free; also specified in
|
|
16
|
+
* ISO 7944). A real multi-element lens is not a singlet, so this is an educational
|
|
17
|
+
* approximation.
|
|
18
|
+
* - declared-focal-shift: a caller-supplied table of focal-length shift versus wavelength
|
|
19
|
+
* (for example a corrected lens's secondary spectrum), interpolated linearly without extrapolation.
|
|
20
|
+
*
|
|
21
|
+
* How defocus is computed:
|
|
22
|
+
* - The sensor sits at the Gaussian thin-lens image distance for focusDistanceM at the reference
|
|
23
|
+
* wavelength.
|
|
24
|
+
* - At each wavelength, the image distance of subjectDistanceM uses f(lambda).
|
|
25
|
+
* - The signed image-plane defocus dz is the sensor distance minus that image distance.
|
|
26
|
+
* - The geometric blur diameter is D |dz| / v(lambda), where D = f_ref / N is the entrance-pupil
|
|
27
|
+
* diameter. This is the same thin-lens form as calculateDefocusCircle().
|
|
28
|
+
* The defocus also feeds calculateDefocusWavefront(), so a complex-pupil PSF (point-spread function)
|
|
29
|
+
* can be evaluated per wavelength.
|
|
30
|
+
* @see docs/PHYSICS_FOUNDATION.md for the equations, units, coordinate conventions, known blockers
|
|
31
|
+
* and support limits.
|
|
32
|
+
*/
|
|
33
|
+
import { approximationResult } from "../core/calculation-result.js";
|
|
34
|
+
import { InvalidScientificInputError, requirePositiveFinite } from "../core/validation.js";
|
|
35
|
+
import { calculateDefocusWavefront } from "./zernike-wavefront.js";
|
|
36
|
+
import { requireInputKeys } from "../core/record-validation.js";
|
|
37
|
+
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
38
|
+
/** Fraunhofer spectral-line wavelengths in nm (SCHOTT TIE-29 table; also ISO 7944 reference wavelengths). */
|
|
39
|
+
export const FRAUNHOFER_D_LINE_NM = 587.5618;
|
|
40
|
+
export const FRAUNHOFER_F_LINE_NM = 486.1327;
|
|
41
|
+
export const FRAUNHOFER_C_LINE_NM = 656.2725;
|
|
42
|
+
const CAUCHY_MINIMUM_WAVELENGTH_NM = 360;
|
|
43
|
+
const CAUCHY_MAXIMUM_WAVELENGTH_NM = 830;
|
|
44
|
+
function requireFinite(name, value) {
|
|
45
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
46
|
+
throw new InvalidScientificInputError(`${name} must be finite.`);
|
|
47
|
+
}
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
function cauchyIndex(refractiveIndexD, abbeNumberD, wavelengthNm) {
|
|
51
|
+
const inverseSquare = (nm) => 1 / (nm / 1000) ** 2;
|
|
52
|
+
const b = (refractiveIndexD - 1) /
|
|
53
|
+
abbeNumberD /
|
|
54
|
+
(inverseSquare(FRAUNHOFER_F_LINE_NM) - inverseSquare(FRAUNHOFER_C_LINE_NM));
|
|
55
|
+
return (refractiveIndexD +
|
|
56
|
+
b * (inverseSquare(wavelengthNm) - inverseSquare(FRAUNHOFER_D_LINE_NM)));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Two-term Cauchy refractive index fitted to n_d and V_d. Valid as an approximation over
|
|
60
|
+
* 360-830 nm only.
|
|
61
|
+
*/
|
|
62
|
+
export function calculateCauchyRefractiveIndex(input) {
|
|
63
|
+
requireInputKeys(input, "calculateCauchyRefractiveIndex", ["refractiveIndexD", "abbeNumberD", "wavelengthNm"]);
|
|
64
|
+
validateAbbe(input.refractiveIndexD, input.abbeNumberD);
|
|
65
|
+
validateCauchyWavelength("wavelengthNm", input.wavelengthNm);
|
|
66
|
+
return approximationResult({
|
|
67
|
+
refractiveIndex: cauchyIndex(input.refractiveIndexD, input.abbeNumberD, input.wavelengthNm)
|
|
68
|
+
}, "two-term-cauchy-abbe-dispersion", "1.0.0", [
|
|
69
|
+
"n(lambda) = A + B / lambda^2 fitted exactly to n_d and V_d = (n_d - 1) / (n_F - n_C)",
|
|
70
|
+
"Two-term Cauchy dispersion is an approximation for normal dispersion in the visible (360-830 nm)"
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
function validateAbbe(refractiveIndexD, abbeNumberD) {
|
|
74
|
+
const n = requireFinite("dispersion.refractiveIndexD", refractiveIndexD);
|
|
75
|
+
const v = requireFinite("dispersion.abbeNumberD", abbeNumberD);
|
|
76
|
+
if (n <= 1 || n > 4) {
|
|
77
|
+
throw new InvalidScientificInputError("dispersion.refractiveIndexD must lie in (1, 4].");
|
|
78
|
+
}
|
|
79
|
+
if (v < 5 || v > 200) {
|
|
80
|
+
throw new InvalidScientificInputError("dispersion.abbeNumberD must lie in [5, 200].");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function validateCauchyWavelength(name, value) {
|
|
84
|
+
const wavelength = requireFinite(name, value);
|
|
85
|
+
if (wavelength < CAUCHY_MINIMUM_WAVELENGTH_NM ||
|
|
86
|
+
wavelength > CAUCHY_MAXIMUM_WAVELENGTH_NM) {
|
|
87
|
+
throw new InvalidScientificInputError(`${name} must lie in ${CAUCHY_MINIMUM_WAVELENGTH_NM}-${CAUCHY_MAXIMUM_WAVELENGTH_NM} nm for the Cauchy dispersion approximation.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function interpolateShift(samples, wavelengthNm, name) {
|
|
91
|
+
const first = samples[0];
|
|
92
|
+
const last = samples[samples.length - 1];
|
|
93
|
+
if (wavelengthNm < first.wavelengthNm || wavelengthNm > last.wavelengthNm) {
|
|
94
|
+
throw new InvalidScientificInputError(`${name} lies outside the declared focal-shift wavelength range; extrapolation is not performed.`);
|
|
95
|
+
}
|
|
96
|
+
for (let index = 1; index < samples.length; index += 1) {
|
|
97
|
+
const right = samples[index];
|
|
98
|
+
if (wavelengthNm <= right.wavelengthNm) {
|
|
99
|
+
const left = samples[index - 1];
|
|
100
|
+
const t = (wavelengthNm - left.wavelengthNm) / (right.wavelengthNm - left.wavelengthNm);
|
|
101
|
+
return (left.focalLengthShiftMicrometers +
|
|
102
|
+
t * (right.focalLengthShiftMicrometers - left.focalLengthShiftMicrometers));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return first.focalLengthShiftMicrometers;
|
|
106
|
+
}
|
|
107
|
+
function parseSamples(value) {
|
|
108
|
+
if (!Array.isArray(value) || value.length < 2 || value.length > 1024) {
|
|
109
|
+
throw new InvalidScientificInputError("dispersion.samples must contain 2 through 1024 entries.");
|
|
110
|
+
}
|
|
111
|
+
let previous = 0;
|
|
112
|
+
return value.map((entry, index) => {
|
|
113
|
+
if (typeof entry !== "object" || entry === null) {
|
|
114
|
+
throw new InvalidConfigurationError(`dispersion.samples[${index}] must be an object.`);
|
|
115
|
+
}
|
|
116
|
+
const record = entry;
|
|
117
|
+
const wavelengthNm = requireFinite(`dispersion.samples[${index}].wavelengthNm`, record.wavelengthNm);
|
|
118
|
+
if (wavelengthNm <= previous) {
|
|
119
|
+
throw new InvalidScientificInputError("dispersion.samples wavelengths must be positive and strictly increasing.");
|
|
120
|
+
}
|
|
121
|
+
previous = wavelengthNm;
|
|
122
|
+
return {
|
|
123
|
+
wavelengthNm,
|
|
124
|
+
focalLengthShiftMicrometers: requireFinite(`dispersion.samples[${index}].focalLengthShiftMicrometers`, record.focalLengthShiftMicrometers)
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function imageDistanceMm(focalLengthMm, objectDistanceM) {
|
|
129
|
+
const objectMm = objectDistanceM * 1000;
|
|
130
|
+
if (objectMm <= focalLengthMm) {
|
|
131
|
+
throw new InvalidScientificInputError("Object distances must lie beyond the wavelength-dependent focal length.");
|
|
132
|
+
}
|
|
133
|
+
return (focalLengthMm * objectMm) / (objectMm - focalLengthMm);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Wavelength-dependent focus for one wavelength: focal length, image distance, signed defocus at
|
|
137
|
+
* a sensor focused at the reference wavelength, geometric blur and the defocus wavefront.
|
|
138
|
+
*/
|
|
139
|
+
export function calculateLongitudinalChromaticFocus(input) {
|
|
140
|
+
requireInputKeys(input, "calculateLongitudinalChromaticFocus", ["focalLengthMm", "referenceWavelengthNm", "wavelengthNm", "apertureFNumber", "focusDistanceM", "subjectDistanceM", "dispersion"]);
|
|
141
|
+
requirePositiveFinite("focalLengthMm", input.focalLengthMm);
|
|
142
|
+
requirePositiveFinite("referenceWavelengthNm", input.referenceWavelengthNm);
|
|
143
|
+
requirePositiveFinite("wavelengthNm", input.wavelengthNm);
|
|
144
|
+
requirePositiveFinite("apertureFNumber", input.apertureFNumber);
|
|
145
|
+
requirePositiveFinite("focusDistanceM", input.focusDistanceM);
|
|
146
|
+
const subjectDistanceM = input.subjectDistanceM ?? input.focusDistanceM;
|
|
147
|
+
requirePositiveFinite("subjectDistanceM", subjectDistanceM);
|
|
148
|
+
const dispersion = input.dispersion;
|
|
149
|
+
if (typeof dispersion !== "object" || dispersion === null) {
|
|
150
|
+
throw new InvalidConfigurationError("dispersion must be an object.");
|
|
151
|
+
}
|
|
152
|
+
let focalLengthAtWavelengthMm;
|
|
153
|
+
let model;
|
|
154
|
+
let dispersionAssumption;
|
|
155
|
+
if (dispersion.kind === "thin-singlet-abbe") {
|
|
156
|
+
validateAbbe(dispersion.refractiveIndexD, dispersion.abbeNumberD);
|
|
157
|
+
validateCauchyWavelength("referenceWavelengthNm", input.referenceWavelengthNm);
|
|
158
|
+
validateCauchyWavelength("wavelengthNm", input.wavelengthNm);
|
|
159
|
+
const nRef = cauchyIndex(dispersion.refractiveIndexD, dispersion.abbeNumberD, input.referenceWavelengthNm);
|
|
160
|
+
const nLambda = cauchyIndex(dispersion.refractiveIndexD, dispersion.abbeNumberD, input.wavelengthNm);
|
|
161
|
+
focalLengthAtWavelengthMm = (input.focalLengthMm * (nRef - 1)) / (nLambda - 1);
|
|
162
|
+
model = "thin-singlet-abbe-longitudinal-chromatic-focus";
|
|
163
|
+
dispersionAssumption =
|
|
164
|
+
"Ideal thin singlet with two-term Cauchy dispersion fitted to n_d and V_d; f(lambda) = f_ref (n_ref - 1) / (n(lambda) - 1)";
|
|
165
|
+
}
|
|
166
|
+
else if (dispersion.kind === "declared-focal-shift") {
|
|
167
|
+
const samples = parseSamples(dispersion.samples);
|
|
168
|
+
const shiftRef = interpolateShift(samples, input.referenceWavelengthNm, "referenceWavelengthNm");
|
|
169
|
+
const shift = interpolateShift(samples, input.wavelengthNm, "wavelengthNm");
|
|
170
|
+
focalLengthAtWavelengthMm = input.focalLengthMm + (shift - shiftRef) / 1000;
|
|
171
|
+
model = "declared-focal-shift-longitudinal-chromatic-focus";
|
|
172
|
+
dispersionAssumption =
|
|
173
|
+
"Caller-declared focal-length shift table, linearly interpolated and re-referenced to the reference wavelength; no extrapolation";
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
throw new InvalidConfigurationError("dispersion.kind is invalid.");
|
|
177
|
+
}
|
|
178
|
+
if (!(focalLengthAtWavelengthMm > 0) || !Number.isFinite(focalLengthAtWavelengthMm)) {
|
|
179
|
+
throw new InvalidScientificInputError("Wavelength-dependent focal length must remain finite and positive.");
|
|
180
|
+
}
|
|
181
|
+
const sensorImageDistanceMm = imageDistanceMm(input.focalLengthMm, input.focusDistanceM);
|
|
182
|
+
const imageDistanceAtWavelengthMm = imageDistanceMm(focalLengthAtWavelengthMm, subjectDistanceM);
|
|
183
|
+
const pupilDiameterMm = input.focalLengthMm / input.apertureFNumber;
|
|
184
|
+
const defocusMm = sensorImageDistanceMm - imageDistanceAtWavelengthMm;
|
|
185
|
+
const workingFNumberAtWavelength = imageDistanceAtWavelengthMm / pupilDiameterMm;
|
|
186
|
+
const wavefront = calculateDefocusWavefront({
|
|
187
|
+
signedDefocusImagePlaneMicrometers: defocusMm * 1000,
|
|
188
|
+
workingFNumber: workingFNumberAtWavelength
|
|
189
|
+
}).value;
|
|
190
|
+
return approximationResult({
|
|
191
|
+
wavelengthNm: input.wavelengthNm,
|
|
192
|
+
referenceWavelengthNm: input.referenceWavelengthNm,
|
|
193
|
+
focalLengthAtWavelengthMm,
|
|
194
|
+
focalShiftMicrometers: (focalLengthAtWavelengthMm - input.focalLengthMm) * 1000,
|
|
195
|
+
sensorImageDistanceMm,
|
|
196
|
+
imageDistanceAtWavelengthMm,
|
|
197
|
+
signedDefocusImagePlaneMicrometers: defocusMm * 1000,
|
|
198
|
+
geometricBlurDiameterMm: (pupilDiameterMm * Math.abs(defocusMm)) / imageDistanceAtWavelengthMm,
|
|
199
|
+
workingFNumberAtWavelength,
|
|
200
|
+
w020Micrometers: wavefront.w020Micrometers,
|
|
201
|
+
zernikeZ4Micrometers: wavefront.zernikeZ4Micrometers
|
|
202
|
+
}, model, "1.0.0", [
|
|
203
|
+
dispersionAssumption,
|
|
204
|
+
"Gaussian thin-lens imaging; the sensor is focused on focusDistanceM at the reference wavelength",
|
|
205
|
+
"Entrance-pupil diameter f_ref / N is wavelength independent; distances are measured from ideal principal planes",
|
|
206
|
+
"Longitudinal chromatic focus only: lateral chromatic magnification, spherochromatism and sensor response are separate",
|
|
207
|
+
"Wavelength basis must match the dispersion data; no air/vacuum conversion is performed"
|
|
208
|
+
]);
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=longitudinal-chromatic-aberration.js.map
|