CompactRaytraces

class raytracing.compact.CompactRaytraces(compactRays, traceLength)

Bases: RayTraces

A collection of all ray traces from a GPU computation.

After propagating M input rays through N optical elements, the GPU produces an output buffer of M x N rays. CompactRaytraces organises this flat buffer into M individual CompactRaytrace slices, one per input ray, so that traces[i] gives the full journey of the i-th ray through the optical system.

Inherits __str__, __repr__, __iter__, and __next__ from RayTraces. Overrides __len__ and __getitem__ for buffer access.

Parameters:
  • compactRays (CompactRays) – The flat output buffer of size M x N.

  • traceLength (int) – Number of optical elements (N), i.e. the length of each trace.

Methods

__init__(compactRays, traceLength)

Inherited Methods

Attributes

lastRays

The last ray from each trace, as a Rays collection.