iactrace.analysis¶
Analysis tools for post-processing ray bundles.
Focal Surface¶
Intersect a RayBundle with a parametric focal surface
to inspect spot diagrams, chief-ray angles, and other PSF metrics
without going through the camera’s pixel binning.
- class iactrace.analysis.FocalSurface[source]¶
Bases:
ModuleAbstract focal surface attached to the camera frame.
Subclasses implement
_intersect_local(), which receives a single ray already transformed into the surface-local frame (vertex at origin, +Z along the surface normal at the vertex). The baseintersect()handles materialisation of lazy bundles, the world->local transform, and vectorisation across rays.- position = <dataclasses._MISSING_TYPE object>¶
- rotation = <dataclasses._MISSING_TYPE object>¶
- intersect(ray_bundle)[source]¶
Intersect every ray in
ray_bundlewith this focal surface.Lazy bundles are materialised first; per-ray analysis cannot fold.
- __init__(position, rotation)¶
- class iactrace.analysis.FlatFocalPlane[source]¶
Bases:
FocalSurfaceA flat focal plane.
The plane passes through
positionwith its normal aligned with the local +Z axis defined byrotation. This is the same modelintersect_sensor()uses for sensors, just without pixel binning.
- class iactrace.analysis.AsphericFocalSurface[source]¶
Bases:
FocalSurfaceA rotationally-symmetric aspheric focal surface.
Parameterisation matches
AsphericSurfaceGroup; the surface sag is- z(r) = c r^2 / (1 + sqrt(1 - (1 + k) c^2 r^2))
sum_i a_i r^(2i+4)
with
r^2 = x^2 + y^2in the local frame, i.e.aspherics[i]multipliesr^(2i + 4)– the polynomial starts atr^4, since anr^2term would be degenerate withcurvature. The vertex sits atpositionand the optical axis points along the local +Z (set byrotation). Pure conics are recovered withaspherics=None;curvature = 0reduces to a flat plane (Newton converges in one step from the closed-form conic init).- curvature = <dataclasses._MISSING_TYPE object>¶
- conic = <dataclasses._MISSING_TYPE object>¶
- aspherics = <dataclasses._MISSING_TYPE object>¶
- class iactrace.analysis.FocalSurfaceHits[source]¶
Bases:
ModuleResult of intersecting a
RayBundlewith aFocalSurface.All arrays have leading dimension
n_raysand are aligned with the input bundle. Dead rays appear withhit_mask = Falseand meaningless values in the position/direction arrays: always filter withhit_mask(oralive) before usingxy_localfor plotting or statistics.- Attributes:
- xy_local: Tangent-plane coordinates at the hit, in the surface-local
frame (n_rays, 2).
- z_local: Sag of the surface at the hit (n_rays,). Always 0 for a flat
focal plane.
- t: Ray parameter at the hit; equals the world-frame distance travelled
from
ray_bundle.originsto the surface (n_rays,).- hit_mask: Liveness at the surface (n_rays,):
Truefor a ray that was still alive on arrival and crossed this surface. This is the input bundle’s
aliveflag ANDed with a real intersection, so a ray lost upstream (shadowed, off-aperture) isFalsehere even if its stale geometry would formally cross the surface.- directions_local: Ray directions in the surface-local frame (n_rays, 3).
Useful for chief-ray / angle-of-incidence analysis.
- opl: Per-ray optical path length from the source wavefront to the
focal surface, in metres (n_rays,). Equals
ray_bundle.path_length + t * ray_bundle.n.
- xy_local = <dataclasses._MISSING_TYPE object>¶
- z_local = <dataclasses._MISSING_TYPE object>¶
- t = <dataclasses._MISSING_TYPE object>¶
- hit_mask = <dataclasses._MISSING_TYPE object>¶
- directions_local = <dataclasses._MISSING_TYPE object>¶
- opl = <dataclasses._MISSING_TYPE object>¶
- values = <dataclasses._MISSING_TYPE object>¶
- property alive¶
Rays that reached the surface carrying light (
hit_mask & values > 0).The one-stop filter for photometry / spot diagrams: it excludes both geometry loss (
hit_mask) and rays attenuated to zero throughput such as absorbed or totally-internally-reflected rays.
- __init__(xy_local, z_local, t, hit_mask, directions_local, opl, values)¶