Ray#
- class Ray(origin, direction, intensity: float = 1.0, wavelength=None, length=None, alive=True, qo=None, w0=None, **kwargs)[source]#
Bases:
VectorGeometric ray object, with Gaussian beam parameters.
- __init__(origin, direction, intensity: float = 1.0, wavelength=None, length=None, alive=True, qo=None, w0=None, **kwargs)[source]#
Initialize a ray.
- Parameters:
origin – Ray origin in lab coordinates.
direction – Propagation direction (normalized internally).
intensity – Relative ray intensity.
wavelength – Wavelength in model units.
length – Optional finite rendering/segment length.
alive – If
False, ray is ignored in interaction steps.qo – Optional Gaussian beam complex
qat origin.w0 – Optional beam waist radius used to derive
qo.
- render(ax, type: str, **kwargs)[source]#
Render the ray.
- Parameters:
ax – Matplotlib axis to render on.
type – “Z” for 2D rendering xOy plane, “3D” for 3D rendering.
**kwargs – Additional rendering options. - color: (default “black”) Color of the ray. - physical_color: (default False) If True, color is based on wavelength. - linewidth: (default 0.5) Width of the ray line. - linestyle: (default “-”) Style of the ray line. - ray_arrow: (default False) If True, draw an arrow indicating direction. - gaussian_beam: (default False) If True, render Gaussian beam envelope. - detailed_render: (default False) If True, render detailed Gaussian beam contours. - render_line: (default True) If True, render the ray line. - arrow: (default False) If True, draw an arrow indicating direction in 3D. - spot_size_scale: (default 1.0) Scale factor for the Gaussian beam spot size. - annote_waist: (default False) If True, annotate the waist position.
- Returns:
The ray is rendered on the provided axis.
- Return type:
None